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

Does the exit fullscreen actually consume user activation? #36481

Closed
marcoscaceres opened this issue Oct 16, 2022 · 5 comments
Closed

Does the exit fullscreen actually consume user activation? #36481

marcoscaceres opened this issue Oct 16, 2022 · 5 comments

Comments

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Oct 16, 2022

@mustaqahmed, in the user activation tests, there is the following util function that varies tests rely on:

async function consumeTransientActivation() {
try {
await document.body.requestFullscreen();
await document.exitFullscreen();
return true;
} catch(e) {
return false;
}
}

However, in the fullscreen spec, I don't see where it says "consume user activation"?

My understanding is that fullscreen doesn't consume user activation, it just requires it.

cc @annevk

@marcoscaceres
Copy link
Contributor Author

I'm thinking we might need to add something to Web Driver to consume user activation. Otherwise, we are going to be relying on APIs like Payment Request to consume it, which is not great.

@annevk
Copy link
Member

annevk commented Oct 17, 2022

There's discussion about this in whatwg/fullscreen#152 that's unresolved. It does seem like Chrome has this, but there are special cases for Pointer Lock and perhaps other APIs?

@mustaqahmed
Copy link
Member

Adding a WebDriver API for consumption is a great suggestion, thanks! Otherwise, testing consumption is a big challenge. All browsers consume user activation at window.open() but popup blocker assumptions interfere. The only remaining option we have is requestFullscreen() but we don't have interop there!

@marcoscaceres
Copy link
Contributor Author

marcoscaceres commented Oct 19, 2022

Adding a WebDriver API for consumption is a great suggestion, thanks!

Yeah, let's work on standardizing that. I filed:
w3c/webdriver#1691

Otherwise, testing consumption is a big challenge. All browsers consume user activation at window.open() but popup blocker assumptions interfere.

Yeah, that will also break when testing on mobile too. That's probably not going to work.

The only remaining option we have is requestFullscreen() but we don't have interop there!

Alternative is to use Payment Request, which is standardized and interoperable (so long at the various payment methods are supported across UAs, would need to check 🤞).

It might look like:

const pr =new PaymentRequest(methods, details, options);
await test_driver.bless("Payment Request");
pr.show(); // consumes transient activation...
await pr.abort(); // hides the payment sheet. 

@marcoscaceres
Copy link
Contributor Author

Closing based on progress we made on whatwg/fullscreen#152

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