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/es/conflicting/web/api/push_api/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'files/es/conflicting/web/api/push_api') diff --git a/files/es/conflicting/web/api/push_api/index.html b/files/es/conflicting/web/api/push_api/index.html index 016e0abcaa..ea87d50427 100644 --- a/files/es/conflicting/web/api/push_api/index.html +++ b/files/es/conflicting/web/api/push_api/index.html @@ -74,7 +74,7 @@ original_slug: Web/API/Push_API/Using_the_Push_API
  • Over in your service worker, set up a push event handler to respond to push messages being received.
    1. If you want to respond by sending a channel message back to the main context (see Step 6) you need to first get a reference to the port2 we sent over to the service worker context ({{domxref("MessagePort")}}). This is available on the {{domxref("MessageEvent")}} object passed to the onmessage handler ({{domxref("ServiceWorkerGlobalScope.onmessage")}}). Specifically, this is found in the ports property, index 0. Once this is done, you can send a message back to port1, using {{domxref("MessagePort.postMessage()")}}.
    2. -
    3. If you want to respond by firing a system notification, you can do this by calling {{domxref("ServiceWorkerRegistration.showNotification()")}}. Note that in our code we have run this inside an {{domxref("ExtendableEvent.waitUntil()")}} method — this extends the lifetime of the event until after the notification has been fired, so we can make sure everything has happened that we want to happen.
    4. +
    5. If you want to respond by firing a system notification, you can do this by calling {{domxref("ServiceWorkerRegistration.showNotification()")}}. Note that in our code we have run this inside an {{domxref("ExtendableEvent.waitUntil()")}} method — this extends the lifetime of the event until after the notification has been fired, so we can make sure everything has happened that we want to happen.
  • -- cgit v1.2.3-54-g00ecf