-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Draft
jgraham
wants to merge
1
commit into
whatwg:main
Choose a base branch
from
jgraham:prompt_handler
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89581,7 +89581,7 @@ location.href = '#foo';</code></pre> | |
<hr> | ||
|
||
<p>A <dfn>navigation ID</dfn> is a UUID string generated during navigation. It is used to | ||
interface with the <cite>WebDriver BiDi</cite> specification as well as to track the <span>ongoing | ||
interface with the <cite>river BiDi</cite> specification as well as to track the <span>ongoing | ||
navigation</span>. <ref spec=WEBDRIVERBIDI></p> | ||
|
||
<hr> | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? |
||
<span>WebDriver BiDi user prompt opened</span> with <var>document</var>'s | ||
<span>relevant global object</span>, "<code data-x="">beforeunload</code>", and "".</p></li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <var>document</var>'s | ||
<span>relevant global object</span>, "<code data-x="">beforeunload</code>", and "".</p></li> | ||
<li><p>If <var>userPromptHandler</var> is "<code data-x="">none</code>":</p> | ||
<ol> | ||
<li> | ||
<p>Ask the user to confirm that they wish to unload the document, and <span>pause</span> | ||
while waiting for the user's response.</p> | ||
|
||
<li> | ||
<p>Ask the user to confirm that they wish to unload the document, and <span>pause</span> | ||
while waiting for the user's response.</p> | ||
<p class="note">The message shown to the user is not customizable, but instead determined | ||
by the user agent. In particular, the actual value of the <code | ||
data-x="dom-BeforeUnloadEvent-returnValue">returnValue</code> attribute is ignored.</p> | ||
</li> | ||
|
||
<p class="note">The message shown to the user is not customizable, but instead determined | ||
by the user agent. In particular, the actual value of the <code | ||
data-x="dom-BeforeUnloadEvent-returnValue">returnValue</code> attribute is ignored.</p> | ||
<li><p>If the user did not confirm the page navigation, set <var>unloadPromptCanceled</var> | ||
to true.</p></li> | ||
</li> | ||
|
||
<li><p>If the user did not confirm the page navigation, set <var>unloadPromptCanceled</var> | ||
to true.</p></li> | ||
<li><p>If <var>userPromptHandler</var> is "<code data-x="">accept</code>", set | ||
<var>unloadPromptCanceled</var> to false.</p></li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <var>document</var>'s | ||
<span>relevant global object</span> and true if <var>unloadPromptCanceled</var> is false or | ||
|
@@ -102492,13 +102498,17 @@ function sendData(data) { | |
<li><p>Set <var>message</var> to the result of <span data-x="optionally truncate a simple dialog | ||
string">optionally truncating</span> <var>message</var>.</p></li> | ||
|
||
<li><p>Show <var>message</var> to the user, treating U+000A LF as a line break.</p></li> | ||
<li><p>Let <var>userPromptHandler</var> be <span>WebDriver BiDi user prompt opened</span> with | ||
<span>this</span>, "<code data-x="">alert</code>", and <var>message</var>.</p></li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <span>this</span>, | ||
"<code data-x="">alert</code>", and <var>message</var>.</p></li> | ||
<li><p>If <var>userPromptHandler</var> is "<code data-x="">none</code>":</p> | ||
<ol> | ||
<li><p>Show <var>message</var> to the user, treating U+000A LF as a line break.</p></li> | ||
|
||
<li><p>Optionally, <span>pause</span> while waiting for the user to acknowledge the | ||
message.</p></li> | ||
<li><p>Optionally, <span>pause</span> while waiting for the user to acknowledge the | ||
message.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <span>this</span> | ||
and true.</p></li> | ||
|
@@ -102526,16 +102536,27 @@ function sendData(data) { | |
<li><p>Show <var>message</var> to the user, treating U+000A LF as a line break, and ask the user | ||
to respond with a positive or negative response.</p></li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <span>this</span>, | ||
"<code data-x="">confirm</code>", and <var>message</var>.</p></li> | ||
<li><p>Let <var>userPromptHandler</var> be <span>WebDriver BiDi user prompt opened</span> with | ||
<span>this</span>, "<code data-x="">confirm</code>", and <var>message</var>.</p></li> | ||
|
||
<li><p>Let <var>accepted</var> be false.</p></li> | ||
|
||
<li><p>If <var>userPromptHandler</var> is "<code data-x="">none</code>":</p> | ||
|
||
<li><p><span>Pause</span> until the user responds either positively or negatively.</p></li> | ||
<ol> | ||
<li><p><span>Pause</span> until the user responds either positively or negatively.</p></li> | ||
|
||
<li><p>If the user responded positively set <var>accepted</var> to true</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p>If <var>userPromptHandler</var> is "<code data-x="">accept</code>" set <var>accepted</var> to | ||
true.</p></li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <span>this</span>, | ||
and true if the user responded positively or false otherwise.</p></li> | ||
and <var>accepted</var>.</p></li> | ||
|
||
<li><p>If the user responded positively, return true; otherwise, the user responded negatively: | ||
return false.</p></li> | ||
<li><p>Return <var>accepted</var>.</p></li> | ||
</ol> | ||
|
||
<p>The <dfn method for="Window"><code data-x="dom-prompt">prompt(<var>message</var>, | ||
|
@@ -102558,18 +102579,28 @@ function sendData(data) { | |
to either respond with a string value or abort. The response must be defaulted to the value given | ||
by <var>default</var>.</p></li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt opened</span> with <span>this</span>, | ||
"<code data-x="">prompt</code>" and <var>message</var>.</p></li> | ||
<li><p>Let <var>userPromptHandler</var> be <span>WebDriver BiDi user prompt opened</span> with | ||
<span>this</span>, "<code data-x="">prompt</code>" and <var>message</var>.</p></li> | ||
|
||
<li><p>Let <var>result</var> be null.</p></li> | ||
|
||
<li><p>If <var>userPromptHandler</var> is "<code data-x="">none</code>":</p> | ||
|
||
<ol> | ||
<li><p><span>Pause</span> while waiting for the user's response.</p></li> | ||
|
||
<li><p><span>Pause</span> while waiting for the user's response.</p></li> | ||
<li><p>If the user did not abort, set <var>result</var> to the string that the user | ||
responded with.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p>Let <var>result</var> be null if the user aborts, or otherwise the string that the user | ||
responded with.</p></li> | ||
<li><p>Otherwise if <var>userPromptHandler</var> is "<code data-x="">accept</code>", set <var>result</var> | ||
to the emtpy string.</p></li> | ||
|
||
<li><p>Invoke <span>WebDriver BiDi user prompt closed</span> with <span>this</span>, | ||
false if <var>result</var> is null or true otherwise, and <var>result</var>.</p></li> | ||
|
||
<li><p>Return <var>result</var>.</li> | ||
<li><p>Return <var>result</var>.</p></li> | ||
</ol> | ||
|
||
<p>To <dfn>optionally truncate a simple dialog string</dfn> <var>s</var>, return either | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.