-
Notifications
You must be signed in to change notification settings - Fork 22.5k
/
index.md
42 lines (30 loc) · 1.24 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
title: "NavigationTransition: finished property"
short-title: finished
slug: Web/API/NavigationTransition/finished
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.NavigationTransition.finished
---
{{APIRef("Navigation API")}}{{SeeCompatTable}}
The **`finished`** read-only property of the
{{domxref("NavigationTransition")}} interface returns a {{jsxref("Promise")}} that fulfills at the same time the {{domxref("Navigation/navigatesuccess_event", "navigatesuccess")}} event fires, or rejects at the same time the {{domxref("Navigation/navigateerror_event", "navigateerror")}} event fires.
## Value
A {{jsxref("Promise")}} that resolves to `undefined`.
## Examples
```js
async function cleanupNavigation() {
await navigation.transition.finished;
// Navigation has completed successfully
// Cleanup any ongoing monitoring
}
```
## 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/)