Change behavior of window.open w.r.t. windowPreferences and popups #29334
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See [1] and [2] for more context, but this CL implements new behavior
for how window.open() interprets the windowPreferences argument when
deciding whether to open the window as a new tab or as a "popup",
which is a separate window with minimal UI (toolbars, onmibox,
etc.), and also what to return from the BarProp visible properties,
e.g. window.toolbar.visible.
The existing "trigger" behavior for popups will be retained by this
CL, namely that a popup will be opened instead of a tab if:
location
andtoolbar
are false or missingmenubar
is false or missingscrollbar
is false or missingstatus
is false or missingWith this CL, an additional windowFeature called 'popup' is added,
so that if 'popup' is present and truthy.
Additionally, all BarProp properties (locationbar,menubar,
personalbar,scrollbars,statusbar, and toolbar) will always return
the same values, either false if a popup was opened, or true if
a tab/window was opened.
The spec for this behavior is part of the HTML spec:
https://html.spec.whatwg.org/multipage/window-object.html#popup-window-is-requested
The intent to ship is here:
https://groups.google.com/a/chromium.org/g/blink-dev/c/q6ybnmxxvpE
[1] whatwg/html#5872
[2] whatwg/html#6530
Fixed: 1192701
Change-Id: I50e745b1000d460c49085edd57d13f420b875ff3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2950386
Reviewed-by: Joey Arhar <[email protected]>
Commit-Queue: Mason Freed <[email protected]>
Cr-Commit-Position: refs/heads/main@{#943716}