[w3c/permissions] WebDriver BiDi: `permissions.setPermission` does not define how `origin` and `embeddedOrigin` are parsed (Issue #487)

whimboo created an issue (w3c/permissions#487)

In the [`permissions.setPermission` command](https://w3c.github.io/permissions/#webdriver-bidi-command-permissions-setPermission), `origin` and `embeddedOrigin` are typed as `text`. The remote end steps pass them directly to "generating a permission key", which expects origins.

The spec does not say:

- how the strings become origins, or
- what happens when a string is not a valid origin, for example `""`, `"UNKNOWN"`, or a URL with a path such as `"https://example.com/foo"`.

Implementations differ:

- The wdspec test `test_set_permission_origin_unknown` (`webdriver/tests/bidi/external/permissions/set_permission/set_permission.py`) expects that `"UNKNOWN"` and `""` are accepted and have no effect.
- Firefox returns `invalid argument` for values that do not parse as a URL.

Proposal: define how the strings are parsed, for example by running the URL parser and taking the origin of the result. Also define the result for a failed parse. Returning `invalid argument` would match how other BiDi commands handle malformed URLs, for example `browsingContext.navigate`. If the spec chooses that, the wdspec test needs an update.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/permissions/issues/487
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/permissions/issues/487@github.com>

Received on Wednesday, 28 October 2026 17:07:08 UTC