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

fix: identify rel noopener in list #1035

Merged
merged 1 commit into from
Nov 23, 2016

Conversation

patrickhulce
Copy link
Collaborator

addresses #1029

@@ -22,7 +22,7 @@ class AnchorsWithNoRelNoopener extends Gatherer {

afterPass(options) {
const driver = options.driver;
return driver.querySelectorAll('a[target="_blank"]:not([rel="noopener"])')
return driver.querySelectorAll('a[target="_blank"]:not([rel*="noopener"])')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[rel~="noopener"] so we don't match craziness like rel="supercoolnoopener"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -82,7 +82,7 @@
<!-- FAIL - does not use rel="noopener" to open external link -->
<a href="https://www.google.com/" target="_blank">external link</a>
<!-- PASS -->
<a href="https://www.google.com/" target="_blank" rel="noopener">external link that uses rel="noopener"</a>
<a href="https://www.google.com/" target="_blank" rel="noopener nofollow">external link that uses rel="noopener"</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe also update the textContent to say how this link is different

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ebidel ebidel merged commit dcdabb7 into GoogleChrome:master Nov 23, 2016
@patrickhulce patrickhulce deleted the noopener_fix branch November 23, 2016 20:34
andrewrota pushed a commit to andrewrota/lighthouse that referenced this pull request Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants