This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
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?
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.
This bug was cloned to create bug 18001 as part of operation convergence.
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).
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
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
disregard comment 5