Skip to content

BiDi docs: Update syntax blocks to include parameter examples#44402

Open
dipikabh wants to merge 1 commit into
mdn:mainfrom
dipikabh:fix-syntax-blocks
Open

BiDi docs: Update syntax blocks to include parameter examples#44402
dipikabh wants to merge 1 commit into
mdn:mainfrom
dipikabh:fix-syntax-blocks

Conversation

@dipikabh

@dipikabh dipikabh commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Description

This is a follow-up to the feedback received in #44279 (comment).

Syntax blocks now show minimal (required set) and full (optional parameters) forms where applicable and also values for parameters instead of variables.

The approach here is based on the syntax pattern used in browsingContext.getTree in PR 44279.

Additionally,

  • In browsingContext.getTree:

    • Fixed the example intro prose
    • Updated json -> json-nolint for code blocks that have inline comments
  • In session.unsubscribe:

    • Swapped the order of parameters in the syntax block - event name before subscription ID (this will match up with the changes coming to this file via PR 44378)

Motivation

The "Syntax" block will now show meaningful usage information and allow readers to quickly grasp what's possible before they reach for the details in the "Parameters" section.

@dipikabh dipikabh requested a review from chrisdavidmills June 10, 2026 02:31
@dipikabh dipikabh requested a review from a team as a code owner June 10, 2026 02:31
@github-actions github-actions Bot added the Content:WebDriver WebDriver docs label Jun 10, 2026
@dipikabh dipikabh removed the request for review from a team June 10, 2026 02:32
@github-actions github-actions Bot added the size/m [PR only] 51-500 LoC changed label Jun 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor
Preview URLs (13 pages)
Flaws (10)

Note! 10 documents with no flaws that don't need to be listed. 🎉

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

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

  • broken_links:
    • Link /en-US/docs/Web/HTML/Attributes/rel/noopener is a redirect

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

  • broken_links:
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/locateNodes doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/script/evaluate doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/script/callFunction doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/locateNodes doesn't resolve

URL: /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/input/setFiles
Title: input.setFiles command
Flaw count: 5

  • broken_links:
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/locateNodes doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/script/evaluate doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/script/callFunction doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/browsingContext/locateNodes doesn't resolve
    • Link /en-US/docs/Web/WebDriver/Reference/BiDi/Modules/script/evaluate doesn't resolve

@chrisdavidmills chrisdavidmills 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.

Nice work, @dipikabh. This is really useful and helpful. I had a few comments.


- [`acceptInsecureCerts`](/en-US/docs/Web/WebDriver/Reference/Capabilities/acceptInsecureCerts) {{optional_inline}}
- : A boolean that controls whether untrusted TLS certificates (for example, self-signed or expired) are accepted within this user context. When set, it overrides the [session-level](/en-US/docs/Web/WebDriver/Reference/BiDi/Modules/session/new#acceptinsecurecerts) `acceptInsecureCerts` setting for this user context.
- `proxy` {{optional_inline}}

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.

I'm not gonna block on this, but I am a little surprised that these object params don't have nested DLs explaining the properties that go inside each object, what they do, what values they can take, etc.

Is there a reason for this? Maybe something to think about for further enhancement later on.

"method": "browser.setDownloadBehavior",
"params": {
"downloadBehavior": {}
"downloadBehavior": {

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.

This seems a bit heavy-handed for a Syntax section, and it repeats much of what is shown in the Examples section. I would suggest:

  • Cutting it down to two examples, one showing mandatory params, and one showing all the optional params too
  • Adding the per-user context example to the Examples section.

## Syntax

```json-nolint
/* Window */

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.

Again, seems a bit heavy-handed for a Syntax section. Same approach as I suggested for setDownloadBehavior?

## Syntax

```json-nolint
/* Key action */

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.

Again, seems heavy-handed. Same approach as I suggested for setDownloadBehavior?

"platformName": "mac",
"unhandledPromptBehavior": {
"default": "accept"
}

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.

Feels like it should include some firstMatch examples too, although it might get a bit long. Does each object in the firstMatch array have to include all the same capabilities as the alwaysMatch object?

@@ -12,10 +12,37 @@ The `session.subscribe` [command](/en-US/docs/Web/WebDriver/Reference/BiDi/Modul
## Syntax

```json-nolint

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.

Again, feels heavy-handed. Same approach as suggested for setDownloadBehavior?

To unsubscribe using subscription ID:

```json-nolint
/* Using event name */

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.

Couple of thoughts:

  • I think in this case, since you have to supply one of two choices, deviating from the usual mandatory/optional pattern is fine.
  • Maybe swap the order of the two examples so they match the order in the Parameters section?

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

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants