Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. DedicatedWorkerGlobalScope
  4. name

DedicatedWorkerGlobalScope: name property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2019.

Note: This feature is only available inDedicated Web Workers.

Thename read-only property of theDedicatedWorkerGlobalScope interface returns the name that theWorker was (optionally) given when it was created. This is the name thattheWorker() constructor can pass to get a reference totheDedicatedWorkerGlobalScope.

Value

A string.

Examples

If a worker is created using a constructor with aname option:

js
const myWorker = new Worker("worker.js", { name: "myWorker" });

theDedicatedWorkerGlobalScope will now have a name of "myWorker",returnable by running

js
self.name;

from inside the worker.

Specifications

Specification
HTML
# dom-dedicatedworkerglobalscope-name-dev

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp