Back to Content

NavigationTransition: finished property

files/en-us/web/api/navigationtransition/finished/index.md

latest917 B
Original Source

{{APIRef("Navigation API")}}

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