Skip to content

Commit

Permalink
fix: identify rel noopener in list (GoogleChrome#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhulce authored and ebidel committed Nov 23, 2016
1 parent 62c79b1 commit dcdabb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h2>Do better web tester page</h2>
<!-- 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 and another unrelated rel attribute</a>
<!-- PASS -->
<a href="./doesnotexist" target="_blank">internal link is ok</a>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"])')
.then(failingNodeList => {
const failingNodes = failingNodeList.map(node => {
return Promise.all([
Expand Down

0 comments on commit dcdabb7

Please sign in to comment.