Location

interface

interface Location

The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Accessible via globalThis.location.

variable

var Location: { … }

The location (URL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Accessible via globalThis.location.

Constructors

constructor

new Location(): never

Properties

ancestorOrigins

readonly ancestorOrigins: DOMStringList

Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing context to the top-level browsing context.

Always empty in Ende.

hash

hash: string

Returns the Location object's URL's fragment (includes leading "#" if non-empty).

Cannot be set in Ende.

host

host: string

Returns the Location object's URL's host and port (if different from the default port for the scheme).

Cannot be set in Ende.

hostname

hostname: string

Returns the Location object's URL's host.

Cannot be set in Ende.

href

href: string

Returns the Location object's URL.

Cannot be set in Ende.

origin

readonly origin: string

Returns the Location object's URL's origin.

pathname

pathname: string

Returns the Location object's URL's path.

Cannot be set in Ende.

port

port: string

Returns the Location object's URL's port.

Cannot be set in Ende.

protocol

protocol: string

Returns the Location object's URL's scheme.

Cannot be set in Ende.

search: string

Returns the Location object's URL's query (includes leading "?" if non-empty).

Cannot be set in Ende.

prototype

readonly prototype: Location

Methods

toString

toString(): string

assign

assign(url: string): void

Navigates to the given URL.

Cannot be set in Ende.

reload

reload(): void

Reloads the current page.

Disabled in Ende.

reload(forcedReload: boolean): void

Deprecated.

replace

replace(url: string): void

Removes the current page from the session history and navigates to the given URL.

Disabled in Ende.

location

variable

var location: Location

The Location object describing the absolute URL of the main module, available when the program is started with the --location flag. Accessing it without --location throws.