w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
378 stars 42 forks source link

Request for a `navigationCommited` event to inform immediately about the navigation status #788

Open whimboo opened 2 months ago

whimboo commented 2 months ago

This is a request from the Playwright folks:

Introduce an event or method to track when a navigation is committed, beyond the current DOMContentLoaded and load events, which would be useful for some client requirements (e.g., 'should return when navigation is committed if commit is specified'). We need to know immediately if the navigation has failed or succeeded.

In Puppeteer this event is named page.frameNavigated.

It's not clear right now where in the HTML spec it could hook into to accurately inform about the status of the current navigation.

css-meeting-bot commented 2 months ago

The Browser Testing and Tools Working Group just discussed Request for a navigationCommited event to inform immediately about the navigation status.

The full IRC log of that discussion <simonstewart> Topic: Request for a navigationCommited event to inform immediately about the navigation status
<simonstewart> github: https://github.com/w3c/webdriver-bidi/issues/788
<simonstewart> Action: someone in chrome to find out what a `navigationCommited` actually is, and what it corresponds to in a spec
OrKoN commented 1 month ago

Action: someone in chrome to find out what a navigationCommited actually is, and what it corresponds to in a spec

It happens here https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/loader/document_loader.cc;l=2152;drc=c5f3a25855b895bb587af5dbd8ff3ebfb7be76e1 and I believe it roughly corresponds to this step in the HTML spec https://html.spec.whatwg.org/multipage/browsing-the-web.html#populating-a-session-history-entry:loading-a-document