NavigationHistoryEntry: dispose event

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The dispose event of the NavigationHistoryEntry interface is fired when the entry is no longer part of the history entry list.

Disposal occurs when:

  • Forward history entries are cleared. See the example at Notifications on entry disposal for more information.
  • The user clears their browser history using settings or provided UI controls.
  • The history limit is exceeded. This is not specified anywhere, but browsers tend to have a history limit of 50 pages.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

js
addEventListener("dispose", (event) => {});

ondispose = (event) => {};

Event type

A generic Event.

Examples

js
navigation.addEventListener("currententrychange", () => {
  navigation.currentEntry.addEventListener("dispose", disposeHandler);
});

Specifications

Specification
HTML
# handler-navigationhistoryentry-ondispose

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
dispose event
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

See also