Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status of navigation in WebDriver BiDi #662

Open
2 tasks
jrandolf opened this issue Feb 15, 2024 · 0 comments
Open
2 tasks

Status of navigation in WebDriver BiDi #662

jrandolf opened this issue Feb 15, 2024 · 0 comments
Assignees

Comments

@jrandolf
Copy link
Contributor

jrandolf commented Feb 15, 2024

Verbatim spec

  1. browsingContext.fragmentNavigated is emitted only for fragment navigation.
    a. This does not include history navigation.
    b. History navigation that triggers fragment navigation is also not included.
  2. browsingContext.navigationStarted is emitted for non-history navigation that is not a fragment navigation or reload.
  3. browsingContext.navigationFailed occurs almost only during non-history navigation that is not a fragment navigation or reload when either
    a. unload is happening,
    b. beforeunload cancels the navigation, or
    c. the navigation is not committed into history and another navigation starts (i.e. the latest navigation always takes precedent unless the current navigation is already committed into history.)
  4. browsingContext.navigationFailed occurs for all navigation only when 6.4.4.2 of https://html.spec.whatwg.org/#attempt-to-populate-the-history-entry's-document is hit which has several specific conditions.
  5. browsingContext.navigationAborted occurs only when navigation is aborted if window.stop is called during navigation or a fresh document has started loading but another navigation stops it. (Imagine navigating from about:blank to example.com to google.com fast enough that example.com doesn’t get parsed; navigation aborted will occur for the edge from about:blank to example.com)
    a. Note: browsingContext.navigationStarted for example.com to google.com will happen before the navigation aborted for about:blank to example.com.

Current implementations

Chromium

  1. browsingContext.fragmentNavigation is emitted when any same-document navigation occurs.
  2. browsingContext.navigationStarted is emitted whenever the frame starts any loading process.
  3. browsingContext.navigationFailed and browsingContext.navigationAborted are not emitted.

Use cases

Puppeteer

Puppeteer defines navigation as "what users expect". This includes, but not limited to, navigation due to interacting with the browser, history navigation and, perhaps a little less navigation-like, history.replaceState and history.pushState.

  1. I want to navigate to a page.
    1. Corresponds to page.goto.
    2. page.goto should end when the expected navigation has completed or an error.
  2. I want to detect navigation.
    1. Corresponds to page.waitForNavigation.
    2. page.waitForNavigation should be able to detect when a navigation occurs.
    3. page.waitForNavigation should wait for first navigation to complete or fail.

Issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants