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

Selecting OK on confirm() is not considered a user gesture for permissions #736

Open
tconfrey opened this issue Dec 5, 2024 · 6 comments
Labels
needs-triage: chrome Chrome needs to assess this issue for the first time needs-triage: firefox Firefox needs to assess this issue for the first time needs-triage: safari Safari needs to assess this issue for the first time

Comments

@tconfrey
Copy link

tconfrey commented Dec 5, 2024

if (confirm('BrainTool is not currently open. Click OK to open it now.')) { chrome.sidePanel.open({}); }
throws:
"Error: sidePanel.open() may only be called in response to a user gesture."

I'm guessing there might be an issue with the system dialogs running in a different context, but confirm() seems like one of the simplest and most obviously user-intended gestures.

@github-actions github-actions bot added needs-triage: chrome Chrome needs to assess this issue for the first time needs-triage: firefox Firefox needs to assess this issue for the first time needs-triage: safari Safari needs to assess this issue for the first time labels Dec 5, 2024
@dotproto
Copy link
Member

dotproto commented Dec 6, 2024

Does this issue present in other browsers?

@tconfrey
Copy link
Author

tconfrey commented Dec 6, 2024 via email

@patrickkettner
Copy link
Contributor

I believe Simeon is asking if it is present in other browser engines. Since those are all on chromium, it would be expected for them to be behaving the same more or less.
If the behavior is consistent between browsers, then it would likely need to come from an upstream spec change. Extensions largely inherit what counts as user activation from the engine. So it would probably need to go up to the UAPM section of WHATWG for a decision on wether or not this is expected behavior.

@tconfrey
Copy link
Author

tconfrey commented Dec 6, 2024 via email

@patrickkettner
Copy link
Contributor

@dotproto would you be able to check if it works in firefox? I know browser.identity.launchWebAuthFlow requires user interaction to launch, fwiw

@tophf
Copy link

tophf commented Dec 7, 2024

The same behavior in the web platform as can be seen by copypasting this URL in the address bar data:text/html,<body><script>confirm()&&document.body.requestFullscreen().then(()=>'OK',e=>''+e).then(m=>document.body.innerText=m)</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage: chrome Chrome needs to assess this issue for the first time needs-triage: firefox Firefox needs to assess this issue for the first time needs-triage: safari Safari needs to assess this issue for the first time
Projects
None yet
Development

No branches or pull requests

5 participants
@patrickkettner @dotproto @tophf @tconfrey and others