Re: [w3c/ServiceWorker] How should import() work in service workers? (#1585)

No, I'm asking about a late importScripts for an arbitrary script, the thing disallowed in #1319, AFAICT. The use case is the same as a dynamic `import()`: importing an arbitrary **local** script on demand at a later point in time. This is crucial for complex browser extensions based on a service worker (ManifestV3). Previously, extensions were using a standard `Window` environment for their background script and we could load arbitrary code via a DOM `script` element so an extension's background script was small and would load instantly on an event, it would then look at the message/event, dynamically load the necessary script, and let the latter handle the event. Complex scripts may have megabytes of code and to make things worse, Chrome doesn't allow code compilation cache for extensions to avoid privilege escalation attacks.

-- 
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/1585#issuecomment-855834492

Received on Monday, 7 June 2021 11:11:10 UTC