Skip to main content

NavigationDestination

The NavigationDestination interface of the Navigation API represents the destination being navigated to in the current navigation.

MDN Reference

Methods

getState()

getState(): any;

The getState() method of the NavigationDestination interface returns a clone of the developer-supplied state associated with the destination NavigationHistoryEntry, or navigation operation (e.g., navigate()) as appropriate.

MDN Reference

Returns

any

Properties

id

readonly id: string;

The id read-only property of the NavigationDestination interface returns the id value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise.

MDN Reference


index

readonly index: number;

The index read-only property of the NavigationDestination interface returns the index value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or -1 otherwise.

MDN Reference


key

readonly key: string;

The key read-only property of the NavigationDestination interface returns the key value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise.

MDN Reference


sameDocument

readonly sameDocument: boolean;

The sameDocument read-only property of the NavigationDestination interface returns true if the navigation is to the same document as the current Document value, or false otherwise.

MDN Reference


url

readonly url: string;

The url read-only property of the NavigationDestination interface returns the URL being navigated to.

MDN Reference