[w3c/ServiceWorker] How can we use SW module link in backward-compatible manner? (#1186)

For JS files loaded by \<script\>, we can support both module-aware browsers and non-module-aware browsers as below:

```html
<script type="module" src="module_script.js"></script>
<script nomodule src="classic_script.js"></script>
```

Module-aware browsers load the first one, and non-module aware browsers load the second one by ignoring `type="module"` script and nomodule attribute.

Then, how about `Link:` headers and \<link\> tags with `rel="serviceworker"`?
IIUC, there is no similar trick to prevent old browsers from loading SW script link with `workertype="module"`, or to disable classic SW on new browsers.

To achieve that, IMO, can we change `rel="serviceworker"` to `rel="some-keyword-other-than-serviceworker-to-declare-serviceworker-module"` for `workertype="module"`, and add `nomodule` keyword to \<link\>?

-- 
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/1186

Received on Monday, 14 August 2017 07:29:50 UTC