Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

WorkerLocation

この記事はまだボランティアによって 日本語 に翻訳されていません。ぜひ MDN に参加して翻訳を手伝ってください!

The WorkerLocation interface defines the absolute location of the script executed by the Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.location property obtained by calling window.self.location.

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

Properties

The WorkerLocation interface doesn't inherit any property, but implements properties defined in the URLUtilsReadOnly interface.

URLUtilsReadOnly.href Read only
Is a DOMString containing the whole URL of the script executed in the Worker.
URLUtilsReadOnly.protocol Read only
Is a DOMString containing the protocol scheme of the URL of the script executed in the Worker, including the final ':'.
URLUtilsReadOnly.host Read only
Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL of the script executed in the Worker.
URLUtilsReadOnly.hostname Read only
Is a DOMString containing the domain of the URL of the script executed in the Worker.
URLUtilsReadOnly.origin Read only
Returns a DOMString containing the canonical form of the origin of the specific location.
URLUtilsReadOnly.port Read only
Is a DOMString containing the port number of the URL of the script executed in the Worker.
URLUtilsReadOnly.pathname Read only
Is a DOMString containing an initial '/' followed by the path of the URL of the script executed in the Worker.
URLUtilsReadOnly.search Read only
Is a DOMString containing a '?' followed by the parameters of the URL of the script executed in the Worker.
URLUtilsReadOnly.hash Read only
Is a DOMString containing a '#' followed by the fragment identifier of the URL of the script executed in the Worker.

Methods

The WorkerLocation interface doesn't inherit any method, but implements methods defined in the URLUtilsReadOnly interface.

URLUtilsReadOnly.toString()
Returns a DOMString containing the whole URL of the script executed in the Worker. It is a synonym for URLUtilsReadOnly.href.

Specifications

Specification Status Comment
Web Workers
The definition of 'WorkerLocation' in that specification.
Editor's Draft Initial definition

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 3.5 (1.9.1) ? ? ?
origin ? 29 (29) ? ? ?
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? 1.0 (1.9.1) ? ? ?
origin ? ? 29.0 (29) ? ? ?

See also

ドキュメントのタグと貢献者

タグ: 
 このページの貢献者: Sebastianz, teoli
 最終更新者: Sebastianz,