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

Support automatic user prompt handing in WebDriver BiDi #10189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jgraham
Copy link
Member

@jgraham jgraham commented Mar 8, 2024

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 )

source Outdated Show resolved Hide resolved
source Outdated
@@ -90720,22 +90720,28 @@ location.href = '#foo';</code></pre>
<p>then:</p>

<ol>
<li><p>Set <var>unloadPromptShown</var> to true.</p></li>
<li>
<p>Let <var>userPromptHandler</var> be the result of
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The formatting of this whole section is a bit off. Maybe you can fix that?

Copy link
Contributor

@OrKoN OrKoN left a 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?

@jgraham jgraham force-pushed the prompt_handler branch 2 times, most recently from 06090d4 to bb7b60e Compare June 12, 2024 09:38
@jgraham
Copy link
Member Author

jgraham commented Jun 18, 2024

This PR does not handle dismiss yet?

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 beforeUnload it needs some changes to make the behavior well-defined (we set a variable inside a conditional and later assume it has a value)

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).
@whimboo
Copy link

whimboo commented Jul 4, 2024

@OrKoN is there anything else you would like to add? Otherwise we could find someone to review this PR @jgraham?

@whimboo
Copy link

whimboo commented Aug 8, 2024

@jgraham is that PR ready for a general review now?

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

Successfully merging this pull request may close these issues.

3 participants