[ServiceWorker] Support module service workers, and update for ES6 (#831)

See https://github.com/whatwg/html/pull/608 which is now merged.

The essential work items are, I think:

- Add `WorkerType type = "classic";` to RegistrationOptions
- Updated https://github.com/slightlyoff/ServiceWorker/pull/828 to include a `type` parameter (@
mkruisselbrink)
- Update the registration process to more closely parallel [run a worker](https://html.spec.whatwg.org/#run-a-worker) and its callers e.g. [the Worker constructor](https://html.spec.whatwg.org/#dom-worker)
  - I haven't looked into the details of this very much because I'm not too familiar with the existing registration algorithm. I guess it's [run a service worker](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#run-service-worker-algorithm) that needs the most updating?
  - It seems likely this will require modifications to HTML to allow "fetch a module script tree" to disallow cross-origin requests. Let me know exactly what they are and I can do that. My guess would be you need something like "Fetch a same-origin module script tree given url and settings object."
- Maybe add an example of using the module version, similar to https://html.spec.whatwg.org/#module-worker-example

This seems relatively high priority since as per https://github.com/whatwg/html/pull/608 module and module worker implementation is starting quite soon for multiple implementers, and I imagine they'd want to do service workers at the same time as other workers.

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/831

Received on Friday, 12 February 2016 19:34:00 UTC