GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MDN
  • HTML: Markup language
  • Elements
  • Global attributes
  • Attributes
  • See all…
  • Responsive images
  • HTML cheatsheet
  • Date & time formats
  • See all…
  • SVG
  • MathML
  • XML
  • CSS: Styling language

This view

  • Original page
  • New address

GeezerVison is showing developer.mozilla.org — NavigationDestination - Web APIs | MDN

NavigationDestination

Baseline 2026
Newly available

Since January 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

  • See full compatibility
  • Learn more

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

It is accessed via the NavigateEvent.destination property.

Instance properties

id Read only

Returns the id value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise.

index Read only

Returns the index value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or -1 otherwise.

key Read only

Returns the key value of the destination NavigationHistoryEntry if the NavigateEvent.navigationType is traverse, or an empty string otherwise.

sameDocument Read only

Returns true if the navigation is to the same document as the current Document value, or false otherwise.

url Read only

Returns the URL being navigated to.

Instance methods

getState()

Returns a clone of the available state associated with the destination NavigationHistoryEntry, or navigation operation (e.g., navigate()) as appropriate.

Examples

js
navigation.addEventListener("navigate", (event) => {
  // Exit early if this navigation shouldn't be intercepted,
  // e.g. if the navigation is cross-origin, or a download request
  if (shouldNotIntercept(event)) {
    return;
  }

  // Returns a URL() object constructed from the
  // NavigationDestination.url value
  const url = new URL(event.destination.url);

  if (url.pathname.startsWith("/articles/")) {
    event.intercept({
      async handler() {
        // The URL has already changed, so show a placeholder while
        // fetching the new content, such as a spinner or loading page
        renderArticlePagePlaceholder();

        // Fetch the new content and display when ready
        const articleContent = await getArticleContent(url.pathname);
        renderArticlePage(articleContent);
      },
    });
  }
});

Specifications

Specification
HTML
# the-navigationdestination-interface

Browser compatibility

See also

  • Modern client-side routing: the Navigation API
  • Navigation API explainer
  • Navigation API live demo (view demo source)

Help improve MDN

Learn how to contribute

This page was last modified on Dec 8, 2025 by MDN contributors.

View this page on GitHub • Report a problem with this content
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.