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

Disallow window.open() during unload #3960

Merged
merged 1 commit into from Oct 31, 2018

Conversation

6 participants
@TimothyGu
Copy link
Member

TimothyGu commented Aug 24, 2018

Chrome would like to limit the usage of window.open(), and we believe that there is rarely a valid purpose for that function when a page is exiting. We propose here a model for limiting window.open() similar to mechanisms already in place for modal dialogs like alert(), confirm(), and prompt() with event loop's termination nesting level, which additionally prevents the unloaded page to use a window.open() in another synchronously accessible windows.

However, one difference between the proposed algorithm and the modal dialog functions is that the early return is mandatory unlike the returns in those functions. We have a strong preference to do that, as it allows testing through WPTs for browser interoperability.

Tests: web-platform-tests/wpt#12577

/cc @avidrissman, who has already implemented this change in Chromium.


/window-object.html ( diff )

@annevk

This comment has been minimized.

Copy link
Member

annevk commented Aug 25, 2018

@bzbarsky @cdumez @dstorey any implementer feedback on this? This seems pretty reasonable to me.

@chrisdavidmills

This comment has been minimized.

Copy link

chrisdavidmills commented Oct 31, 2018

Documentation need recorded at MDN content roadmap — https://trello.com/c/aBs1o6Pg/86-dom-general-enhancements-fx-64

@cdumez

This comment has been minimized.

Copy link
Contributor

cdumez commented Oct 31, 2018

Seems reasonable to me as well, I'd be willing to align WebKit since it is already implemented in Blink.

@domenic domenic merged commit 3b401f9 into whatwg:master Oct 31, 2018

2 checks passed

Participation TimothyGu participates on behalf of Google LLC
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@TimothyGu TimothyGu deleted the TimothyGu:window-open-termination-level branch Oct 31, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment