remove URL.createObjectURL from ServiceWorker

RESOLVED FIXED in Firefox 63

Status

()

P2
normal
RESOLVED FIXED
3 years ago
6 months ago

People

(Reporter: bkelly, Assigned: ytausky)

Tracking

(Blocks: 1 bug, {dev-doc-complete, site-compat})

Trunk
mozilla63
dev-doc-complete, site-compat
Points:
---

Firefox Tracking Flags

(firefox63 fixed)

Details

(Whiteboard: btpp-fixlater[wptsync upstream])

Attachments

(1 attachment)

We decided to remove createObjectURL from ServiceWorker context since blob URLs have lifecycle problems on service workers and Response objects have better semantics.

  https://github.com/slightlyoff/ServiceWorker/issues/688
Whiteboard: btpp-fixlater
Keywords: dev-doc-needed
Priority: -- → P2
Assignee: nobody → ytausky
Status: NEW → ASSIGNED
(Assignee)

Comment 1

8 months ago
The appropriate lifetime for URLs created with URL.createObjectURL turned
out to be tricky to define, so it was decided to hide it from service
workers altogether. (https://github.com/slightlyoff/ServiceWorker/issues/688)

This commit implements this change and adds a web platform test to verify it.
It also exposes the MediaSource variant of URL.createObjectURL in DedicatedWorker
and SharedWorker contexts in order to comply with the WebIDL spec (see
https://github.com/w3c/media-source/issues/168#issuecomment-410269436).
Comment on attachment 8997470 [details]
Bug 1264182: Hide URL.createObjectURL from ServiceWorker

Blake Kaplan (:mrbkap) has approved the revision.

https://phabricator.services.mozilla.com/D2728
Attachment #8997470 - Flags: review+
Comment on attachment 8997470 [details]
Bug 1264182: Hide URL.createObjectURL from ServiceWorker

Andrew Sutherland [:asuth] has approved the revision.

https://phabricator.services.mozilla.com/D2728
Attachment #8997470 - Flags: review+

Comment 4

8 months ago
Pushed by bugmail@asutherland.org:
https://hg.mozilla.org/integration/autoland/rev/40d4999db319
Hide URL.createObjectURL from ServiceWorker r=mrbkap,asuth
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/12339 for changes under testing/web-platform/tests
Whiteboard: btpp-fixlater → btpp-fixlater[wptsync upstream]
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.

Comment 7

8 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/40d4999db319
Status: ASSIGNED → RESOLVED
Last Resolved: 8 months ago
status-firefox63: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
Upstream PR merged
Doc updates:

The createObjectURL() page already had this information; updated revokeObjectURL() and added a note to Firefox 63 for developers.

I've also submitted PR #2707 on BCD to note these changes in the compatibility database.
Keywords: dev-doc-needed → dev-doc-complete
status-firefox48: affected → ---
Aha, I’ve just found URL.createObjectURL in my own service worker. Fortunately this particular app is no longer maintained, but I’m wondering if this change may break similar code. Will monitor reports.

https://github.com/bzdeck/bzdeck/blob/master/webroot/static/scripts/workers/service-worker.js
You need to log in before you can comment on or make changes to this bug.