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

Update user prompt handler configuration #1819

Merged
merged 3 commits into from
Jul 2, 2024
Merged

Conversation

jgraham
Copy link
Member

@jgraham jgraham commented Jun 14, 2024

  • Make string valued handlers only set the alert/confirm/prompt modals, but object valued handlers with a default key set the default for all prompt types including beforeUnload
  • Unconditionally return the user prompt handler in the new session response

Preview | Diff

This would prevent creating a BiDi session for a browser that already has a HTTP session
with the notify flag set for some prompt handler.
Previously an object value for the unhandledPromptBehavior capability
like:

{
  "default": "dismiss"
}

was equivalent to the string value

"dismiss"

which for legacy reasons does not affect "beforeUnload" prompts.

For WebDriver-BiDi session we'd ideally like to remove this special
case and have the default value apply to all prompt types.

Therefore this changes things so that an object value with a default
key provides a default that applies to all prompt types, whereas the
traditional string values only apply to alert/confirm/prompt dialogs.

This preserves classic semantics for string-only values, but makes the
object values behave in a more uniform way.
When creating a session, ensure that we always return the used value
of this capability, whether or not it was passed in.
@jgraham jgraham requested review from whimboo and OrKoN June 28, 2024 16:23
Copy link
Contributor

@whimboo whimboo left a comment

Choose a reason for hiding this comment

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

This looks fine to me.

@jgraham jgraham merged commit af51973 into master Jul 2, 2024
3 checks passed
@jgraham jgraham deleted the user_prompt_changes branch July 2, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants