-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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. |
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. |
Wouldn't CSSOM ignore unknown tokens anyway? It seems not passing it to CSSOM regressed somewhere after b649435. Sigh. |
That doesn't match actual browser behavior (again in at least Firefox and Chrome). If I do:
I get a browser window missing UI pieces in both. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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
*** 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
…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
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.
That's a good idea. (Edit: fixed 2474 -> 2464 above.) |
Apparently CSSOM needs to react differently if it's there. Helps with #1902.
Okay, I created #3297 to remove noopener before passing it on to CSSOM. |
Otherwise CSSOM will assume it's more than a new window. Helps with #1902. Tests: ...
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.
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., @zcorpan @emilio do you know if there is a tracking issue on the CSSOM side for those? |
There are the old bugs in Bugzilla (linked above); I can't find anything in GitHub. |
Closing this now I put all the relevant remaining information in #2464. That also links a corresponding CSSOM issue. |
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
The text was updated successfully, but these errors were encountered: