Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriver: Make it possible to pass a different origin to "Set Permission" #419

Open
rakuco opened this issue Sep 12, 2023 · 6 comments
Open

Comments

@rakuco
Copy link
Member

rakuco commented Sep 12, 2023

https://w3c.github.io/permissions/#set-permission-command changes permissions for "all environment settings objects whose origin is the same as the origin of [the current settings object]".

This is somewhat problematic from a testdriver perspective when cross-origin tests are involved: there are limitations that end up making all WebDriver communication go through the context that includes testharness.js, so if a given test includes a cross-origin iframe that needs to invoke "Set Permission" the call will go through the main frame and not have the desired effect.

Even though this is a testdriver limitation, I guess fixing it is not trivial, so I was wondering if the editors would be open to changing the spec itself to make it possible to (optionally) pass different origins.

@miketaylr
Copy link
Member

I guess we could do that w/ an optional POST body like {"origin": "example.com"}. I don't have any sense of how feasible this would be to implement in the various webdriver implementations though.

@rakuco
Copy link
Member Author

rakuco commented Sep 12, 2023

I'm only familiar with the ChromeDriver code. At least there I don't think it'd be a big issue, as the code that fetches the current origin and passes it along is fairly simple. Gecko seems to have very limited support for this endpoint, but I dunno about WebKit.

@miketaylr
Copy link
Member

Maybe @jgraham or @whimboo could comment on the feasibility for Marionette/Geckodriver.

@miketaylr
Copy link
Member

I had a chat with @jgraham in person at TPAC, and while he hasn't studied this issue in depth, he speculated that it shouldn't be too difficult for marionette/geckodriver if/when they implement the commands.

@OrKoN
Copy link
Contributor

OrKoN commented Jan 15, 2024

Origin will be (hopefully) available in WebDriver BiDi command #436

@miketaylr
Copy link
Member

WebDriver BiDi command #436

Note: this has landed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants