Firefox Tomorrow

web api instance method

NavigationDestination: getState() method

View on MDN ↗

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.

Syntax

getState()

Parameters

None.

Return value

A value representing the state. This can be any type.

If no state is defined, it returns undefined.

Exceptions

None.

Examples

navigation.addEventListener("navigate", (event) => {
  console.log(event.destination.getState());
});

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also