Location
Types
t
The location (WebApiURL) of the object it is linked to. Changes done on it are reflected on the object it relates to. Both the Document and Window interface have such a linked Location, accessible via Document.location and Window.location respectively. See Location on MDN TODO: mark as private once mutating fields of private records is allowed
type t = { mutable href: string, origin: string, mutable protocol: string, mutable host: string, mutable hostname: string, mutable port: string, mutable pathname: string, mutable search: string, mutable hash: string, ancestorOrigins: WebAPI.DOM.domStringList,}Record fields
href
Returns the Location object's URL.
Can be set, to navigate to the given URL. Read more on MDN
protocol
Returns the Location object's WebApiURL's scheme.
Can be set, to navigate to the same WebApiURL with a changed scheme. Read more on MDN
host
Returns the Location object's WebApiURL's host and port (if different from the default port for the scheme).
Can be set, to navigate to the same WebApiURL with a changed host and port. Read more on MDN
hostname
Returns the Location object's WebApiURL's host.
Can be set, to navigate to the same WebApiURL with a changed host. Read more on MDN
port
Returns the Location object's WebApiURL's port.
Can be set, to navigate to the same WebApiURL with a changed port. Read more on MDN
pathname
Returns the Location object's WebApiURL's path.
Can be set, to navigate to the same WebApiURL with a changed path. Read more on MDN
search
Returns the Location object's WebApiURL's query (includes leading "?" if non-empty).
Can be set, to navigate to the same WebApiURL with a changed query (ignores leading "?"). Read more on MDN
hash
Returns the Location object's WebApiURL's fragment (includes leading "#" if non-empty).
Can be set, to navigate to the same WebApiURL with a changed fragment (ignores leading "#"). Read more on MDN
ancestorOrigins
Returns a DOMStringList object listing the origins of the ancestor browsing contexts, from the parent browsing context to the top-level browsing context. Read more on MDN
Values
replace
Removes the current page from the session history and navigates to the given URL. Read more on MDN
let replace: (t, string) => unit