The name
read-only property of the SharedWorkerGlobalScope
interface returns the name that the SharedWorker
was (optionally) given when it was created. This is the name that the SharedWorker()
constructor can pass to get a reference to the SharedWorkerGlobalScope
.
var nameObj = self.name;
A DOMString
.
If a shared worker is created using a constructor with two arguments:
var myWorker = new SharedWorker("worker.js", "mySharedWorker");
the SharedWorkerGlobalScope
will now have a name of "mySharedworker", returnable by running
self.name
from inside the shared worker.
Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of 'name' in that specification. | Living Standard | No change from Web Workers. |
Web Workers The definition of 'name' in that specification. | Candidate Recommendation | Initial definition. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Support | 3 | 29.0 (29.0) | Not supported | 10.60 | Not supported |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Support | ? | Not supported | 29.0 (29.0) | 1.4 | ? | ? | ? |
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SharedWorkerGlobalScope/name