Skip to content

Commit

Permalink
Add page for Navigation.activation (#36442)
Browse files Browse the repository at this point in the history
* Add page for `Navigation.activation`

* Update files/en-us/web/api/navigation/activation/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* update

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
skyclouds2001 and github-actions[bot] authored Oct 26, 2024
1 parent 4ef77e0 commit 132d7ff
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
39 changes: 39 additions & 0 deletions files/en-us/web/api/navigation/activation/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: "Navigation: activation property"
short-title: activation
slug: Web/API/Navigation/activation
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.Navigation.activation
---

{{APIRef("Navigation API")}}{{SeeCompatTable}}

The **`activation`** read-only property of the {{domxref("Navigation")}} interface returns a {{domxref("NavigationActivation")}} object containing information about the most recent cross-document navigation, which "activated" this Document. The property will stay constant during same-document navigations.

## Value

A {{domxref("NavigationActivation")}} object, or `null` if current document is the initial `about:blank` document.

## Examples

```js
if (navigation.activation) {
console.log(navigation.activation.entry.url);
}
```

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [Modern client-side routing: the Navigation API](https://developer.chrome.com/docs/web-platform/navigation-api/)
- [Navigation API explainer](https://github.com/WICG/navigation-api/blob/main/README.md)
- Domenic Denicola's [Navigation API live demo](https://gigantic-honored-octagon.glitch.me/)
4 changes: 4 additions & 0 deletions files/en-us/web/api/navigation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ The Navigation API only exposes history entries created in the current browsing

_Inherits properties from its parent, {{DOMxRef("EventTarget")}}._

- {{domxref("Navigation.activation", "activation")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns a {{domxref("NavigationActivation")}} object containing information about the most recent cross-document navigation, which "activated" this Document.
- {{domxref("Navigation.canGoBack", "canGoBack")}} {{ReadOnlyInline}} {{Experimental_Inline}}
- : Returns `true` if it is possible to navigate backwards in the navigation history
(i.e. the {{domxref("Navigation.currentEntry", "currentEntry")}} is not the first one in the history entry list),
Expand Down Expand Up @@ -58,6 +60,8 @@ _Inherits methods from its parent, {{DOMxRef("EventTarget")}}._

## Events

_Inherits events from its parent, {{DOMxRef("EventTarget")}}._

- {{domxref("Navigation/currententrychange_event", "currententrychange")}} {{Experimental_Inline}}
- : Fired when the {{domxref("Navigation.currentEntry")}} has changed.
- {{domxref("Navigation/navigate_event", "navigate")}} {{Experimental_Inline}}
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/navigation_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ There are a few perceived limitations with the Navigation API:
- : Event object for the {{domxref("Navigation/navigate_event", "navigate")}} event, which fires when [any type of navigation](https://github.com/WICG/navigation-api#appendix-types-of-navigations) is initiated. It provides access to information about that navigation, and most notably the {{domxref("NavigateEvent.intercept", "intercept()")}}, which allows you to control what happens when the navigation is initiated.
- {{domxref("Navigation")}} {{Experimental_Inline}}
- : Allows control over all navigation actions for the current `window` in one central place, including initiating navigations programmatically, examining navigation history entries, and managing navigations as they happen.
- {{domxref("NavigationActivation")}}
- {{domxref("NavigationActivation")}} {{Experimental_Inline}}
- : Represents a recent cross-document navigation. It contains the navigation type and current and destination document history entries.
- {{domxref("NavigationCurrentEntryChangeEvent")}} {{Experimental_Inline}}
- : Event object for the {{domxref("Navigation/currententrychange_event", "currententrychange")}} event, which fires when the {{domxref("Navigation.currentEntry")}} has changed. It provides access to the navigation type, and the previous history entry that was navigated from.
Expand Down

0 comments on commit 132d7ff

Please sign in to comment.