- From: Yaron Tausky <notifications@github.com>
- Date: Tue, 21 Aug 2018 03:27:43 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 21 August 2018 10:28:05 UTC
Consider the following code, which results in the installation of a new a new service worker:
```javascript
navigator.serviceWorker.register(script, scope)
.then(registration => {
registration.installing.postMessage('foo', []);
};
```
In step 6 of Install, a promise resolution task is queued to the DOM manipulation queue; in step 10 a task that dispatches the 'install' event to the worker is queued. If the same queue is used, the `then` callback would run before the event is dispatch. (If it's a different queue, the user can't tell in which order these events would happen.)
This is pretty confusing, since a user might expect that an installing worker will have already been notified about it.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/1347
Received on Tuesday, 21 August 2018 10:28:05 UTC