-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
core(noopener-audit): noreferrer implies noopener #4920
Conversation
thanks for the PR @jwheare! last time this died from lack of consensus on recommending both/just one/etc. I'm still in favor of allowing either to pass like you've implemented here. @paulirish WDYT now? |
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.
code lgtm.
i have some wording changes. what do folks think?
@@ -16,9 +16,10 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit { | |||
return { | |||
name: 'external-anchors-use-rel-noopener', | |||
description: 'Opens external anchors using `rel="noopener"`', |
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.
Links to cross-origin destinations are safe
failureDescription: 'Does not open external anchors using `rel="noopener"`', | ||
helpText: 'Open new tabs using `rel="noopener"` to improve performance and ' + | ||
'prevent security vulnerabilities. ' + | ||
failureDescription: 'Does not open external anchors using `rel="noopener"` or ' + |
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.
Links to cross-origin destinations are unsafe
'prevent security vulnerabilities. ' + | ||
failureDescription: 'Does not open external anchors using `rel="noopener"` or ' + | ||
'`rel="noreferrer"`', | ||
helpText: 'Open new tabs using `rel="noopener"` or `rel="noreferrer"` to improve ' + |
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.
Add
rel="noopener"
orrel="noreferrer"
to any external links to improve performance and prevent security vulnerabilities.
Wording changes sound good to me. Is the text on https://developers.google.com/web/tools/lighthouse/audits/noopener editable in a repo somewhere? Would be good to update that to mention noreferrer too. |
This fixes #2482 and updates #2485 fixing conflicts.
The added tests were checked with ./lighthouse-cli/test/smokehouse/dobetterweb/run-tests.sh
Not sure why the byte-efficiency test is failing in appveyor, it happened to me too locally, but I haven't made any changes that would affect it from what I can tell.