Navigation API aborted pushState progress sampler

#515480635 Accepted P3 / S3 CL 7868000

Live sampler

Reproducer

pushState aborts an intercepted Navigation API same-document navigation

Click the button below in a full browser tab. On affected Chromium builds the toolbar progress button can remain stuck on the stop/X state after the second history.pushState() aborts the first intercepted navigation.

Expected fixed behavior: after the abort is handled, the browser stops showing loading progress and this page remains at ?p=2.

Status: idle

Event log

Click "Run sampler" to start.

Test script

navigation.addEventListener("navigate", event => {
  event.intercept({
    precommitHandler() {
      return new Promise((resolve, reject) => {
        const timer = setTimeout(resolve, 1000);
        event.signal.addEventListener("abort", () => {
          clearTimeout(timer);
          reject(event.signal.reason);
        });
      });
    },
  });
}, { once: true });

history.pushState(null, null, "?p=1");
setTimeout(() => history.pushState(null, null, "?p=2"), 500);

Notes

How to verify