名称
只读特性在
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 a
名称
选项:
var myWorker = new SharedWorker("worker.js", { name : "mySharedWorker" });
the
SharedWorkerGlobalScope
will now have a name of "mySharedWorker", returnable by running
self.name
from inside the shared worker.
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of 'name' in that specification. |
实时标准 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
名称
|
Chrome Yes | Edge ≤79 | Firefox 55 | IE No | Opera 10.6 | Safari No | WebView Android Yes | Chrome Android 40 | Firefox Android 55 | Opera Android Yes | Safari iOS No | Samsung Internet Android 4.0 |
完整支持
不支持