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

Standardize the relation between the popup condition, BarProp.visible, and noopener/noreferrer #8520

Open
arai-a opened this issue Nov 17, 2022 · 0 comments

Comments

@arai-a
Copy link
Contributor

arai-a commented Nov 17, 2022

related to #5872

Steps:

  1. Open https://arai-a.github.io/window-open-features/test.html
  2. select "popup", "noopener", "noreferrer" radio buttons
  3. click "open window"

Results:

  • Chromium: a minimal popup window is opened, and window.locationbar.visible is true
  • Firefox: a minimal popup window is opened, and window.locationbar.visible is false
  • Safari: a new window is opened, and window.locationbar.visible is true

The behavior between Chromium and Firefox diverges because the effect of noopener/noreferrer isn't specified in the spec.

The behavior is covered by the following testcase, that expects "is popup" becomes false if noopener or noreferrer is specified.
https://github.com/web-platform-tests/wpt/blob/master/html/browsers/the-window-object/window-open-popup-behavior.html

To reflect the behavior, either of the following needs to be tweaked, to take noopener/noreferrer into account,
depending on whether the hint for popup condition ("is popup") should be true or false for noopener:

(A) Set "is popup" to false if noopener is true

https://html.spec.whatwg.org/multipage/nav-history-apis.html#apis-for-creating-and-navigating-browsing-contexts-by-name:popup-window-is-requested

The window open steps, given a string url, a string target, and a string features, are as follows:
...
12.
  1. Set targetNavigable's active browsing context's is popup to the result of checking if a popup window is requested, given tokenizedFeatures.

https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-barprop-visible

(B) Store noopener or related value to browsing context and use it in BarProp.visible getter

The visible getter steps are:
...
  3. Return the negation of browsingContext's top-level browsing context's is popup.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant