Closed Bug 2057588 Opened 2 months ago Closed 1 day ago

Provide machine-readable CDDL for Firefox WebDriver BiDi vendor extensions

Categories

(Remote Protocol :: WebDriver BiDi, enhancement, P3)

Default
enhancement

Tracking

(firefox159 fixed)

RESOLVED FIXED
159 Branch
Tracking Status
firefox159 --- fixed

People

(Reporter: titus.fortner, Assigned: hbenl)

References

(Blocks 2 open bugs)

Details

Attachments

(2 files)

Selenium is working on generating its WebDriver BiDi client code from the spec's CDDL (as WebdriverIO does) rather than hand-writing it. The spec prose says vendors may extend commands and parameters, but the CDDL defines closed maps, so vendor extensions aren't expressible in the schema a generator consumes.

Firefox's extensions on webExtension.install currently exist only as prose plus fenced CDDL blocks in remote/doc/webdriver-bidi/Extensions.md, with no machine-readable artifact to consume.

Would Mozilla be willing to maintain a machine-readable form of these extensions (e.g. an Extensions.cddl alongside the prose) so external clients can generate against them directly instead of scraping markdown or hard-coding the moz: params themselves?

I'll open a separate PR against https://github.com/w3c/webdriver-bidi/ proposing the spec declare sockets at those extension points, but Selenium can still make use of an official Firefox cddl file even if that PR isn't approved.

Suggested:

$$webExtension.InstallParameters.extension //= (
  ? "moz:allowPrivateBrowsing": bool .default false,
  ? "moz:permanent": bool .default false,
)
Flags: needinfo?(hskupin)

Bikeshed doesn't support CDDL sockets, so I guess it would be (depending on final form from my W3C PR when/if approved):

webExtension.InstallParametersExtension //= (
  ? "moz:allowPrivateBrowsing": bool .default false,
  ? "moz:permanent": bool .default false,
)

Hi Titus!
Henrik is on PTO, we discussed it with the team today, and we think that should be fine.
Could you create a patch for this change yourself? We would be happy to review it.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(hskupin)
Priority: -- → P3
Assignee: nobody → titus.fortner
Status: NEW → ASSIGNED
Attachment #9616835 - Attachment description: WIP: Bug 2057588 - Add machine-readable Extensions.cddl for WebDriver BiDi vendor extensions → Bug 2057588 - Add machine-readable Extensions.cddl for WebDriver BiDi vendor extensions

Spoke with Holger today and he is going to take a look at this bug.

Flags: needinfo?(hbenl)
Assignee: titus.fortner → nobody
Status: ASSIGNED → NEW
Assignee: nobody → titus.fortner
Status: NEW → ASSIGNED
Assignee: titus.fortner → hbenl

To cleanly add fields to CDDL types, we'd need to have explicit extension points (sockets or groups) for each type that we (or anyone else) may want to extend. That would mean adding hundreds of (initially empty) sockets or groups to the main spec, we don't want to do that, so I created a tool that adds these extension points as needed: To extend SomeType in main.cddl, you define a CDDL group SomeTypeExtension in extension.cddl and cddl-merge main.cddl extension.cddl will add SomeTypeExtension to SomeType.
I have verified this approach by generating Typescript types in this branch of the webdriver-bidi-protocol package and using them in our firefox-devtools-mcp package.
The attached patch is WIP: it's missing the description for our extension modules and the additional fields under the capabilities field in the session.NewResult type (the type for the capabilities field needs to be extracted and given its own name to become extensible with this mechanism).

Flags: needinfo?(hbenl)
Attachment #9644710 - Attachment description: WIP: Bug 2057588 - [webdriver-bidi] Provide CDDL for Firefox WebDriver BiDi vendor extensions → Bug 2057588 - [webdriver-bidi] Provide CDDL for Firefox WebDriver BiDi vendor extensions
Blocks: 2075251
Blocks: 2075253
Pushed by hbenl@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/511b0de4764c https://hg.mozilla.org/integration/autoland/rev/bcba727588cc [webdriver-bidi] Provide CDDL for Firefox WebDriver BiDi vendor extensions r=webdriver-reviewers,jdescottes
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: