NavigationActivation: navigationType property

The navigationType read-only property of the NavigationActivation interface contains a string indicating the type of navigation.

Value

A string representing the type of navigation the NavigationActivation relates to. Possible values are:

Examples

js
window.addEventListener("pageswap", (event) => {
  // For example, the page was hidden, or the navigation is cross-document.
  if (!event.viewTransition) return;

  // Skip the view transition for back/forward navigations.
  if (event.activation.navigationType === "traverse") {
    event.viewTransition.skipTransition();
  }
});

Specifications

See also