The navigate event intercept commit handler steps, given a Navigation navigation, a NavigateEvent object event, and a navigation API method tracker apiMethodTracker are as follows:

  1. Let promisesList be an empty list.

  2. For each handler of event's navigation handler list:

    1. Append the result of invoking handler with an empty arguments list to promisesList.

  3. If promisesList's size is 0, then set promisesList to « a promise resolved with undefined ».

    There is a subtle timing difference between how waiting for all schedules its success and failure steps when given zero promises versus ≥1 promises. For most uses of waiting for all, this does not matter. However, with this API, there are so many events and promise handlers which could fire around the same time that the difference is pretty easily observable: it can cause the event/promise handler sequence to vary. (Some of the events and promises involved include: navigatesuccess / navigateerror, currententrychange, dispose, apiMethodTracker's promises, and the navigation.transition.finished promise.)

  4. Wait for all of promisesList, with the following success steps:

    1. If event's relevant global object is not fully active, then abort these steps.

    2. If event's abort controller's signal is aborted, then abort these steps.

    3. Assert: event equals navigation's ongoing navigate event.

    4. Set navigation's ongoing navigate event to null.

    5. Finish event given true.

    6. If apiMethodTracker is non-null, then resolve the finished promise for apiMethodTracker.

    7. Fire an event named navigatesuccess at navigation.

    8. If navigation's transition is not null, then resolve navigation's transition's finished promise with undefined.

    9. Set navigation's transition to null.

    and the following failure step given reason: process navigate event handler failure given event and reason.