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

Extend browsingContext.close params with promptUnload #518

Conversation

Lightning00Blade
Copy link
Contributor

@Lightning00Blade Lightning00Blade commented Aug 23, 2023

Closes #462

We already define this behavior on browser.close command. This PR extends this to the browsingContext.close as a parameter.
Default it chosen to not trigger prompting to unload with the idea that this is used more like resource cleanup rather then testing beforeUnload prompts and alike.


Preview | Diff

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.

LGTM (wait for other reviewers)

@Lightning00Blade Lightning00Blade marked this pull request as ready for review August 23, 2023 14:05
@OrKoN
Copy link
Contributor

OrKoN commented Sep 26, 2023

@juliandescottes @jgraham @whimboo would it be possible for you to review this one? it seems uncontroversial

Copy link
Contributor

@juliandescottes juliandescottes left a comment

Choose a reason for hiding this comment

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

That looks fine to me, thanks

index.bs Outdated Show resolved Hide resolved
@OrKoN
Copy link
Contributor

OrKoN commented Oct 11, 2023

@jgraham should we land this change or do you have concerns about exposing this?

Co-authored-by: Alex Rudenko <OrKoN@users.noreply.github.com>
@thiagowfx
Copy link
Member

Is there a bug or PR for the corresponding WPT test?

@jgraham
Copy link
Member

jgraham commented Oct 27, 2023

I think this is OK in principle.

I also think we should fix this to not work by "magic" but actually modify https://html.spec.whatwg.org/#steps-to-fire-beforeunload to skip the prompt in some cases. It seems like we could reuse the existing WebDriver BiDi user prompt opened steps by allowing them to return a value that specifies whether to show the prompt or not, and keeping a set of browsing contexts for which the unload prompt should be skipped.

That doesn't block landing this one, but we should at least file an issue.

@Lightning00Blade
Copy link
Contributor Author

Issue on HTML spec - whatwg/html#9890 , please add anything I may have missed.
Merging this per the last comment.

@Lightning00Blade Lightning00Blade merged commit 409761f into w3c:main Oct 31, 2023
4 checks passed
github-actions bot added a commit that referenced this pull request Oct 31, 2023
SHA: 409761f
Reason: push, by Lightning00Blade

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@whimboo
Copy link
Contributor

whimboo commented Nov 1, 2023

@Lightning00Blade Thanks for your work! Are you going to also create a test for that?

@Lightning00Blade
Copy link
Contributor Author

Yes I will add WPT test for it, I already updated Chromium-BiDi GoogleChromeLabs/chromium-bidi#1508 to support it, so it should be easier to create them now.

@whimboo
Copy link
Contributor

whimboo commented Jan 4, 2024

Yes I will add WPT test for it, I already updated Chromium-BiDi GoogleChromeLabs/chromium-bidi#1508 to support it, so it should be easier to create them now.

Hi @Lightning00Blade. Quick question if you still have it in your queue. Thanks.

@whimboo
Copy link
Contributor

whimboo commented Feb 1, 2024

FYI the tests will be added via web-platform-tests/wpt#44004.

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.

Add flag to browsingContext.close to skip beforeunload
6 participants