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

HTML: window.open("", "", "noreferrer") #15352

Merged
merged 4 commits into from Feb 26, 2019
Merged

Conversation

annevk
Copy link
Member

@annevk annevk commented Feb 12, 2019

`\u000C${feature}`
].forEach(variant => {
const win = window.open(windowURL, "", variant);
assert_equals(win, null, `"${variant}" should activate feature "${feature}"`);
Copy link
Member

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.

Copy link
Member Author

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.

annevk added a commit to whatwg/html that referenced this pull request Feb 12, 2019
annevk added a commit to whatwg/html that referenced this pull request Feb 12, 2019
mustaqahmed pushed a commit to mustaqahmed/html that referenced this pull request Feb 15, 2019
mustaqahmed pushed a commit to mustaqahmed/html that referenced this pull request Feb 15, 2019
@annevk annevk requested a review from zcorpan February 24, 2019 08:08
Copy link
Member

@zcorpan zcorpan left a 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);
Copy link
Member

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.

@annevk annevk merged commit 22abb9c into master Feb 26, 2019
@annevk annevk deleted the annevk/window-open-noreferrer branch February 26, 2019 11:01
@cdumez
Copy link
Contributor

cdumez commented Mar 29, 2019

BroadcastChannel :( I had to rewrite the test using localStorage instead so it would run in WebKit.

@annevk
Copy link
Member Author

annevk commented Mar 30, 2019

@cdumez what is an alternative strategy? Also, any chance WebKit will add BroadcastChannel?

@cdumez
Copy link
Contributor

cdumez commented Mar 30, 2019

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.

@annevk
Copy link
Member Author

annevk commented Apr 5, 2019

@cdumez ah right, sorry. Wouldn't you rather folks use BroadcastChannel than abuse localStorage for messaging between disconnected top-level browsing contexts?

@cdumez
Copy link
Contributor

cdumez commented Apr 5, 2019

I do not think people should do this in shipping code, and localStorage is good enough for testing purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants