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

core(noopener-audit): noreferrer implies noopener #4920

Merged
merged 2 commits into from
Apr 4, 2018

Conversation

jwheare
Copy link
Contributor

@jwheare jwheare commented Apr 4, 2018

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.

@patrickhulce
Copy link
Collaborator

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?

Copy link
Member

@paulirish paulirish left a 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"`',
Copy link
Member

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 ' +
Copy link
Member

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 ' +
Copy link
Member

Choose a reason for hiding this comment

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

Add rel="noopener" or rel="noreferrer" to any external links to improve performance and prevent security vulnerabilities.

@jwheare
Copy link
Contributor Author

jwheare commented Apr 4, 2018

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.

@paulirish
Copy link
Member

it's editable here: https://github.com/google/WebFundamentals/blob/master/src/content/en/tools/lighthouse/audits/noopener.md

@paulirish paulirish merged commit 9ea152b into GoogleChrome:master Apr 4, 2018
@jwheare jwheare deleted the noopener-noreferrer branch April 5, 2018 08:00
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.

noopener audit should also allow noreferrer
4 participants