Re: [w3c/permissions] Add an optional `topLevelOrigin` parameter to the `permissions.setPermission` command (PR #468)

miketaylr left a comment (w3c/permissions#468)

Thanks - I'm still trying to wrap my head around how WebDriver-bidi implements all of this, there's quite a bit of indirection. 

https://github.com/GoogleChromeLabs/chromium-bidi/blob/0a6af6579fd89754d8e7e397dfb44d905e40e1df/src/bidiMapper/modules/permissions/PermissionsProcessor.ts#L25

etc

> My understanding is that WebDriver doesn’t have an ESO at all. By modifying the permission key generation algorithm to take an origin and a top-level origin directly, it's now possible for WebDriver to call the algorithm and set permissions without needing an ESO..

How do steps 4 or 6 work in your changes with WebDriver(-bidi) if ESOs don't exist?

<img width="1666" height="1306" alt="Screenshot 2025-09-01 at 3 26 47 PM" src="https://github.com/user-attachments/assets/4a984168-3551-4e1f-ba12-95472f562476" />

>> Dumb question: why not just add an additional optional top-level origin argument into "set a permission" and plumb that in?

> This is definitely a possibility, but the optional origin before functionally was the key. So rather than pass both origins, I think it makes sense to consolidate under a single permission key input, and have the callers generate that key themselves.

One upside is that you don't have to touch any of the algorithms outside of the Automated testing section, I think.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/permissions/pull/468#issuecomment-3242468266
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/permissions/pull/468/c3242468266@github.com>

Received on Monday, 1 September 2025 13:53:31 UTC