NavigationDestination: sameDocument property
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.
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.
This is useful for checking whether the navigation will be same-document or cross-document.
Value
A boolean.
Examples
js
navigation.addEventListener("navigate", (event) => {
console.log(event.destination.sameDocument);
});
Specifications
| Specification |
|---|
| HTML> # the-navigationdestination-interface:dom-navigationdestination-samedocument-2> |