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

@mkruisselbrink 

> We explicitly disallowed service workers from creating blob URLs, because lifetime of them would be even more confusing then blob URLs created elsewhere. For this particular use case it seems like the lifetime of them would be fine, but we'd have to re-enable blob URL creating in service workers for this to be possible.

Is the lifetime of blob urls tied to the client lifetime or is it more complicated than that?

I agree it's a footgun if folks start creating blob urls in a service worker and expect to be able to use them in a page. I guess there's no easy way to create a blob URL that can only be used from the client that created it?

It's still possible to turn these things into data URLs, so it might not be a big deal.

@mfalken just came up with an interesting point: What if:

1. Install service worker
2. Page messages the service worker a blob URL while it's installing
3. Service worker imports that blob URL, so it _should_ go into the map, which allows it to be used later.
4. It's used later, but the page is gone, so it fails.

Feels like we need to prevent blob URLs going into that map 😄 

-- 
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-868315967

Received on Friday, 25 June 2021 08:21:12 UTC