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
HTML: window.open("", "", "noreferrer") #15352
Conversation
`\u000C${feature}` | ||
].forEach(variant => { | ||
const win = window.open(windowURL, "", variant); | ||
assert_equals(win, null, `"${variant}" should activate feature "${feature}"`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion (and the assert_not_equals
later) is specific to the noopener
feature. Although noreferrer
means the same thing, the file name/function name suggests this is more generic than it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point, I'll rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % nit
assert_equals(e.data.referrer, ""); | ||
assert_equals(e.data.haveOpener, false); | ||
|
||
channel.postMessage(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not be reached if an assertion fails, so the popup will not be closed. Having this first, or using add_cleanup
, would do the trick I believe.
BroadcastChannel :( I had to rewrite the test using localStorage instead so it would run in WebKit. |
@cdumez what is an alternative strategy? Also, any chance WebKit will add BroadcastChannel? |
As I said, I used localStorage as an alternative. I guess cookies could work too. I am not aware of any plan to adopt BroadcastChannel. |
@cdumez ah right, sorry. Wouldn't you rather folks use |
I do not think people should do this in shipping code, and localStorage is good enough for testing purposes. |
For whatwg/html#4331.