MDN/Get involved/Events/HackOnMDN/Project: Service Workers: Difference between revisions

Jump to navigation Jump to search
Updated notes & implementation status for Chrome & Firefox
(Chrome SW debugging - added chromebug comment ref)
(Updated notes & implementation status for Chrome & Firefox)
Line 143: Line 143:
** On '''Chrome''' you could start Chrome with the '''--ignore-certificate-errors''' command-line parameter which will disable SSL certificate checks for the session.
** On '''Chrome''' you could start Chrome with the '''--ignore-certificate-errors''' command-line parameter which will disable SSL certificate checks for the session.
* Firefox Nightly (as of 03-28) seems to fail to register SW - [https://jakearchibald.github.io/trained-to-thrill/ https://jakearchibald.github.io/trained-to-thrill/] works in chrome as intended, while ''navigator.serviceWorker.controller''returns ''null'' on Nightly even after install, should be using Maple builds: [http://blog.wanderview.com/sw-builds/ http://blog.wanderview.com/sw-builds/] (download/install & use '''firefox -P -no-remote'''''to create a new profile and run it next to standard firefox)''
* Firefox Nightly (as of 03-28) seems to fail to register SW - [https://jakearchibald.github.io/trained-to-thrill/ https://jakearchibald.github.io/trained-to-thrill/] works in chrome as intended, while ''navigator.serviceWorker.controller''returns ''null'' on Nightly even after install, should be using Maple builds: [http://blog.wanderview.com/sw-builds/ http://blog.wanderview.com/sw-builds/] (download/install & use '''firefox -P -no-remote'''''to create a new profile and run it next to standard firefox)''
** Later nightly builds like that of 04-10 and later seem to work, mostly obsolating the need for using SW-specific builds.
* NOTE that '''Chrome''' (as of V43.0.2342.2 dev (64-bit)) '''does not support add/addAll''' methods out-of-the-box on opened cache objects - you will need a polyfill ([https://github.com/coonsta/cache-polyfill) https://github.com/coonsta/cache-polyfill)] to use it. Chrome bug for native addAll() support in blink-dev: [https://code.google.com/p/chromium/issues/detail?id=440298 https://code.google.com/p/chromium/issues/detail?id=440298]
* NOTE that '''Chrome''' (as of V43.0.2342.2 dev (64-bit)) '''does not support add/addAll''' methods out-of-the-box on opened cache objects - you will need a polyfill ([https://github.com/coonsta/cache-polyfill) https://github.com/coonsta/cache-polyfill)] to use it. Chrome bug for native addAll() support in blink-dev: [https://code.google.com/p/chromium/issues/detail?id=440298 https://code.google.com/p/chromium/issues/detail?id=440298]
* NOTE Chrome's Service Worker communication samples ([https://github.com/GoogleChrome/samples/tree/gh-pages/service-worker/post-message) https://github.com/GoogleChrome/samples/tree/gh-pages/service-worker/post-message)] recommend using the MessagePort API for passing messages between the SW/page. Firefox does not really implement the API {{bug|952139}} - further info is required on implementation status or on how could this be overcome.
 
* NOTE Chrome's Service Worker communication samples ([https://github.com/GoogleChrome/samples/tree/gh-pages/service-worker/post-message) https://github.com/GoogleChrome/samples/tree/gh-pages/service-worker/post-message)] recommend using the MessagePort API for passing messages between the SW/page.
** Firefox does not really implement the API {{bug|952139}} - further info is required on implementation status or on how could this be overcome.
** As of the time of writing, even Chrome does not imlement the latest spec in this regard. More info on this on [https://github.com/slightlyoff/ServiceWorker/issues/662 GitHub] and linked [https://stackoverflow.com/questions/29230470/equivalent-of-sharedworker-port-in-serviceworker StackOverflow post].
 
* Docs changes: in [https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API/Using_Service_Workers#The_premise_of_Service_Workers https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API/Using_Service_Workers#The_premise_of_Service_Workers]
* Docs changes: in [https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API/Using_Service_Workers#The_premise_of_Service_Workers https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API/Using_Service_Workers#The_premise_of_Service_Workers]
** '''Missing:''' [https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/register https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/register] - not even mentioned on the [https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker] page
** '''Missing:''' [https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/register https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker/register] - not even mentioned on the [https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker] page
**  
**


=ServiceWorkers - Developer QuickStart Reference=
=ServiceWorkers - Developer QuickStart Reference=
Confirmed users
61

edits

Navigation menu