MDN self-hosted library · e01.org

Navigation: navigatesuccess event

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
navigation.addEventListener("navigatesuccess", (event) => {
  loadingIndicator.hidden = true;
});
js
navigation.addEventListener("navigateerror", (event) => {
  loadingIndicator.hidden = true; // also hide indicator
  showMessage(`Failed to load page: ${event.message}`);
});