Skip to content

[Technical review] BiDi - Add pages for navigation commands of browsingContext module#44377

Open
dipikabh wants to merge 1 commit into
mdn:mainfrom
dipikabh:bidi-browsingcontext-3
Open

[Technical review] BiDi - Add pages for navigation commands of browsingContext module#44377
dipikabh wants to merge 1 commit into
mdn:mainfrom
dipikabh:bidi-browsingcontext-3

Conversation

@dipikabh

@dipikabh dipikabh commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds pages for navigation commands:

  • browsingContext.navigate
  • browsingContext.reload
  • browsingContext.traverseHistory

Spec links

Related issue

Doc issue: mdn/mdn#339

@dipikabh dipikabh requested a review from a team June 8, 2026 01:09
@dipikabh dipikabh requested review from a team as code owners June 8, 2026 01:09
@dipikabh dipikabh requested review from hamishwillee and pepelsbey and removed request for a team June 8, 2026 01:09
@github-actions github-actions Bot added the Content:WebDriver WebDriver docs label Jun 8, 2026
@github-actions github-actions Bot added the size/m [PR only] 51-500 LoC changed label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (4 pages)

Flaws (24)

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/close
Title: browsingContext.close command
Flaw count: 4

  • broken_links:
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/contextDestroyed doesn't resolve

URL: /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigate
Title: browsingContext.navigate command
Flaw count: 7

  • broken_links:
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationAborted doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted doesn't resolve
    • and 2 more flaws omitted

URL: /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/reload
Title: browsingContext.reload command
Flaw count: 7

  • broken_links:
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationStarted doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationAborted doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted doesn't resolve
    • and 2 more flaws omitted

URL: /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/traverseHistory
Title: browsingContext.traverseHistory command
Flaw count: 6

  • broken_links:
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/getTree doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationAborted doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationCommitted doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/navigationFailed doesn't resolve
    • and 1 more flaws omitted


The `result` object in the response contains the following fields:

- `navigation`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CDDL in the spec for navigation in the "Return Type" is:

navigation: browsingContext.Navigation / null

But from the code it seems it is never null. Is the spec in need of an update?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are right. Feel free to file a new issue on the BiDi repository. Thanks.

The `result` object in the response contains the following fields:

- `navigation`
- : A string that contains the ID ([UUID](/en-US/docs/Glossary/UUID)) that uniquely identifies this navigation. A new UUID is generated for each `browsingContext.navigate` command.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the code, this is always a UUID. Is that correct?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct.


### Return value

The `result` field in the response is an empty object (`{}`). The command returns once the traversal has been queued, before the resulting navigation is complete.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct current behavior?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there is a TODO to wait for the traversal to be complete. Maybe for now lets add a reference to the browsingContext.historyUpdated event, which informs about when the history update is done.

- : A boolean that indicates whether the browser runs [`beforeunload`](/en-US/docs/Web/API/Window/beforeunload_event) event handlers before closing the context.
The default value is `false`.
- `false`: The specified context closes immediately without running `beforeunload` event handlers.
- `false`: The specified context closes immediately without running `beforeunload` event handlers. This is the default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor style update to make it similar to boolean value descriptions in browsingContext.reload

@whimboo whimboo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @dipikabh! Overall this looks pretty good. Just some minor comments inline (including the responses to your questions).

- `"interactive"`
- : The command returns when the document has been parsed and is ready for interaction.
Use this value when you need the DOM to be available but don't need images or other subresources to finish loading.
- `"none"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should mention that this is the default behavior if the parameter is not specified.


The `result` object in the response contains the following fields:

- `navigation`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are right. Feel free to file a new issue on the BiDi repository. Thanks.

The `result` object in the response contains the following fields:

- `navigation`
- : A string that contains the ID ([UUID](/en-US/docs/Glossary/UUID)) that uniquely identifies this navigation. A new UUID is generated for each `browsingContext.navigate` command.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that is correct.

- `"interactive"`
- : The command returns when the document has been parsed and is ready for interaction.
Use this value when you need the DOM to be available but don't need images or other subresources to finish loading.
- `"none"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as for navigate.


### Return value

The `result` field in the response is an empty object (`{}`). The command returns once the traversal has been queued, before the resulting navigation is complete.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but there is a TODO to wait for the traversal to be complete. Maybe for now lets add a reference to the browsingContext.historyUpdated event, which informs about when the history update is done.

@github-actions github-actions Bot added the merge conflicts 🚧 [PR only] label Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebDriver WebDriver docs merge conflicts 🚧 [PR only] size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants