-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Support automatic user prompt handing in WebDriver BiDi #10189
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR does not handle dismiss yet?
06090d4
to
bb7b60e
Compare
Well it does, on the assumption that none/accept/dismiss are the only available options. In that case "dismiss" is what happens when the return value is neither "none" nor "accept". I think for |
This reads the return value from the WebDriver BiDi user prompt opened algorithm and uses it to decide whether to show the prompt, or skip showing it but act as if it had been accepted or canceled. At present the prompt opened function can return three values: "none", which causes the prompt to be displayed, "accept", which acts as if the prompt was accepted, and "dismiss" which acts as if the prompt was rejected. The WebDriver side is responsible for ensuring that only valid responses are sent for each prompt type (e.g. for an alert there isn't a "dismiss" option).
@jgraham is that PR ready for a general review now? |
Yes, as far as I'm concerned this can be reviewed. |
@domenic would you have a chance to review this PR? Thanks! |
I pushed some editorial nits. My main question is whether it makes sense to always show the prompt in the way you have specified, or if you should avoid showing the prompt if userPromptHandler is "none". The latter makes more sense to me, but isn't the approach you've taken here; instead, you always show the prompts, but only pause for user input in some cases. |
A user prompt handler of "none" means "no handler", not "no prompt". So in that case we still need to show the prompt so that a user can interact with it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, right, I have no idea how I lost that context someone between the start of the review (where it was clear) and the end. Thanks for your patient explanation!
This reads the return value from the WebDriver BiDi user prompt opened algorithm and uses it to decide whether to show the prompt, or skip showing it but act as if it had been accepted or canceled.
At present the prompt opened function can return three values: "none", which causes the prompt to be displayed, "accept", which acts as if the prompt was accepted, and "dismiss" which acts as if the prompt was rejected. The WebDriver side is responsible for ensuring that only valid responses are sent for each prompt type (e.g. for an alert there isn't a "dismiss" option).
(See WHATWG Working Mode: Changes for more details.)
/browsing-the-web.html ( diff )
/timers-and-user-prompts.html ( diff )