Firefox Tomorrow

web api interface

WorkerLocation

View on MDN ↗

Available in workers

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 location property obtained by calling self.location.

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

Instance properties

  • href Read only
    • : Returns a string containing the serialized URL for the worker’s location.
  • protocol Read only
    • : Returns the protocol part of the worker’s location.
  • host Read only
    • : Returns the host part of the worker’s location.
  • hostname Read only
    • : Returns the hostname part of the worker’s location.
  • origin Read only
    • : Returns the worker’s origin.
  • port Read only
    • : Returns the port part of the worker’s location.
  • pathname Read only
    • : Returns the pathname part of the worker’s location.
  • search Read only
    • : Returns the search part of the worker’s location.
  • hash Read only
    • : Returns the hash part of the worker’s location.

Instance methods

  • toString()
    • : Returns a string containing the serialized URL for the worker’s location. It is a synonym for href.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also