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

noopener window.open feature seems pretty broken as implemented in browsers #1902

Closed
bzbarsky opened this issue Oct 14, 2016 · 19 comments
Closed
Assignees
Labels
interop Implementations are not interoperable with each other topic: browsing context topic: navigation

Comments

@bzbarsky
Copy link
Contributor

Trying to use it gives a very broken window because it turns off all the other window features, in both Firefox and Chrome.

Furthermore, it forces the new window into a separate window, not a tab, because it's turning off all the other features.

I don't see how it could possibly be usable in the state it's in right now, unfortunately. Of course it doesn't help that per spec the only supported features are left/right/width/height, which doesn't match browser behavior....

@mikewest

@zcorpan

This comment has been minimized.

@AliceWonderMiscreations

This comment has been minimized.

@AliceWonderMiscreations

This comment has been minimized.

@domenic

This comment has been minimized.

@AliceWonderMiscreations

This comment has been minimized.

@annevk

This comment has been minimized.

@bzbarsky
Copy link
Contributor Author

bzbarsky commented Oct 9, 2017

This didn't really get fixed, because per spec this is not really a problem, in theory.

The key part is "per spec the only supported features are left/right/width/height, which doesn't match browser behavior". Though the spec has changed even on this and doesn't really support anything at all now.

In particular, per spec as currently written, the open steps tokenize the features (modulo #3107) and then ignore all the tokens except "noopener" (thus raising the question of what the point of https://html.spec.whatwg.org/multipage/window-object.html#normalizing-the-feature-name is for, of course). That's not what browsers actually do though; they pay attention to other things in that feature string and will turn off various features if they are not present in a nonempty feature string. So simply specifying "noopener" will turn off large chunks of the browser UI.

@annevk
Copy link
Member

annevk commented Oct 9, 2017

Hmm, the point was that we'd defer to CSSOM for the remaining features. Ah, #2464 is still open and about that. Seems @zcorpan wasn't able to drive that to a conclusion yet.

@bzbarsky
Copy link
Contributor Author

bzbarsky commented Oct 9, 2017

OK. We do need to actually pass the tokenized features to somewhere where CSSOM will see it...

But fwiw, on the HTML spec front just removing "noopener" from the tokenized features before passing on to the lower layer would presumably fix this problem, in that it would make it clear that noopener has no effect on the appearance.... Then we could at least file bugs on implementations to fix their broken stuff.

@annevk
Copy link
Member

annevk commented Oct 9, 2017

Wouldn't CSSOM ignore unknown tokens anyway?

It seems not passing it to CSSOM regressed somewhere after b649435. Sigh.

@bzbarsky
Copy link
Contributor Author

bzbarsky commented Oct 9, 2017

Wouldn't CSSOM ignore unknown tokens anyway?

That doesn't match actual browser behavior (again in at least Firefox and Chrome). If I do:

window.open("", "", "yousaywhat?");

I get a browser window missing UI pieces in both.

@annevk

This comment has been minimized.

@annevk

This comment has been minimized.

@annevk

This comment has been minimized.

@annevk annevk added interop Implementations are not interoperable with each other topic: browsing context topic: navigation labels Oct 9, 2017
jplaisted pushed a commit to google/closure-library that referenced this issue Oct 19, 2017
RELNOTES: Introduces a workaround for window.open(..., 'noopener') which will cause the the URL to open in a new browser window with no bookmark bar or ability to add tabs. This is a known issue tracked here: whatwg/html#1902

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172163219
shicks added a commit to google/closure-library that referenced this issue Oct 27, 2017
*** Reason for rollback ***

Broke tests.

*** Original change description ***

Open URL in new tab instead of new window to fix the URL flow.

RELNOTES: Introduces a workaround for window.open(..., 'noopener') which will cause the the URL to open in a new browser window with no bookmark bar or ability to add tabs. This is a known issue tracked here: whatwg/html#1902

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172165281
shicks added a commit to google/closure-library that referenced this issue Oct 27, 2017
…ow to fix the URL flow.

NEW: Had to add if-check. Updating yt-navigation-manager in separate cl/172167161.

RELNOTES: Introduces a workaround for window.open(..., 'noopener') which will cause the the URL to open in a new browser window with no bookmark bar or ability to add tabs. This is a known issue tracked here: whatwg/html#1902

Automated g4 rollback of changelist 172234702.

*** Reason for rollback ***

Do not rollback this cl, instead, cr/172222691 would fix the breakage test.

*** Original change description ***

Automated g4 rollback of changelist 172221695.

*** Reason for rollback ***

Break youtube.

*** Original change description ***

Automated g4 rollback of changelist 172165281.

*** Reason for rollback ***

Had to add if-check. Updating yt-navigation-manager in separate cl/172167161.

*** Original change description ***

Automated g4 rollback...

***

ROLLBACK_OF=172234702
RELNOTES: rollback

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172281082
@zcorpan
Copy link
Member

zcorpan commented Dec 4, 2017

I was aware that unknown features are different from empty string, that was reported in https://www.w3.org/Bugs/Public/show_bug.cgi?id=25685#c3 and not yet fixed.

#2464 is indeed also about this. But a good first step would be to specify special treatment to the empty string (or maybe empty set of features) in cssom.

@bzbarsky

But fwiw, on the HTML spec front just removing "noopener" from the tokenized features before passing on to the lower layer would presumably fix this problem, in that it would make it clear that noopener has no effect on the appearance....

That's a good idea.

(Edit: fixed 2474 -> 2464 above.)

annevk added a commit that referenced this issue Dec 16, 2017
Apparently CSSOM needs to react differently if it's there.

Helps with #1902.
@annevk
Copy link
Member

annevk commented Dec 16, 2017

Okay, I created #3297 to remove noopener before passing it on to CSSOM.

annevk added a commit that referenced this issue Apr 12, 2019
Otherwise CSSOM will assume it's more than a new window.

Helps with #1902.

Tests: ...
annevk added a commit that referenced this issue May 3, 2019
Otherwise CSSOM will assume it's more than a new window and treat it like a popup or some such.

Helps with #1902.

Tests: web-platform-tests/wpt#16330 & web-platform-tests/wpt#16658.
@annevk
Copy link
Member

annevk commented May 3, 2019

Okay, so now HTML removes noopener/noreferrer before invoking https://drafts.csswg.org/cssom-view/#set-up-browsing-context-features.

#2464 tracks additional features, though normalizing of most of these is defined in HTML too.

https://drafts.csswg.org/cssom-view/#set-up-browsing-context-features seems to be lacking still as it doesn't address certain features, e.g., toolbar, and it doesn't do something special if the passed map is non-empty (regardless of whether any of the features are recognized).

@zcorpan @emilio do you know if there is a tracking issue on the CSSOM side for those?

@zcorpan
Copy link
Member

zcorpan commented May 3, 2019

There are the old bugs in Bugzilla (linked above); I can't find anything in GitHub.

@annevk
Copy link
Member

annevk commented Oct 17, 2019

Closing this now I put all the relevant remaining information in #2464. That also links a corresponding CSSOM issue.

@annevk annevk closed this as completed Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interop Implementations are not interoperable with each other topic: browsing context topic: navigation
Development

No branches or pull requests

5 participants