-
Notifications
You must be signed in to change notification settings - Fork 197
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
User prompt handler capabilities #1791
Conversation
2339bb9
to
678b6ab
Compare
678b6ab
to
ab13ac3
Compare
ab13ac3
to
8c63611
Compare
225c89e
to
c5ecc04
Compare
5cb81e1
to
c3901cd
Compare
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.
<dl class=switch> | ||
<dt><a>dismiss state</a> | ||
<dd><p><a>Dismiss</a> the <a>current user prompt</a>. | ||
<li><p>If <var>type</var> is "<code>beforeUnload</code>", return a |
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.
I assume that we can move this up given that it doesn't depend on any user prompt handler setting.
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.
I don't follow? If type
is beforeUnload
and you have beforeUnload
in handlers
the previous step applies. That's important for BiDi where we don't totally override the beforeUnload handler, but still default to dismissing it if you didn't add it in capabilities.
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 good point. Would it make sense to add a note here which explains why it needs to stay here?
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.
I added this to the note above.
c3901cd
to
0bce1f7
Compare
The idea is that for BiDi we'll accept objects like: { "alert": "dismiss", "beforeUnload": "ignore" } to allow different handling per prompt type, whilst falling back to the appropiate defaults to maintain the current behaviour for implementations that don't support BiDi.
Co-authored-by: Henrik Skupin <mail@hskupin.info>
d6b81f5
to
c5dfabc
Compare
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.
Thanks @jgraham! That looks fine to me now.
@sadym-chromium and maybe @gsnedders could you review as well please?
The Browser Testing and Tools Working Group just discussed The full IRC log of that discussion<AutomatedTester> topic: User prompt handlers<AutomatedTester> github: https://github.com//pull/1791 <jgraham> I note that is a position on whether Invalid Argument is only for things that can be detected from the schema; if we reject files for not existing then it isn't. So if we want that property we should invent a new error. <AutomatedTester> jgraham (IRC): after working through handlers for user prompts in classic which shoulnd't change how we do things <AutomatedTester> ... and now have something up for bidi <AutomatedTester> ... in bidi we want to be notified before unload where in classic it was automatically handled <AutomatedTester> ... whimboo has looked at this and since it's a new feature it would be good if other vendors can have a look <AutomatedTester> ... one of the future items is that we can have the file dialog is handled this way <AutomatedTester> ... as well as the classic PR there are also draft PRs on HTML and WebDriver Bidi <AutomatedTester_> q? |
Could you please add a short summary about the implications of the change? it's not expected to affect the current WebDriver Classic behavior, right? |
The specifications allow one prompt per event loop, so instead of assuming a single current user prompt, allow getting the user prompt for the active browsing context's event loop.
This is specifically worded to not change classic behaviour at all, at least in a mandatory way. The new feature in the PR is the ability to define per-prompt-type behaviour e.g.
That's not terribly useful just for classic as is, but it's more useful for BiDi to be able to do things like:
Which would mean that you get an event and have to explicitly handle |
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.
LGTM
SHA: 43903d0 Reason: push, by jgraham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 43903d0 Reason: push, by pull[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 43903d0 Reason: push, by pull[bot] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
It was actually not intended to add a new capability with the name
With a future use of:
I created PR #1808 to get this fixed. |
Preview | Diff