Closed Bug 1364297 Opened 3 years ago Closed 3 years ago
Add name option to workers
We added names to dedicated workers in HTML, mainly for debugging purposes, based on a WebKit request: https://github.com/whatwg/html/commit/3bb652169741d5dd94d7f1b390f6491e38d640cb. This supplements how shared workers already have names. This is also tied up in the WorkerOptions version of the Worker/SharedWorker constructors used for module workers, but it's possible to implement just the name part of WorkerOptions without any module stuff. Tests: - http://w3c-test.org/workers/name-property.html - http://w3c-test.org/workers/shared-worker-name-via-options.html The actual spec PR was merged a bit prematurely; multiple vendors were on board with the idea, but not everyone got a chance to review the final proposed API shape. So if there are objections please let us know and we can revise the spec or revert it.
Ben, looks this is a nice but not super critical enhancement. Let me know if we want to get it prioritized.
Priority: -- → P3
I'd prefer storing the string as normal nsString, not nsCString, unless there is some good reason to use nsCString.
I had to split ServiceWorkerScope from WorkerName. This makes sense, btw.
Attachment #8868532 - Flags: review?(bugs)
Pushed by email@example.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/df81d9654736 Worker and SharedWorker constructors have an optional WorkerOptions parameter, r=smaug https://hg.mozilla.org/integration/mozilla-inbound/rev/d52a1c7cf0a3 Use nsString instead nsCString for Worker names, r=smaug
I've updated all the pages that need to include a mention of the new name properties/options: https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/name https://developer.mozilla.org/en-US/docs/Web/API/SharedWorkerGlobalScope https://developer.mozilla.org/en-US/docs/Web/API/SharedWorkerGlobalScope/name https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker/SharedWorker https://developer.mozilla.org/en-US/docs/Web/API/Worker https://developer.mozilla.org/en-US/docs/Web/API/Worker/Worker I've also added a note to the Fx55 rel notes: https://developer.mozilla.org/en-US/Firefox/Releases/55#DOM_HTML_DOM Let me know if that's all OK. Cheers!
You need to log in before you can comment on or make changes to this bug.