For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface NavigationPrecommitController

The NavigationPrecommitController interface of the Navigation API is passed as an argument to a navigation precommit handler callback.

MDN Reference

interface NavigationPrecommitController {
    addHandler(handler: NavigationInterceptHandler): void;
    redirect(url: string | URL, options?: NavigationNavigateOptions): void;
}
Index
  • The addHandler() method of the NavigationPrecommitController interface allows you to dynamically add a handler callback function in precommit code, which will then be run after the navigation has committed.

    MDN Reference

    Parameters

    Returns void

  • The redirect() method of the NavigationPrecommitController interface redirects the browser to a specified URL and specifies history behavior and any desired state information.

    MDN Reference

    Parameters

    Returns void

Was this helpful?