Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. WorkerLocation

WorkerLocation

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

Note: This feature is only available inWeb Workers.

TheWorkerLocation interface defines the absolute location of the script executed by theWorker. Such an object is initialized for each worker and is available via theWorkerGlobalScope.location property obtained by callingself.location.

This interface is only visible from inside a JavaScript script executed in the context of a Web worker.

Instance properties

WorkerLocation.hrefRead only

Returns a string containing the serializedURL for the worker's location.

WorkerLocation.protocolRead only

Returns theprotocol part of the worker's location.

WorkerLocation.hostRead only

Returns thehost part of the worker's location.

WorkerLocation.hostnameRead only

Returns thehostname part of the worker's location.

WorkerLocation.originRead only

Returns the worker'sorigin.

WorkerLocation.portRead only

Returns theport part of the worker's location.

WorkerLocation.pathnameRead only

Returns thepathname part of the worker's location.

WorkerLocation.searchRead only

Returns thesearch part of the worker's location.

WorkerLocation.hashRead only

Returns thehash part of the worker's location.

Instance methods

WorkerLocation.toString()

Returns a string containing the serializedURL for the worker's location. It is a synonym forWorkerLocation.href.

Specifications

Specification
HTML
# worker-locations

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp