Issue metadata
Sign in to add a comment
|
S13nServiceWorker: multiple importScripts() calls with the same URL should import the same script |
||||||||||||||||||||||||
Issue description
See a following service worker script.
importScripts("foo.js");
importScripts("foo.js");
The second importScripts() call should import the script installed by the first importScripts() call. However, this doesn't work when we enable the SW script streaming and S13nSW. It is because InstalledScriptsManager doesn't exist on the installation phase and importScripts() always goes to the network.
,
Oct 4 2017
,
Mar 8 2018
Ah, I discovered this bug after filing issue 814583 for the same thing. Sorry. I ended up doing something like #2 since it was simpler than #1, getting InstalledScriptManager used for non-installed service workers and dynamically changing the avilable scripts looked quite a bit harder, and this is just a minor corner case. We might also need to use the new SWInstalledScriptLoader more generally for updates, which is moving in the spec to download and cache the scripts first before spawning a worker since the byte-to-byte check has to cover importScripts too. |
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by nhiroki@chromium.org
, Oct 4 2017