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

Removes uses of HTML injection in report #1226

Merged
merged 4 commits into from
Jan 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lighthouse-core/audits/accessibility/tabindex.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TabIndex extends AxeAudit {
return {
category: 'Accessibility',
name: 'tabindex',
description: 'No element has a tabindex attribute greater than 0',
description: 'No element has a `tabindex` attribute greater than 0',
requiredArtifacts: ['Accessibility']
};
}
Expand Down
4 changes: 3 additions & 1 deletion lighthouse-core/audits/content-width.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class ContentWidth extends Audit {
category: 'Mobile Friendly',
name: 'content-width',
description: 'Content is sized correctly for the viewport',
helpText: 'If the width of your app\'s content doesn\'t match the width of the viewport, your app might not be optimized for mobile screens. <a href="https://developers.google.com/web/tools/lighthouse/audits/content-sized-correctly-for-viewport" rel="noopener" target="_blank">Learn more</a>.',
helpText: 'If the width of your app\'s content doesn\'t match the width ' +
'of the viewport, your app might not be optimized for mobile screens. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/content-sized-correctly-for-viewport).',
requiredArtifacts: ['ContentWidth']
};
}
Expand Down
6 changes: 5 additions & 1 deletion lighthouse-core/audits/critical-request-chains.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class CriticalRequestChains extends Audit {
name: 'critical-request-chains',
description: 'Critical Request Chains',
optimalValue: 0,
helpText: 'The Critical Request Chains below show you what resources are required for first render of this page. Improve page load by reducing the length of chains, reducing the download size of resources, or deferring the download of unnecessary resources. <a href="https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains" rel="noopener" target="_blank">Learn more</a>.',
helpText: 'The Critical Request Chains below show you what resources are ' +
'required for first render of this page. Improve page load by reducing ' +
'the length of chains, reducing the download size of resources, or ' +
'deferring the download of unnecessary resources. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/critical-request-chains).',
requiredArtifacts: ['networkRecords']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/dobetterweb/appcache-manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AppCacheManifestAttr extends Audit {
category: 'Offline',
name: 'appcache-manifest',
description: 'Site does not use Application Cache',
helpText: 'Application Cache has been <a href="https://html.spec.whatwg.org/multipage/browsers.html#offline" target="_blank">deprecated</a> by <a href="https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers" target="_blank">Service Workers</a>. Consider implementing an offline solution using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Cache" target="_blank">Cache Storage API</a>.',
helpText: 'Application Cache has been [deprecated](https://html.spec.whatwg.org/multipage/browsers.html#offline) by [Service Workers](https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers). Consider implementing an offline solution using the [Cache Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Cache).',
requiredArtifacts: ['AppCacheManifest']
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit {
category: 'Performance',
name: 'external-anchors-use-rel-noopener',
description: 'Site opens external anchors using rel="noopener"',
helpText: 'Open new tabs using <code>rel="noopener"</code> to improve performance and ' +
'prevent security vulnerabilities. <a href="https://developers.google.com/web/tools/' +
'lighthouse/audits/noopener" target="_blank" rel="noopener">Learn more</a>.',
helpText: 'Open new tabs using `rel="noopener"` to improve performance and ' +
'prevent security vulnerabilities. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).',
requiredArtifacts: ['URL', 'AnchorsWithNoRelNoopener']
};
}
Expand Down
3 changes: 1 addition & 2 deletions lighthouse-core/audits/dobetterweb/geolocation-on-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class GeolocationOnStart extends Audit {
description: 'Page does not automatically request geolocation on page load',
helpText: 'Users are mistrustful of or confused by sites that request their ' +
'location without context. Consider tying the request to user gestures instead. ' +
'<a href="https://developers.google.com/web/tools/lighthouse/audits/' +
'geolocation-on-load" target="_blank" rel="noopener">Learn more</a>.',
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).',
requiredArtifacts: ['GeolocationOnStart']
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class LinkBlockingFirstPaintAudit extends Audit {
description: 'Site does not use <link> that delay first paint',
helpText: 'Link elements are blocking the first paint of your page. Consider ' +
'inlining critical links and deferring non-critical ones. ' +
'<a href="https://developers.google.com/web/tools/lighthouse/audits/' +
'blocking-resources" target="_blank" rel="noopener">Learn more</a>.',
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/blocking-resources).',
requiredArtifacts: ['TagsBlockingFirstPaint']
};
}
Expand Down
9 changes: 4 additions & 5 deletions lighthouse-core/audits/dobetterweb/no-console-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,11 @@ class NoConsoleTimeAudit extends Audit {
return {
category: 'JavaScript',
name: 'no-console-time',
description: 'Site does not use console.time() in its own scripts',
helpText: 'Consider using <code>performance.mark()</code> and <code>performance.measure()' +
'</code> from the User Timing API instead. They provide high-precision timestamps, ' +
description: 'Site does not use `console.time()` in its own scripts',
helpText: 'Consider using `performance.mark()` and `performance.measure()` ' +
'from the User Timing API instead. They provide high-precision timestamps, ' +
'independent of the system clock, and are integrated in the Chrome DevTools Timeline. ' +
'<a href="https://developers.google.com/web/tools/lighthouse/audits/console-time" ' +
'target="_blank" rel="noopener">Learn more</a>.',
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/console-time).',
requiredArtifacts: ['URL', 'ConsoleTimeUsage']
};
}
Expand Down
7 changes: 3 additions & 4 deletions lighthouse-core/audits/dobetterweb/no-datenow.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,10 @@ class NoDateNowAudit extends Audit {
return {
category: 'JavaScript',
name: 'no-datenow',
description: 'Site does not use Date.now() in its own scripts',
helpText: 'Consider using <code>performance.now()</code> from the User Timing API ' +
description: 'Site does not use `Date.now()` in its own scripts',
helpText: 'Consider using `performance.now()` from the User Timing API ' +
'instead. It provides high-precision timestamps, independent of the system ' +
'clock. <a href="https://developers.google.com/web/tools/lighthouse/audits/' +
'date-now" target="_blank" rel="noopener">Learn more</a>.',
'clock. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/date-now).',
requiredArtifacts: ['URL', 'DateNowUse']
};
}
Expand Down
5 changes: 2 additions & 3 deletions lighthouse-core/audits/dobetterweb/no-document-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,8 @@ class NoDocWriteAudit extends Audit {
name: 'no-document-write',
description: 'Site does not use document.write()',
helpText: 'For users on slow connections, external scripts dynamically injected via ' +
'<code>document.write()</code> can delay page load by tens of seconds. ' +
'<a href="https://developers.google.com/web/tools/lighthouse/audits/' +
'document-write" target="_blank" rel="noopener">Learn more</a>.',
'`document.write()` can delay page load by tens of seconds. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).',
requiredArtifacts: ['DocWriteUse']
};
}
Expand Down
3 changes: 1 addition & 2 deletions lighthouse-core/audits/dobetterweb/no-mutation-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ class NoMutationEventsAudit extends Audit {
name: 'no-mutation-events',
description: 'Site does not use Mutation Events in its own scripts',
helpText: 'Mutation Events are deprecated and harm performance. Consider using Mutation ' +
'Observers instead. <a href="https://developers.google.com/web/tools/lighthouse' +
'/audits/mutation-events" target="_blank" rel="noopener">Learn more</a>.',
'Observers instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/mutation-events).',
requiredArtifacts: ['URL', 'EventListeners']
};
}
Expand Down
3 changes: 1 addition & 2 deletions lighthouse-core/audits/dobetterweb/no-old-flexbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class NoOldFlexboxAudit extends Audit {
name: 'no-old-flexbox',
description: 'Site does not use the old CSS flexbox',
helpText: 'The 2009 spec of Flexbox is deprecated and is 2.3x slower than the latest ' +
'spec. <a href="https://developers.google.com/web/tools/lighthouse/audits/' +
'old-flexbox" target="_blank" rel="noopener">Learn more</a>.',
'spec. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/old-flexbox).',
requiredArtifacts: ['Styles']
};
}
Expand Down
3 changes: 1 addition & 2 deletions lighthouse-core/audits/dobetterweb/no-websql.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ class NoWebSQLAudit extends Audit {
name: 'no-websql',
description: 'Site does not use WebSQL DB.',
helpText: 'Web SQL is deprecated. Consider using IndexedDB instead. ' +
'<a href="https://developers.google.com/web/tools/lighthouse/audits/web-sql" ' +
'target="_blank" rel="noopener">Learn more</a>.',
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/web-sql).',
requiredArtifacts: ['WebSQL']
};
}
Expand Down
3 changes: 1 addition & 2 deletions lighthouse-core/audits/dobetterweb/notification-on-start.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class NotificationOnStart extends Audit {
description: 'Page does not automatically request notification permissions on page load',
helpText: 'Users are mistrustful of or confused by sites that request to send ' +
'notifications without context. Consider tying the request to user gestures ' +
'instead. <a href="https://developers.google.com/web/tools/lighthouse/audits/' +
'notifications-on-load" target="_blank" rel="noopener">Learn more</a>.',
'instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/notifications-on-load).',
requiredArtifacts: ['NotificationOnStart']
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class ScriptBlockingFirstPaint extends Audit {
description: 'Site does not use <script> in head that delays first paint',
helpText: 'Script elements are blocking the first paint of your page. Consider inlining ' +
'critical scripts and deferring non-critical ones. ' +
'<a href="https://developers.google.com/web/tools/lighthouse/' +
'audits/blocking-resources" target="_blank" rel="noopener">Learn more</a>.',
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/blocking-resources).',
requiredArtifacts: ['TagsBlockingFirstPaint']
};
}
Expand Down
3 changes: 1 addition & 2 deletions lighthouse-core/audits/dobetterweb/uses-http2.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class UsesHTTP2Audit extends Audit {
name: 'uses-http2',
description: 'Site uses HTTP/2 for its own resources',
helpText: 'HTTP/2 offers many benefits over HTTP/1.1, including binary headers, ' +
'multiplexing, and server push. <a href="https://developers.google.com/' +
'web/tools/lighthouse/audits/http2" target="_blank" rel="noopener">Learn more</a>.',
'multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).',
requiredArtifacts: ['URL', 'networkRecords']
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ class PassiveEventsAudit extends Audit {
category: 'JavaScript',
name: 'uses-passive-event-listeners',
description: 'Site uses passive listeners to improve scrolling performance',
helpText: 'Consider marking your touch and wheel event listeners as <code>passive</code> ' +
'to improve your page\'s scroll performance. <a href="https://developers.google.com/' +
'web/tools/lighthouse/audits/passive-event-listeners" target="_blank" ' +
'rel="noopener">Learn more</a>.',
helpText: 'Consider marking your touch and wheel event listeners as `passive` ' +
'to improve your page\'s scroll performance. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners).',
requiredArtifacts: ['URL', 'EventListeners']
};
}
Expand Down
6 changes: 5 additions & 1 deletion lighthouse-core/audits/estimated-input-latency.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ class EstimatedInputLatency extends Audit {
name: 'estimated-input-latency',
description: 'Estimated Input Latency',
optimalValue: SCORING_POINT_OF_DIMINISHING_RETURNS.toLocaleString() + 'ms',
helpText: 'The score above is an estimate of how long your app takes to respond to user input, in milliseconds. There is a 90% probability that a user encounters this amount of latency, or less. 10% of the time a user can expect additional latency. If your score is higher than Lighthouse\'s target score, users may perceive your app as laggy. <a href="https://developers.google.com/web/tools/lighthouse/audits/estimated-input-latency" rel="noopener" target="_blank">Learn more</a>.',
helpText: 'The score above is an estimate of how long your app takes to respond to user ' +
'input, in milliseconds. There is a 90% probability that a user encounters this amount ' +
'of latency, or less. 10% of the time a user can expect additional latency. If your ' +
'score is higher than Lighthouse\'s target score, users may perceive your app as ' +
'laggy. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/estimated-input-latency).',
requiredArtifacts: ['traces']
};
}
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-core/audits/first-meaningful-paint.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class FirstMeaningfulPaint extends Audit {
name: 'first-meaningful-paint',
description: 'First meaningful paint',
optimalValue: SCORING_POINT_OF_DIMINISHING_RETURNS.toLocaleString() + 'ms',
helpText: 'First meaningful paint measures when the primary content of a page is visible. <a href="https://developers.google.com/web/tools/lighthouse/audits/first-meaningful-paint" target="_blank" rel="noopener">Learn more</a>.',
helpText: 'First meaningful paint measures when the primary content of a page is visible. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/first-meaningful-paint).',
requiredArtifacts: ['traces']
};
}
Expand Down
6 changes: 5 additions & 1 deletion lighthouse-core/audits/is-on-https.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ class HTTPS extends Audit {
category: 'Security',
name: 'is-on-https',
description: 'Site is on HTTPS',
helpText: 'All sites should be protected with HTTPS, even ones that don\'t handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2 and many new web platform APIs. <a href="https://developers.google.com/web/tools/lighthouse/audits/https" target="_blank" rel="noopener">Learn more</a>.',
helpText: 'All sites should be protected with HTTPS, even ones that don\'t handle ' +
'sensitive data. HTTPS prevents intruders from tampering with or passively listening ' +
'in on the communications between your app and your users, and is a prerequisite for ' +
'HTTP/2 and many new web platform APIs. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/https).',
requiredArtifacts: ['HTTPS']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/manifest-background-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class ManifestBackgroundColor extends Audit {
return {
category: 'Manifest',
name: 'manifest-background-color',
description: 'Manifest contains background_color',
description: 'Manifest contains `background_color`',
requiredArtifacts: ['Manifest']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/manifest-display.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ManifestDisplay extends Audit {
return {
category: 'Manifest',
name: 'manifest-display',
description: 'Manifest\'s display property is set',
description: 'Manifest\'s `display` property is set',
requiredArtifacts: ['Manifest']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/manifest-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ManifestName extends Audit {
return {
category: 'Manifest',
name: 'manifest-name',
description: 'Manifest contains name',
description: 'Manifest contains `name`',
requiredArtifacts: ['Manifest']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/manifest-short-name-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ManifestShortNameLength extends Audit {
return {
category: 'Manifest',
name: 'manifest-short-name-length',
description: 'Manifest\'s short_name won\'t be truncated when displayed on homescreen',
description: 'Manifest\'s `short_name` won\'t be truncated when displayed on homescreen',
requiredArtifacts: ['Manifest']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/manifest-short-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ManifestShortName extends Audit {
return {
category: 'Manifest',
name: 'manifest-short-name',
description: 'Manifest contains short_name',
description: 'Manifest contains `short_name`',
requiredArtifacts: ['Manifest']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/manifest-start-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ManifestStartUrl extends Audit {
return {
category: 'Manifest',
name: 'manifest-start-url',
description: 'Manifest contains start_url',
description: 'Manifest contains `start_url`',
requiredArtifacts: ['Manifest']
};
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/manifest-theme-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ManifestThemeColor extends Audit {
return {
category: 'Manifest',
name: 'manifest-theme-color',
description: 'Manifest contains theme_color',
description: 'Manifest contains `theme_color`',
requiredArtifacts: ['Manifest']
};
}
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-core/audits/redirects-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ class RedirectsHTTP extends Audit {
category: 'Security',
name: 'redirects-http',
description: 'Site redirects HTTP traffic to HTTPS',
helpText: 'If you\'ve already set up HTTPS, make sure that you redirect all HTTP traffic to HTTPS. <a href="https://developers.google.com/web/tools/lighthouse/audits/http-redirects-to-https" target="_blank" rel="noopener">Learn more</a>.',
helpText: 'If you\'ve already set up HTTPS, make sure that you redirect all HTTP traffic ' +
'to HTTPS. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http-redirects-to-https).',
requiredArtifacts: ['HTTPRedirect']
};
}
Expand Down
4 changes: 3 additions & 1 deletion lighthouse-core/audits/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class ServiceWorker extends Audit {
category: 'Offline',
name: 'service-worker',
description: 'Has a registered Service Worker',
helpText: 'The service worker is the technology that enables your app to use many Progressive Web App features, such as offline, add to homescreen, and push notifications. <a href="https://developers.google.com/web/tools/lighthouse/audits/registered-service-worker" target="_blank" rel="noopener">Learn more</a>.',
helpText: 'The service worker is the technology that enables your app to use many ' +
'Progressive Web App features, such as offline, add to homescreen, and push ' +
'notifications. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/registered-service-worker).',
requiredArtifacts: ['URL', 'ServiceWorker']
};
}
Expand Down
3 changes: 2 additions & 1 deletion lighthouse-core/audits/speed-index-metric.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class SpeedIndexMetric extends Audit {
category: 'Performance',
name: 'speed-index-metric',
description: 'Perceptual Speed Index',
helpText: 'Speed Index shows how quickly the contents of a page are visibly populated. <a href="https://developers.google.com/web/tools/lighthouse/audits/speed-index" target="_blank" rel="noopener">Learn more</a>.',
helpText: 'Speed Index shows how quickly the contents of a page are visibly populated. ' +
'[Learn more](https://developers.google.com/web/tools/lighthouse/audits/speed-index).',
optimalValue: SCORING_POINT_OF_DIMINISHING_RETURNS.toLocaleString(),
requiredArtifacts: ['traces']
};
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-core/audits/theme-color-meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ThemeColor extends Audit {
return {
category: 'HTML',
name: 'theme-color-meta',
description: 'HTML has a theme-color <meta>',
description: 'HTML has a `<meta name="theme-color">` tag',
requiredArtifacts: ['ThemeColor']
};
}
Expand Down
Loading