- From: stefan hakansson <notifications@github.com>
- Date: Fri, 23 Dec 2016 06:10:46 -0800
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 23 December 2016 14:11:30 UTC
To put this in context, I do, to emulate background sync on Firefox, periodically check if ```navigator.onLine``` is ```true```, and when it is I fire an extendable event:
```
let e = new ExtendableEvent('sync');
e.tag = 'some_tag';
if (navigator.onLine)
self.dispatchEvent(e);
```
My event handler looks like:
```
self.addEventListener('sync', (evt) => {
if (evt.tag == 'some_tag') {
evt.waitUntil(doStuff());
}
});
```
where ```evt.waitUntil``` is taken from some Background sync tutorial. I understand it would not have any effect with my emulated background sync, but will it with the real background sync? Is that specified anywhere?
--
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/1040#issuecomment-268995335
Received on Friday, 23 December 2016 14:11:30 UTC