From 97065b2e68dd8768dc1ea092c893c57ebe205026 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Thu, 25 Feb 2021 08:31:36 -0500 Subject: use class="hidden" not style="display:none" --- files/zh-cn/conflicting/learn/css/building_blocks/selectors/index.html | 2 +- files/zh-cn/conflicting/web/api/push_api/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'files/zh-cn/conflicting') diff --git a/files/zh-cn/conflicting/learn/css/building_blocks/selectors/index.html b/files/zh-cn/conflicting/learn/css/building_blocks/selectors/index.html index 1ab629b72f..d2c7dcbbbb 100644 --- a/files/zh-cn/conflicting/learn/css/building_blocks/selectors/index.html +++ b/files/zh-cn/conflicting/learn/css/building_blocks/selectors/index.html @@ -358,7 +358,7 @@ a.homepage:hover, a.homepage:focus, a.homepage:active { - +
Go to our Home page  Go to our Home page
diff --git a/files/zh-cn/conflicting/web/api/push_api/index.html b/files/zh-cn/conflicting/web/api/push_api/index.html index 76526ed4ce..6f6f75ce4f 100644 --- a/files/zh-cn/conflicting/web/api/push_api/index.html +++ b/files/zh-cn/conflicting/web/api/push_api/index.html @@ -75,7 +75,7 @@ original_slug: Web/API/Push_API/Using_the_Push_API
  • 在你的 service worker 中,设置一个 push 事件句柄来响应接收到的推送消息。
    1. 如果你想要将一个信道消息发送回主 context(看第6步),你需要先取得之前发送给 service worker 的  port2 的引用 ({{domxref("MessagePort")}}) 。这个可以通过传给 onmessage handler ({{domxref("ServiceWorkerGlobalScope.onmessage")}}) 的{{domxref("MessageEvent")}} 对象取得。 具体地说,是 ports 属性的索引 0 。 之后你可以用 {{domxref("MessagePort.postMessage()")}} 来向 port1 发送消息 。
    2. -
    3. 如果你想要使用系统通知,可以调用 {{domxref("ServiceWorkerRegistration.showNotification()")}} 。注意,在我们的代码中,我们将其运行在一个 {{domxref("ExtendableEvent.waitUntil()")}} 方法中——这样做将事件的 生命周期(lifetime)扩展到了通知被处理后,使得我们可以确认事情像我们期望的那样进行。
    4. +
    5. 如果你想要使用系统通知,可以调用 {{domxref("ServiceWorkerRegistration.showNotification()")}} 。注意,在我们的代码中,我们将其运行在一个 {{domxref("ExtendableEvent.waitUntil()")}} 方法中——这样做将事件的 生命周期(lifetime)扩展到了通知被处理后,使得我们可以确认事情像我们期望的那样进行。
  • -- cgit v1.2.3-54-g00ecf