Primary eng (and PM) emails
Summary
Remove URL.createObjectURL, URL.revokeObjectURL from Service Workers
Motivation
Service Worker inherited URL minting methods for blobs (URL.createObjectURL, URL.revokeObjectURL) since they were exposed to Window and Worker contexts by default. This was raised as an issue [1] since the URL lifetime is tied to the lifetime of the creation context, but SWs are (by design) shut down promptly. The resolution to the issue was to forbid these methods in SW contexts.
The relevant spec (File API) was updated[2]. I'm following up with MediaSource [3] as well, assuming the same logic applies.
[1] https://github.com/slightlyoff/ServiceWorker/issues/688
[2] https://w3c.github.io/FileAPI/
[3] https://github.com/w3c/media-source/issues/67
Compatibility Risk
Only affects Service Workers, and use of the URLs would have been flaky at best.
Gecko is also removing the methods.
Alternative implementation suggestion for web developers
In a Service Worker, the model is inverted - you're almost certainly servicing a fetch from a page via a FetchEvent with a URL that you want to intercept and provide a response for. In that case you can simply respondWith(new Response(blob)).
Usage information from UseCounter
n/a - we're removing ASAP
OWP launch tracking bug
n/a - we're hoping no-one even noticed these were present...
Entry on the feature dashboard
n/a - these aren't the droids you're looking for...
Requesting approval to remove too?
Yes.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Seems likely to be low risk, but in general I don't like relying on "hope" when it comes to potentially breaking sites. It doesn't seem impossible to me that some library code (designed for non-worker scenarios but used in a SW) is somehow depending on these APIs existing, right?
Perhaps it's not too late to get a deprecation warning (with UseCounter) merged back to 51, then you can remove in trunk after a few days of data confirms there's no usage in beta. WDYT?
Unfortunately use counters aren't supported yet in shared and service workers. So getting data would be significantly harder than that.
Unfortunately use counters aren't supported yet in shared and service workers. So getting data would be significantly harder than that.
I believe the worker team has it as one of their okr's this quarter. I'm sure they'll correct me if I'm wrong.
Yes, but I also think getting UMA and UseCounters fixed for both fast shutdown and workers is the P0 we keep ignoring here...
Yay! Carry on then. :)