Provide machine-readable CDDL for Firefox WebDriver BiDi vendor extensions
Categories
(Remote Protocol :: WebDriver BiDi, enhancement, P3)
Tracking
(firefox159 fixed)
| 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,
)
| Reporter | ||
Comment 1•2 months ago
|
||
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,
)
Comment 2•2 months ago
|
||
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.
| Reporter | ||
Comment 3•2 months ago
|
||
Updated•2 months ago
|
Updated•2 months ago
|
Comment 4•23 days ago
|
||
Spoke with Holger today and he is going to take a look at this bug.
Updated•23 days ago
|
Updated•18 days ago
|
Updated•18 days ago
|
| Assignee | ||
Comment 5•8 days ago
|
||
| Assignee | ||
Comment 6•8 days ago
|
||
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).
Updated•2 days ago
|
Comment 8•1 day ago
|
||
| bugherder | ||
Description
•