Skip to content

[Tech review] BiDi - Add pages for navigation and page load events of browsingContext module#44571

Open
dipikabh wants to merge 5 commits into
mdn:mainfrom
dipikabh:bidi-browsingcontext-nav-events
Open

[Tech review] BiDi - Add pages for navigation and page load events of browsingContext module#44571
dipikabh wants to merge 5 commits into
mdn:mainfrom
dipikabh:bidi-browsingcontext-nav-events

Conversation

@dipikabh

Copy link
Copy Markdown
Contributor

Description

This PR adds pages for the following navigation and page load events:

  • browsingContext.navigationStarted
  • browsingContext.navigationCommitted
  • browsingContext.domContentLoaded
  • browsingContext.load
  • browsingContext.navigationFailed
  • browsingContext.fragmentNavigated
  • browsingContext.historyUpdated

Note

browsingContext.navigationAborted is not documented yet. The BCD key is also missing for this event. I'll cover it when there is an implementation.

Spec links

Related issue

Doc issue: mdn/mdn#339

@dipikabh dipikabh requested review from a team as code owners June 25, 2026 00:32
@dipikabh dipikabh requested review from hamishwillee and pepelsbey and removed request for a team June 25, 2026 00:32
@github-actions github-actions Bot added Content:WebDriver WebDriver docs size/l [PR only] 501-1000 LoC changed labels Jun 25, 2026
@dipikabh dipikabh requested review from a team and removed request for hamishwillee and pepelsbey June 25, 2026 00:33
Comment on lines +33 to +34
- `userContext` {{optional_inline}}
- : A string that contains the ID of the [user context](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browser#user_contexts) in which the HTML document is being parsed.

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.

I was thinking to leave this field out, but I noticed in the implementation tracker that Firefox support is coming in 154. So I've included it, though examples of all events in this PR are currently missing this field.

I would have asked for clarification on when this field is included vs. omitted in the payload - but from the comment in the spreadsheet, it seems that this field will eventually become required.

But let me know, if in the meantime, any more details need to be added here

Comment on lines +44 to +55
```json
{
"type": "event",
"method": "browsingContext.navigationFailed",
"params": {
"context": "5e5e96e8-5247-4f22-9b35-a4a2d841cbaa",
"navigation": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"timestamp": 1712345678901,
"url": "https://not-a-valid-domain.example"
}
}
```

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.

I wasn't able to reproduce this. I used https://not-a-valid-domain.example as the URL but this returned:

"error": "unknown error",
"message": "Error: NS_ERROR_UNKNOWN_HOST",

as a browsingContext.navigate command error rather than firing the browsingContext.navigationFailed event. The stacktrace showed #onNavigationCommitted being called.

Is the example documented here good enough? Any other variables I can tweak to trigger the event?

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

Labels

Content:WebDriver WebDriver docs size/l [PR only] 501-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants