Re: [w3c/ServiceWorker] consider allow late importScripts/import for local URLs (#1595)

One non-extension use case is loading script from IDB as a blob.  Today you would have to read it all into memory and use eval, but importing from blob url would be more natural.  I know of one major site storing script in IDB, although I don't think they need to import it in their service worker today.

I think the main alternative is #1585.  That would support some form of `import()` for the web, but require similar early initialization for extensions.  It also continues the unfortunate behavior of "offlining" script resources that are in fact stored locally in the extension bundle (or blob, etc).

I know we could just throw this all behind a big "if extension" conditional and do whatever we want, but it would be nice if we could find a more principled alignment with the spec.  This leads to fewer surprises for developers, less maintenance burden, etc.

-- 
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/1595#issuecomment-862437270

Received on Wednesday, 16 June 2021 14:40:26 UTC