This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 15095 - Allow data: URL for new Worker(). Supported by Opera and Firefox.
Summary: Allow data: URL for new Worker(). Supported by Opera and Firefox.
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-07 06:28 UTC by contributor
Modified: 2012-08-09 18:30 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2011-12-07 06:28:30 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/workers.html
Multipage: http://www.whatwg.org/C#dom-worker
Complete: http://www.whatwg.org/c#dom-worker

Comment:
Allow data: URL for new Worker(). Supported by Opera and Firefox.

Posted from: 85.227.157.105 by simonp@opera.com
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_8) AppleWebKit/535.8 (KHTML, like Gecko) Chrome/17.0.942.0 Safari/535.8
Comment 1 Ian 'Hixie' Hickson 2011-12-07 23:29:19 UTC
So to do this I guess we just hack the origin to be the origin of the caller if the worker URL is a data: URL?
Comment 2 Simon Pieters 2011-12-08 09:16:08 UTC
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1274 - currently Firefox returns the empty string, Opera returns the full data: URL (although I think we have changed that to return 'null' instead). Since workers can use XHR, EventSource and WebSocket, I think it would be better to use the origin of the entry script.

Opera currently doesn't allow data: for shared workers (and Firefox doesn't support shared workers at all), but we have discussed adding support for it, but here it's more important than with dedicated workers that the origin is that of the caller, so that different origin pages that use the same data: URL for a shared worker don't actually share the worker, but use separate ones.
Comment 3 contributor 2012-07-18 07:59:33 UTC
This bug was cloned to create bug 18001 as part of operation convergence.
Comment 4 Ian 'Hixie' Hickson 2012-07-20 03:32:14 UTC
I've added this, but am leaving this bug open to deal with the following problem currently in the spec: the SharedWorker constructor doesn't use the origin of the script of the worker (it uses the origin of the URL of the location attribute, which is always unique for data: URLs).
Comment 5 contributor 2012-08-09 18:02:55 UTC
Checked in as WHATWG revision r7235.
Check-in comment: Improve compatibiliy for legacy features.
http://html5.org/tools/web-apps-tracker?from=7234&to=7235
Comment 6 contributor 2012-08-09 18:30:04 UTC
Checked in as WHATWG revision r7236.
Check-in comment: Recast how the origin handling is done for data: URLs in workers, and fix the shared worker origin handling for data: URLs so that you can actually reconnect to a data: shared worker.
http://html5.org/tools/web-apps-tracker?from=7235&to=7236
Comment 7 Ian 'Hixie' Hickson 2012-08-09 18:30:39 UTC
disregard comment 5