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

Automatically accept any "beforeunload" prompt upon navigation or close window. #1782

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

whimboo
Copy link
Contributor

@whimboo whimboo commented Jan 12, 2024

Right now the spec says that we should automatically dismiss any beforeunload prompt upon navigation or window close:

User prompts that are spawned from beforeunload event handlers, are dismissed implicitly upon navigation or close window, regardless of the defined user prompt handler.

But the problem is the definition of dismissed:

To dismiss the current user prompt, do so as if the user would click the Cancel or OK button, whichever is present, in that order.

Given that such prompts have both an OK and Cancel button, we would have to click on Cancel. But that will cause the page to never get unloaded for a navigation, and the wait for navigation to complete steps to hang until the page timeout because.

I'll check for proper tests when implementing this type of prompt for Marionette in Firefox on https://bugzilla.mozilla.org/show_bug.cgi?id=1693857.


Preview | Diff

@whimboo
Copy link
Contributor Author

whimboo commented Jan 15, 2024

CC @gsnedders

@whimboo whimboo merged commit d08a954 into w3c:master Jan 15, 2024
2 checks passed
@whimboo whimboo deleted the beforeunload branch January 15, 2024 15:37
github-actions bot added a commit that referenced this pull request Jan 15, 2024
… window. (#1782)

SHA: d08a954
Reason: push, by whimboo

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit to soloinovator/webdriver that referenced this pull request Jan 16, 2024
… window. (w3c#1782)

SHA: d08a954
Reason: push, by pull[bot]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit to xjc90s/webdriver that referenced this pull request Jan 16, 2024
… window. (w3c#1782)

SHA: d08a954
Reason: push, by pull[bot]

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
github-actions bot added a commit to whimboo/webdriver that referenced this pull request Jan 23, 2024
… window. (w3c#1782)

SHA: d08a954
Reason: push, by whimboo

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants