From f328fecf298f9f495f2e7d23f4fc5e80a25e19d6 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 31 May 2019 00:14:35 -0700 Subject: [PATCH 01/12] Initial best practices i18n collection. --- lighthouse-core/audits/deprecations.js | 28 ++- .../audits/dobetterweb/appcache-manifest.js | 22 +- lighthouse-core/audits/dobetterweb/doctype.js | 32 ++- .../external-anchors-use-rel-noopener.js | 25 +- .../dobetterweb/geolocation-on-start.js | 20 +- .../audits/dobetterweb/js-libraries.js | 13 +- .../audits/dobetterweb/no-document-write.js | 20 +- .../dobetterweb/no-vulnerable-libraries.js | 34 ++- .../dobetterweb/notification-on-start.js | 20 +- .../password-inputs-can-be-pasted-into.js | 18 +- .../audits/dobetterweb/uses-http2.js | 29 ++- .../uses-passive-event-listeners.js | 20 +- lighthouse-core/audits/errors-in-console.js | 18 +- lighthouse-core/audits/image-aspect-ratio.js | 23 +- lighthouse-core/audits/is-on-https.js | 34 ++- lighthouse-core/config/default-config.js | 5 +- lighthouse-core/lib/i18n/en-US.json | 224 ++++++++++++++++++ lighthouse-core/test/results/sample_v2.json | 143 ++++++++++- proto/sample_v2_round_trip.json | 2 +- 19 files changed, 631 insertions(+), 99 deletions(-) diff --git a/lighthouse-core/audits/deprecations.js b/lighthouse-core/audits/deprecations.js index 238ee9ddb102..1e20e92b0ef2 100644 --- a/lighthouse-core/audits/deprecations.js +++ b/lighthouse-core/audits/deprecations.js @@ -13,6 +13,20 @@ const Audit = require('./audit.js'); const Util = require('../report/html/renderer/util.js'); +const i18n = require('../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Avoids deprecated APIs', + failureTitle: 'Uses deprecated APIs', + description: 'Deprecated APIs will eventually be removed from the browser. ' + + '[Learn more](https://www.chromestatus.com/features#deprecated).', + displayValue: `{itemCount, plural, + =1 {1 warning found} + other {# warnings found} + }`, +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class Deprecations extends Audit { /** @@ -21,10 +35,9 @@ class Deprecations extends Audit { static get meta() { return { id: 'deprecations', - title: 'Avoids deprecated APIs', - failureTitle: 'Uses deprecated APIs', - description: 'Deprecated APIs will eventually be removed from the browser. ' + - '[Learn more](https://www.chromestatus.com/features#deprecated).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['ConsoleMessages'], }; } @@ -54,10 +67,8 @@ class Deprecations extends Audit { const details = Audit.makeTableDetails(headings, deprecations); let displayValue = ''; - if (deprecations.length > 1) { - displayValue = `${Util.formatNumber(deprecations.length)} warnings found`; - } else if (deprecations.length === 1) { - displayValue = `${deprecations.length} warning found`; + if (deprecations.length > 0) { + displayValue = str_(UIStrings.displayValue, {itemCount: deprecations.length}); } return { @@ -72,3 +83,4 @@ class Deprecations extends Audit { } module.exports = Deprecations; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/appcache-manifest.js b/lighthouse-core/audits/dobetterweb/appcache-manifest.js index f475db34ce9b..204ef9a28d8c 100644 --- a/lighthouse-core/audits/dobetterweb/appcache-manifest.js +++ b/lighthouse-core/audits/dobetterweb/appcache-manifest.js @@ -11,6 +11,17 @@ 'use strict'; const Audit = require('../audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Avoids Application Cache', + failureTitle: 'Uses Application Cache', + description: 'Application Cache is deprecated. ' + + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/appcache).', + displayValue: 'Found "{AppCacheManifest}"' +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class AppCacheManifestAttr extends Audit { /** @@ -19,10 +30,9 @@ class AppCacheManifestAttr extends Audit { static get meta() { return { id: 'appcache-manifest', - title: 'Avoids Application Cache', - failureTitle: 'Uses Application Cache', - description: 'Application Cache is deprecated. ' + - '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/appcache).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['AppCacheManifest'], }; } @@ -33,7 +43,8 @@ class AppCacheManifestAttr extends Audit { */ static audit(artifacts) { const usingAppcache = artifacts.AppCacheManifest !== null; - const displayValue = usingAppcache ? `Found "${artifacts.AppCacheManifest}"` : ''; + const displayValue = usingAppcache ? + str_(UIStrings.displayValue, {AppCacheManifest: artifacts.AppCacheManifest}): ''; return { score: usingAppcache ? 0 : 1, @@ -43,3 +54,4 @@ class AppCacheManifestAttr extends Audit { } module.exports = AppCacheManifestAttr; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/doctype.js b/lighthouse-core/audits/dobetterweb/doctype.js index 4ba11830db2f..31af3ebf15ce 100644 --- a/lighthouse-core/audits/dobetterweb/doctype.js +++ b/lighthouse-core/audits/dobetterweb/doctype.js @@ -6,6 +6,21 @@ 'use strict'; const Audit = require('../audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Page has the HTML doctype', + failureTitle: 'Page is missing the HTML doctype', + description: 'Specifying a doctype prevents the browser ' + + 'from switching to quirks-mode. Read more on the ' + + '[MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)', + explanationNoDoctype: 'Document must contain a doctype', + explanationPublicId: 'Expected publicId to be an empty string', + explanationSystemId: 'Expected systemId to be an empty string', + explanationBadDoctype: 'Doctype name must be the lowercase string `html`', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class Doctype extends Audit { /** @@ -14,11 +29,9 @@ class Doctype extends Audit { static get meta() { return { id: 'doctype', - title: 'Page has the HTML doctype', - failureTitle: 'Page is missing the HTML doctype', - description: 'Specifying a doctype prevents the browser from switching to quirks-mode.' + - 'Read more on the ' + - '[MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['Doctype'], }; } @@ -31,7 +44,7 @@ class Doctype extends Audit { if (!artifacts.Doctype) { return { score: 0, - explanation: 'Document must contain a doctype', + explanation: str_(UIStrings.explanationNoDoctype), }; } @@ -43,14 +56,14 @@ class Doctype extends Audit { if (doctypePublicId !== '') { return { score: 0, - explanation: 'Expected publicId to be an empty string', + explanation: str_(UIStrings.explanationPublicId), }; } if (doctypeSystemId !== '') { return { score: 0, - explanation: 'Expected systemId to be an empty string', + explanation: str_(UIStrings.explanationSystemId), }; } @@ -64,10 +77,11 @@ class Doctype extends Audit { } else { return { score: 0, - explanation: 'Doctype name must be the lowercase string `html`', + explanation: str_(UIStrings.explanationBadDoctype), }; } } } module.exports = Doctype; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index 7333085ce078..aff9361ebb37 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -7,6 +7,19 @@ const URL = require('../../lib/url-shim.js'); const Audit = require('../audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Links to cross-origin destinations are safe', + failureTitle: 'Links to cross-origin destinations are unsafe', + description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + + 'performance and prevent security vulnerabilities. ' + + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).', + warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' + + 'If not used as a hyperlink, consider removing target=_blank.' +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class ExternalAnchorsUseRelNoopenerAudit extends Audit { /** @@ -15,11 +28,9 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit { static get meta() { return { id: 'external-anchors-use-rel-noopener', - title: 'Links to cross-origin destinations are safe', - failureTitle: 'Links to cross-origin destinations are unsafe', - description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + - 'performance and prevent security vulnerabilities. ' + - '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['URL', 'AnchorElements'], }; } @@ -40,8 +51,7 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit { try { return new URL(anchor.href).host !== pageHost; } catch (err) { - warnings.push(`Unable to determine the destination for anchor (${anchor.outerHTML}). ` + - 'If not used as a hyperlink, consider removing target=_blank.'); + warnings.push(str_(UIStrings.warning,{anchorHTML: anchor.outerHTML})); return true; } }) @@ -78,3 +88,4 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit { } module.exports = ExternalAnchorsUseRelNoopenerAudit; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js index e773c3594415..cf4aa61504b2 100644 --- a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +++ b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js @@ -12,6 +12,17 @@ 'use strict'; const ViolationAudit = require('../violation-audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Avoids requesting the geolocation permission on page load', + failureTitle: 'Requests the geolocation permission on page load', + description: 'Users are mistrustful of or confused by sites that request their ' + + 'location without context. Consider tying the request to user gestures instead. ' + + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class GeolocationOnStart extends ViolationAudit { /** @@ -20,11 +31,9 @@ class GeolocationOnStart extends ViolationAudit { static get meta() { return { id: 'geolocation-on-start', - title: 'Avoids requesting the geolocation permission on page load', - failureTitle: 'Requests the geolocation permission on page load', - description: 'Users are mistrustful of or confused by sites that request their ' + - 'location without context. Consider tying the request to user gestures instead. ' + - '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['ConsoleMessages'], }; } @@ -57,3 +66,4 @@ class GeolocationOnStart extends ViolationAudit { } module.exports = GeolocationOnStart; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/js-libraries.js b/lighthouse-core/audits/dobetterweb/js-libraries.js index cc255b179ba8..79e3afe201e0 100644 --- a/lighthouse-core/audits/dobetterweb/js-libraries.js +++ b/lighthouse-core/audits/dobetterweb/js-libraries.js @@ -11,6 +11,14 @@ 'use strict'; const Audit = require('../audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Detected JavaScript libraries', + description: 'All front-end JavaScript libraries detected on the page.', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class JsLibrariesAudit extends Audit { /** @@ -19,8 +27,8 @@ class JsLibrariesAudit extends Audit { static get meta() { return { id: 'js-libraries', - title: 'Detected JavaScript libraries', - description: 'All front-end JavaScript libraries detected on the page.', + title: str_(UIStrings.title), + description: str_(UIStrings.description), requiredArtifacts: ['Stacks'], }; } @@ -53,3 +61,4 @@ class JsLibrariesAudit extends Audit { } module.exports = JsLibrariesAudit; +module.exports.UIStrings = UIStrings; \ No newline at end of file diff --git a/lighthouse-core/audits/dobetterweb/no-document-write.js b/lighthouse-core/audits/dobetterweb/no-document-write.js index 6dca43f3b1ca..e49c6318918a 100644 --- a/lighthouse-core/audits/dobetterweb/no-document-write.js +++ b/lighthouse-core/audits/dobetterweb/no-document-write.js @@ -11,6 +11,17 @@ 'use strict'; const ViolationAudit = require('../violation-audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Avoids `document.write()`', + failureTitle: 'Uses `document.write()`', + description: 'For users on slow connections, external scripts dynamically injected via ' + + '`document.write()` can delay page load by tens of seconds. ' + + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class NoDocWriteAudit extends ViolationAudit { /** @@ -19,11 +30,9 @@ class NoDocWriteAudit extends ViolationAudit { static get meta() { return { id: 'no-document-write', - title: 'Avoids `document.write()`', - failureTitle: 'Uses `document.write()`', - description: 'For users on slow connections, external scripts dynamically injected via ' + - '`document.write()` can delay page load by tens of seconds. ' + - '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['ConsoleMessages'], }; } @@ -54,3 +63,4 @@ class NoDocWriteAudit extends ViolationAudit { } module.exports = NoDocWriteAudit; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js index 772f9c37e1bb..3efac1ee87d5 100644 --- a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +++ b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js @@ -16,6 +16,23 @@ const Audit = require('../audit.js'); const Sentry = require('../../lib/sentry.js'); const semver = require('semver'); const snykDatabase = require('../../../third-party/snyk/snapshot.json'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Avoids front-end JavaScript libraries' + + ' with known security vulnerabilities', + failureTitle: 'Includes front-end JavaScript libraries' + + ' with known security vulnerabilities', + description: 'Some third-party scripts may contain known security vulnerabilities ' + + 'that are easily identified and exploited by attackers. ' + + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).', + displayValue: `{itemCount, plural, + =1 {1 vulnerability detected} + other {# vulnerabilities detected} + }`, +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); const SEMVER_REGEX = /^(\d+\.\d+\.\d+)[^-0-9]+/; @@ -29,13 +46,9 @@ class NoVulnerableLibrariesAudit extends Audit { static get meta() { return { id: 'no-vulnerable-libraries', - title: 'Avoids front-end JavaScript libraries' - + ' with known security vulnerabilities', - failureTitle: 'Includes front-end JavaScript libraries' - + ' with known security vulnerabilities', - description: 'Some third-party scripts may contain known security vulnerabilities ' + - 'that are easily identified and exploited by attackers. ' + - '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['Stacks'], }; } @@ -179,10 +192,8 @@ class NoVulnerableLibrariesAudit extends Audit { }); let displayValue = ''; - if (totalVulns > 1) { - displayValue = `${totalVulns} vulnerabilities detected`; - } else if (totalVulns === 1) { - displayValue = `${totalVulns} vulnerability detected`; + if (totalVulns > 0) { + displayValue = str_(UIStrings.displayValue,{itemCount: totalVulns}) } /** @type {LH.Audit.Details.Table['headings']} */ @@ -206,3 +217,4 @@ class NoVulnerableLibrariesAudit extends Audit { } module.exports = NoVulnerableLibrariesAudit; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/notification-on-start.js b/lighthouse-core/audits/dobetterweb/notification-on-start.js index cbf73a65c3a0..6ec74a6473cb 100644 --- a/lighthouse-core/audits/dobetterweb/notification-on-start.js +++ b/lighthouse-core/audits/dobetterweb/notification-on-start.js @@ -12,6 +12,17 @@ 'use strict'; const ViolationAudit = require('../violation-audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Avoids requesting the notification permission on page load', + failureTitle: 'Requests the notification permission on page load', + description: 'Users are mistrustful of or confused by sites that request to send ' + + 'notifications without context. Consider tying the request to user gestures ' + + 'instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/notifications-on-load).', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class NotificationOnStart extends ViolationAudit { /** @@ -20,11 +31,9 @@ class NotificationOnStart extends ViolationAudit { static get meta() { return { id: 'notification-on-start', - title: 'Avoids requesting the notification permission on page load', - failureTitle: 'Requests the notification permission on page load', - description: 'Users are mistrustful of or confused by sites that request to send ' + - 'notifications without context. Consider tying the request to user gestures ' + - 'instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/notifications-on-load).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['ConsoleMessages'], }; } @@ -55,3 +64,4 @@ class NotificationOnStart extends ViolationAudit { } module.exports = NotificationOnStart; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js index be42e2a0eb39..adb06c26434b 100644 --- a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +++ b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js @@ -6,6 +6,16 @@ 'use strict'; const Audit = require('../audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Allows users to paste into password fields', + failureTitle: 'Prevents users to paste into password fields', + description: 'Preventing password pasting undermines good security policy. ' + + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/password-pasting).', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class PasswordInputsCanBePastedIntoAudit extends Audit { /** @@ -14,10 +24,9 @@ class PasswordInputsCanBePastedIntoAudit extends Audit { static get meta() { return { id: 'password-inputs-can-be-pasted-into', - title: 'Allows users to paste into password fields', - failureTitle: 'Prevents users to paste into password fields', - description: 'Preventing password pasting undermines good security policy. ' + - '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/password-pasting).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['PasswordInputsWithPreventedPaste'], }; } @@ -53,3 +62,4 @@ class PasswordInputsCanBePastedIntoAudit extends Audit { } module.exports = PasswordInputsCanBePastedIntoAudit; +module.exports.UIStrings = UIStrings; \ No newline at end of file diff --git a/lighthouse-core/audits/dobetterweb/uses-http2.js b/lighthouse-core/audits/dobetterweb/uses-http2.js index 1df6e6f5ee5c..765ced3e0529 100644 --- a/lighthouse-core/audits/dobetterweb/uses-http2.js +++ b/lighthouse-core/audits/dobetterweb/uses-http2.js @@ -15,6 +15,20 @@ const URL = require('../../lib/url-shim.js'); const Audit = require('../audit.js'); const Util = require('../../report/html/renderer/util.js'); const NetworkRecords = require('../../computed/network-records.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Uses HTTP/2 for its own resources', + failureTitle: 'Does not use HTTP/2 for all of its resources', + description: 'HTTP/2 offers many benefits over HTTP/1.1, including binary headers, ' + + 'multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).', + displayValue: `{itemCount, plural, + =1 {1 request not served via HTTP/2} + other {# requests not served via HTTP/2} + }`, +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class UsesHTTP2Audit extends Audit { /** @@ -23,10 +37,9 @@ class UsesHTTP2Audit extends Audit { static get meta() { return { id: 'uses-http2', - title: 'Uses HTTP/2 for its own resources', - failureTitle: 'Does not use HTTP/2 for all of its resources', - description: 'HTTP/2 offers many benefits over HTTP/1.1, including binary headers, ' + - 'multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['URL', 'devtoolsLogs'], }; } @@ -64,11 +77,8 @@ class UsesHTTP2Audit extends Audit { }); let displayValue = ''; - if (resources.length > 1) { - displayValue = - `${Util.formatNumber(resources.length)} requests not served via HTTP/2`; - } else if (resources.length === 1) { - displayValue = `${resources.length} request not served via HTTP/2`; + if (resources.length > 0) { + displayValue = str_(UIStrings.displayValue, {itemCount: resources.length}); } /** @type {LH.Audit.Details.Table['headings']} */ @@ -93,3 +103,4 @@ class UsesHTTP2Audit extends Audit { } module.exports = UsesHTTP2Audit; +module.exports.UIStrings = UIStrings; \ No newline at end of file diff --git a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js index bd53fe587d33..d61bbd2fc101 100644 --- a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +++ b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js @@ -12,6 +12,17 @@ 'use strict'; const ViolationAudit = require('../violation-audit.js'); +const i18n = require('../../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Uses passive listeners to improve scrolling performance', + failureTitle: 'Does not use passive listeners to improve scrolling performance', + description: '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).', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class PassiveEventsAudit extends ViolationAudit { /** @@ -20,11 +31,9 @@ class PassiveEventsAudit extends ViolationAudit { static get meta() { return { id: 'uses-passive-event-listeners', - title: 'Uses passive listeners to improve scrolling performance', - failureTitle: 'Does not use passive listeners to improve scrolling performance', - description: '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).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['ConsoleMessages'], }; } @@ -55,3 +64,4 @@ class PassiveEventsAudit extends ViolationAudit { } module.exports = PassiveEventsAudit; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/errors-in-console.js b/lighthouse-core/audits/errors-in-console.js index c73fb2da935c..f8232bb06399 100644 --- a/lighthouse-core/audits/errors-in-console.js +++ b/lighthouse-core/audits/errors-in-console.js @@ -11,6 +11,16 @@ */ const Audit = require('./audit.js'); +const i18n = require('../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'No browser errors logged to the console', + description: 'Errors logged to the console indicate unresolved problems. ' + + 'They can come from network request failures and other browser concerns.', + failureTitle: 'Browser errors were logged to the console', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); class ErrorLogs extends Audit { /** @@ -19,10 +29,9 @@ class ErrorLogs extends Audit { static get meta() { return { id: 'errors-in-console', - title: 'No browser errors logged to the console', - description: 'Errors logged to the console indicate unresolved problems. ' + - 'They can come from network request failures and other browser concerns.', - failureTitle: 'Browser errors were logged to the console', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['ConsoleMessages', 'RuntimeExceptions'], }; } @@ -78,3 +87,4 @@ class ErrorLogs extends Audit { } module.exports = ErrorLogs; +module.exports.UIStrings = UIStrings; \ No newline at end of file diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index 51791f57d465..ae12cd8c85f3 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -12,8 +12,19 @@ 'use strict'; const Audit = require('./audit.js'); - const URL = require('../lib/url-shim.js'); +const i18n = require('../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Displays images with correct aspect ratio', + failureTitle: 'Displays images with incorrect aspect ratio', + description: 'Image display dimensions should match natural aspect ratio. ' + + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).', + warningCompute: 'Invalid image sizing information {url}', +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); + const THRESHOLD_PX = 2; /** @typedef {Required} WellDefinedImage */ @@ -25,10 +36,9 @@ class ImageAspectRatio extends Audit { static get meta() { return { id: 'image-aspect-ratio', - title: 'Displays images with correct aspect ratio', - failureTitle: 'Displays images with incorrect aspect ratio', - description: 'Image display dimensions should match natural aspect ratio. ' + - '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['ImageElements'], }; } @@ -47,7 +57,7 @@ class ImageAspectRatio extends Audit { if (!Number.isFinite(actualAspectRatio) || !Number.isFinite(displayedAspectRatio)) { - return new Error(`Invalid image sizing information ${url}`); + return new Error(str_(UIStrings.warningCompute,{url})); } return { @@ -113,3 +123,4 @@ class ImageAspectRatio extends Audit { } module.exports = ImageAspectRatio; +module.exports.UIStrings = UIStrings; \ No newline at end of file diff --git a/lighthouse-core/audits/is-on-https.js b/lighthouse-core/audits/is-on-https.js index 98af7bbf5e9b..9967eb6300aa 100644 --- a/lighthouse-core/audits/is-on-https.js +++ b/lighthouse-core/audits/is-on-https.js @@ -9,6 +9,23 @@ const Audit = require('./audit.js'); const URL = require('../lib/url-shim.js'); const Util = require('../report/html/renderer/util.js'); const NetworkRecords = require('../computed/network-records.js'); +const i18n = require('../lib/i18n/i18n.js'); + +const UIStrings = { + title: 'Uses HTTPS', + failureTitle: 'Does not use HTTPS', + description: '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).', + displayValue: `{itemCount, plural, + =1 {1 insecure request found} + other {# insecure requests found} + }`, +}; + +const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); const SECURE_SCHEMES = ['data', 'https', 'wss', 'blob', 'chrome', 'chrome-extension', 'about']; const SECURE_DOMAINS = ['localhost', '127.0.0.1']; @@ -20,13 +37,9 @@ class HTTPS extends Audit { static get meta() { return { id: 'is-on-https', - title: 'Uses HTTPS', - failureTitle: 'Does not use HTTPS', - description: '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).', + title: str_(UIStrings.title), + failureTitle: str_(UIStrings.failureTitle), + description: str_(UIStrings.description), requiredArtifacts: ['devtoolsLogs'], }; } @@ -54,10 +67,8 @@ class HTTPS extends Audit { .map(record => URL.elideDataURI(record.url)); let displayValue = ''; - if (insecureURLs.length > 1) { - displayValue = `${Util.formatNumber(insecureURLs.length)} insecure requests found`; - } else if (insecureURLs.length === 1) { - displayValue = `${insecureURLs.length} insecure request found`; + if (insecureURLs.length > 0) { + displayValue = str_(UIStrings.displayValue, {itemCount: insecureURLs.length}); } const items = Array.from(new Set(insecureURLs)).map(url => ({url})); @@ -80,3 +91,4 @@ class HTTPS extends Audit { } module.exports = HTTPS; +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 33ac027e8e01..87fd392ab2ec 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -94,6 +94,9 @@ const UIStrings = { seoCrawlingGroupTitle: 'Crawling and Indexing', /* Description of the navigation section within the Search Engine Optimization (SEO) category. Within this section are audits with descriptive titles that highlight ways to make a website accessible to search engine crawlers. */ seoCrawlingGroupDescription: 'To appear in search results, crawlers need access to your app.', + + bestPracticesCategoryTitle: 'Best Practices', + /** Title of the Fast and Reliable section of the web app category. Within this section are audits that check if the web site loaded quickly and can reliably load even if the internet connection is very slow or goes offline. */ pwaFastReliableGroupTitle: 'Fast and reliable', /** Title of the Installable section of the web app category. Within this section are audits that check if Chrome supports installing the web site as an app on their device. */ @@ -461,7 +464,7 @@ const defaultConfig = { ], }, 'best-practices': { - title: 'Best Practices', + title: str_(UIStrings.bestPracticesCategoryTitle), auditRefs: [ {id: 'appcache-manifest', weight: 1}, {id: 'is-on-https', weight: 1}, diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index adfc34c8fa21..c95b0461436b 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -599,6 +599,66 @@ "message": "Minimize Critical Requests Depth", "description": "Imperative title of a Lighthouse audit that tells the user to reduce the depth of critical network requests to enhance initial load of a page. Critical request chains are series of dependent network requests that are important for page rendering. For example, here's a 4-request-deep chain: The biglogo.jpg image is required, but is requested via the styles.css style code, which is requested by the initialize.js javascript, which is requested by the page's HTML. This is displayed in a list of audit titles that Lighthouse generates." }, + "lighthouse-core/audits/deprecations.js | description": { + "message": "Deprecated APIs will eventually be removed from the browser. [Learn more](https://www.chromestatus.com/features#deprecated).", + "description": "" + }, + "lighthouse-core/audits/deprecations.js | displayValue": { + "message": "{itemCount, plural,\n =1 {1 warning found}\n other {# warnings found}\n }", + "description": "" + }, + "lighthouse-core/audits/deprecations.js | failureTitle": { + "message": "Uses deprecated APIs", + "description": "" + }, + "lighthouse-core/audits/deprecations.js | title": { + "message": "Avoids deprecated APIs", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/appcache-manifest.js | description": { + "message": "Application Cache is deprecated. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/appcache).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/appcache-manifest.js | displayValue": { + "message": "Found \"{AppCacheManifest}\"", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/appcache-manifest.js | failureTitle": { + "message": "Uses Application Cache", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/appcache-manifest.js | title": { + "message": "Avoids Application Cache", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/doctype.js | description": { + "message": "Specifying a doctype prevents the browser from switching to quirks-mode. Read more on the [MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/doctype.js | explanationBadDoctype": { + "message": "Doctype name must be the lowercase string `html`", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/doctype.js | explanationNoDoctype": { + "message": "Document must contain a doctype", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/doctype.js | explanationPublicId": { + "message": "Expected publicId to be an empty string", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/doctype.js | explanationSystemId": { + "message": "Expected systemId to be an empty string", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/doctype.js | failureTitle": { + "message": "Page is missing the HTML doctype", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/doctype.js | title": { + "message": "Page has the HTML doctype", + "description": "" + }, "lighthouse-core/audits/dobetterweb/dom-size.js | columnElement": { "message": "Element", "description": "Table column header for the DOM element. Each DOM element is described with its HTML representation." @@ -639,6 +699,134 @@ "message": "Avoids an excessive DOM size", "description": "Title of a diagnostic audit that provides detail on the size of the web page's DOM. The size of a DOM is characterized by the total number of DOM elements and greatest DOM depth. This descriptive title is shown to users when the amount is acceptable and no user action is required." }, + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | description": { + "message": "Add `rel=\"noopener\"` or `rel=\"noreferrer\"` to any external links to improve performance and prevent security vulnerabilities. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | failureTitle": { + "message": "Links to cross-origin destinations are unsafe", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | title": { + "message": "Links to cross-origin destinations are safe", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | warning": { + "message": "Unable to determine the destination for anchor ({anchorHTML}). If not used as a hyperlink, consider removing target=_blank.", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | description": { + "message": "Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to user gestures instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | failureTitle": { + "message": "Requests the geolocation permission on page load", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | title": { + "message": "Avoids requesting the geolocation permission on page load", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/js-libraries.js | description": { + "message": "All front-end JavaScript libraries detected on the page.", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/js-libraries.js | title": { + "message": "Detected JavaScript libraries", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-document-write.js | description": { + "message": "For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-document-write.js | failureTitle": { + "message": "Uses `document.write()`", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-document-write.js | title": { + "message": "Avoids `document.write()`", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | description": { + "message": "Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | displayValue": { + "message": "{itemCount, plural,\n =1 {1 vulnerability detected}\n other {# vulnerabilities detected}\n }", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | failureTitle": { + "message": "Includes front-end JavaScript libraries with known security vulnerabilities", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | title": { + "message": "Avoids front-end JavaScript libraries with known security vulnerabilities", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/notification-on-start.js | description": { + "message": "Users are mistrustful of or confused by sites that request to send notifications without context. Consider tying the request to user gestures instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/notifications-on-load).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/notification-on-start.js | failureTitle": { + "message": "Requests the notification permission on page load", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/notification-on-start.js | title": { + "message": "Avoids requesting the notification permission on page load", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | description": { + "message": "Preventing password pasting undermines good security policy. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/password-pasting).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | failureTitle": { + "message": "Prevents users to paste into password fields", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | title": { + "message": "Allows users to paste into password fields", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/uses-http2.js | description": { + "message": "HTTP/2 offers many benefits over HTTP/1.1, including binary headers, multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/uses-http2.js | displayValue": { + "message": "{itemCount, plural,\n =1 {1 request not served via HTTP/2}\n other {# requests not served via HTTP/2}\n }", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/uses-http2.js | failureTitle": { + "message": "Does not use HTTP/2 for all of its resources", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/uses-http2.js | title": { + "message": "Uses HTTP/2 for its own resources", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | description": { + "message": "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).", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | failureTitle": { + "message": "Does not use passive listeners to improve scrolling performance", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | title": { + "message": "Uses passive listeners to improve scrolling performance", + "description": "" + }, + "lighthouse-core/audits/errors-in-console.js | description": { + "message": "Errors logged to the console indicate unresolved problems. They can come from network request failures and other browser concerns.", + "description": "" + }, + "lighthouse-core/audits/errors-in-console.js | failureTitle": { + "message": "Browser errors were logged to the console", + "description": "" + }, + "lighthouse-core/audits/errors-in-console.js | title": { + "message": "No browser errors logged to the console", + "description": "" + }, "lighthouse-core/audits/font-display.js | description": { "message": "Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. [Learn more](https://developers.google.com/web/updates/2016/02/font-display).", "description": "Description of a Lighthouse audit that tells the user *why* they should use the font-display CSS feature. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." @@ -651,6 +839,38 @@ "message": "All text remains visible during webfont loads", "description": "Title of a diagnostic audit that provides detail on if all the text on a webpage was visible while the page was loading its webfonts. This descriptive title is shown to users when the amount is acceptable and no user action is required." }, + "lighthouse-core/audits/image-aspect-ratio.js | description": { + "message": "Image display dimensions should match natural aspect ratio. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).", + "description": "" + }, + "lighthouse-core/audits/image-aspect-ratio.js | failureTitle": { + "message": "Displays images with incorrect aspect ratio", + "description": "" + }, + "lighthouse-core/audits/image-aspect-ratio.js | title": { + "message": "Displays images with correct aspect ratio", + "description": "" + }, + "lighthouse-core/audits/image-aspect-ratio.js | warningCompute": { + "message": "Invalid image sizing information {url}", + "description": "" + }, + "lighthouse-core/audits/is-on-https.js | description": { + "message": "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).", + "description": "" + }, + "lighthouse-core/audits/is-on-https.js | displayValue": { + "message": "{itemCount, plural,\n =1 {1 insecure request found}\n other {# insecure requests found}\n }", + "description": "" + }, + "lighthouse-core/audits/is-on-https.js | failureTitle": { + "message": "Does not use HTTPS", + "description": "" + }, + "lighthouse-core/audits/is-on-https.js | title": { + "message": "Uses HTTPS", + "description": "" + }, "lighthouse-core/audits/load-fast-enough-for-pwa.js | description": { "message": "A fast page load over a cellular network ensures a good mobile user experience. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/fast-3g).", "description": "Description of a Lighthouse audit that tells the user *why* they need to load fast enough on mobile networks. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." @@ -1143,6 +1363,10 @@ "message": "Tables and lists", "description": "Title of the navigation section within the Accessibility category. Within this section are audits with descriptive titles that highlight opportunities to improve the experience of reading tabular or list data using assistive technology." }, + "lighthouse-core/config/default-config.js | bestPracticesCategoryTitle": { + "message": "Best Practices", + "description": "" + }, "lighthouse-core/config/default-config.js | budgetsGroupDescription": { "message": "Performance budgets set standards for the performance of your site.", "description": "Description of the Budgets section of the Performance category. Within this section the budget results are displayed." diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 76532a9e9b2a..7849a42d1e0c 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -2581,7 +2581,7 @@ "doctype": { "id": "doctype", "title": "Page has the HTML doctype", - "description": "Specifying a doctype prevents the browser from switching to quirks-mode.Read more on the [MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)", + "description": "Specifying a doctype prevents the browser from switching to quirks-mode. Read more on the [MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)", "score": 1, "scoreDisplayMode": "binary" }, @@ -5028,6 +5028,20 @@ "warningHeader": "Warnings: " }, "icuMessagePaths": { + "lighthouse-core/audits/is-on-https.js | failureTitle": [ + "audits[is-on-https].title" + ], + "lighthouse-core/audits/is-on-https.js | description": [ + "audits[is-on-https].description" + ], + "lighthouse-core/audits/is-on-https.js | displayValue": [ + { + "values": { + "itemCount": 1 + }, + "path": "audits[is-on-https].displayValue" + } + ], "lighthouse-core/audits/metrics/first-contentful-paint.js | title": [ "audits[first-contentful-paint].title" ], @@ -5134,6 +5148,12 @@ "lighthouse-core/audits/metrics/max-potential-fid.js | description": [ "audits[max-potential-fid].description" ], + "lighthouse-core/audits/errors-in-console.js | failureTitle": [ + "audits[errors-in-console].title" + ], + "lighthouse-core/audits/errors-in-console.js | description": [ + "audits[errors-in-console].description" + ], "lighthouse-core/audits/time-to-first-byte.js | title": [ "audits[time-to-first-byte].title" ], @@ -5192,6 +5212,26 @@ "lighthouse-core/audits/apple-touch-icon.js | description": [ "audits[apple-touch-icon].description" ], + "lighthouse-core/audits/image-aspect-ratio.js | failureTitle": [ + "audits[image-aspect-ratio].title" + ], + "lighthouse-core/audits/image-aspect-ratio.js | description": [ + "audits[image-aspect-ratio].description" + ], + "lighthouse-core/audits/deprecations.js | failureTitle": [ + "audits.deprecations.title" + ], + "lighthouse-core/audits/deprecations.js | description": [ + "audits.deprecations.description" + ], + "lighthouse-core/audits/deprecations.js | displayValue": [ + { + "values": { + "itemCount": 3 + }, + "path": "audits.deprecations.displayValue" + } + ], "lighthouse-core/audits/mainthread-work-breakdown.js | title": [ "audits[mainthread-work-breakdown].title" ], @@ -5703,6 +5743,26 @@ "lighthouse-core/audits/byte-efficiency/efficient-animated-content.js | description": [ "audits[efficient-animated-content].description" ], + "lighthouse-core/audits/dobetterweb/appcache-manifest.js | failureTitle": [ + "audits[appcache-manifest].title" + ], + "lighthouse-core/audits/dobetterweb/appcache-manifest.js | description": [ + "audits[appcache-manifest].description" + ], + "lighthouse-core/audits/dobetterweb/appcache-manifest.js | displayValue": [ + { + "values": { + "AppCacheManifest": "clock.appcache" + }, + "path": "audits[appcache-manifest].displayValue" + } + ], + "lighthouse-core/audits/dobetterweb/doctype.js | title": [ + "audits.doctype.title" + ], + "lighthouse-core/audits/dobetterweb/doctype.js | description": [ + "audits.doctype.description" + ], "lighthouse-core/audits/dobetterweb/dom-size.js | title": [ "audits[dom-size].title" ], @@ -5735,6 +5795,84 @@ "lighthouse-core/audits/dobetterweb/dom-size.js | statisticDOMWidth": [ "audits[dom-size].details.items[2].statistic" ], + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | failureTitle": [ + "audits[external-anchors-use-rel-noopener].title" + ], + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | description": [ + "audits[external-anchors-use-rel-noopener].description" + ], + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | warning": [ + { + "values": { + "anchorHTML": "Hello" + }, + "path": "audits[external-anchors-use-rel-noopener].warnings[0]" + } + ], + "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | failureTitle": [ + "audits[geolocation-on-start].title" + ], + "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | description": [ + "audits[geolocation-on-start].description" + ], + "lighthouse-core/audits/dobetterweb/no-document-write.js | failureTitle": [ + "audits[no-document-write].title" + ], + "lighthouse-core/audits/dobetterweb/no-document-write.js | description": [ + "audits[no-document-write].description" + ], + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | failureTitle": [ + "audits[no-vulnerable-libraries].title" + ], + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | description": [ + "audits[no-vulnerable-libraries].description" + ], + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | displayValue": [ + { + "values": { + "itemCount": 2 + }, + "path": "audits[no-vulnerable-libraries].displayValue" + } + ], + "lighthouse-core/audits/dobetterweb/js-libraries.js | title": [ + "audits[js-libraries].title" + ], + "lighthouse-core/audits/dobetterweb/js-libraries.js | description": [ + "audits[js-libraries].description" + ], + "lighthouse-core/audits/dobetterweb/notification-on-start.js | failureTitle": [ + "audits[notification-on-start].title" + ], + "lighthouse-core/audits/dobetterweb/notification-on-start.js | description": [ + "audits[notification-on-start].description" + ], + "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | failureTitle": [ + "audits[password-inputs-can-be-pasted-into].title" + ], + "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | description": [ + "audits[password-inputs-can-be-pasted-into].description" + ], + "lighthouse-core/audits/dobetterweb/uses-http2.js | failureTitle": [ + "audits[uses-http2].title" + ], + "lighthouse-core/audits/dobetterweb/uses-http2.js | description": [ + "audits[uses-http2].description" + ], + "lighthouse-core/audits/dobetterweb/uses-http2.js | displayValue": [ + { + "values": { + "itemCount": 15 + }, + "path": "audits[uses-http2].displayValue" + } + ], + "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | failureTitle": [ + "audits[uses-passive-event-listeners].title" + ], + "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | description": [ + "audits[uses-passive-event-listeners].description" + ], "lighthouse-core/audits/seo/meta-description.js | failureTitle": [ "audits[meta-description].title" ], @@ -5835,6 +5973,9 @@ "lighthouse-core/config/default-config.js | a11yCategoryManualDescription": [ "categories.accessibility.manualDescription" ], + "lighthouse-core/config/default-config.js | bestPracticesCategoryTitle": [ + "categories[best-practices].title" + ], "lighthouse-core/config/default-config.js | seoCategoryTitle": [ "categories.seo.title" ], diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json index f0f16a4de298..ccb1d9e8abd8 100644 --- a/proto/sample_v2_round_trip.json +++ b/proto/sample_v2_round_trip.json @@ -483,7 +483,7 @@ "title": "Definition list items are wrapped in `
` elements" }, "doctype": { - "description": "Specifying a doctype prevents the browser from switching to quirks-mode.Read more on the [MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)", + "description": "Specifying a doctype prevents the browser from switching to quirks-mode. Read more on the [MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)", "id": "doctype", "score": 1.0, "scoreDisplayMode": "binary", From cb8482108b9c6c3ce8c9703832b9f610d32a6ea8 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 31 May 2019 00:31:59 -0700 Subject: [PATCH 02/12] linting --- lighthouse-core/audits/deprecations.js | 1 - lighthouse-core/audits/dobetterweb/appcache-manifest.js | 4 ++-- lighthouse-core/audits/dobetterweb/doctype.js | 2 +- .../audits/dobetterweb/external-anchors-use-rel-noopener.js | 6 +++--- lighthouse-core/audits/dobetterweb/js-libraries.js | 2 +- .../audits/dobetterweb/no-vulnerable-libraries.js | 2 +- .../dobetterweb/password-inputs-can-be-pasted-into.js | 2 +- lighthouse-core/audits/dobetterweb/uses-http2.js | 3 +-- lighthouse-core/audits/errors-in-console.js | 2 +- lighthouse-core/audits/image-aspect-ratio.js | 4 ++-- lighthouse-core/audits/is-on-https.js | 1 - lighthouse-core/config/default-config.js | 2 -- 12 files changed, 13 insertions(+), 18 deletions(-) diff --git a/lighthouse-core/audits/deprecations.js b/lighthouse-core/audits/deprecations.js index 1e20e92b0ef2..0520740b30a1 100644 --- a/lighthouse-core/audits/deprecations.js +++ b/lighthouse-core/audits/deprecations.js @@ -12,7 +12,6 @@ */ const Audit = require('./audit.js'); -const Util = require('../report/html/renderer/util.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { diff --git a/lighthouse-core/audits/dobetterweb/appcache-manifest.js b/lighthouse-core/audits/dobetterweb/appcache-manifest.js index 204ef9a28d8c..9eb0536e4f2e 100644 --- a/lighthouse-core/audits/dobetterweb/appcache-manifest.js +++ b/lighthouse-core/audits/dobetterweb/appcache-manifest.js @@ -18,7 +18,7 @@ const UIStrings = { failureTitle: 'Uses Application Cache', description: 'Application Cache is deprecated. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/appcache).', - displayValue: 'Found "{AppCacheManifest}"' + displayValue: 'Found "{AppCacheManifest}"', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -44,7 +44,7 @@ class AppCacheManifestAttr extends Audit { static audit(artifacts) { const usingAppcache = artifacts.AppCacheManifest !== null; const displayValue = usingAppcache ? - str_(UIStrings.displayValue, {AppCacheManifest: artifacts.AppCacheManifest}): ''; + str_(UIStrings.displayValue, {AppCacheManifest: artifacts.AppCacheManifest}) : ''; return { score: usingAppcache ? 0 : 1, diff --git a/lighthouse-core/audits/dobetterweb/doctype.js b/lighthouse-core/audits/dobetterweb/doctype.js index 31af3ebf15ce..c08320c4d479 100644 --- a/lighthouse-core/audits/dobetterweb/doctype.js +++ b/lighthouse-core/audits/dobetterweb/doctype.js @@ -11,7 +11,7 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { title: 'Page has the HTML doctype', failureTitle: 'Page is missing the HTML doctype', - description: 'Specifying a doctype prevents the browser ' + + description: 'Specifying a doctype prevents the browser ' + 'from switching to quirks-mode. Read more on the ' + '[MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)', explanationNoDoctype: 'Document must contain a doctype', diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index aff9361ebb37..e145538dc3a2 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -15,8 +15,8 @@ const UIStrings = { description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + 'performance and prevent security vulnerabilities. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).', - warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' + - 'If not used as a hyperlink, consider removing target=_blank.' + warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' + + 'If not used as a hyperlink, consider removing target=_blank.', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -51,7 +51,7 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit { try { return new URL(anchor.href).host !== pageHost; } catch (err) { - warnings.push(str_(UIStrings.warning,{anchorHTML: anchor.outerHTML})); + warnings.push(str_(UIStrings.warning, {anchorHTML: anchor.outerHTML})); return true; } }) diff --git a/lighthouse-core/audits/dobetterweb/js-libraries.js b/lighthouse-core/audits/dobetterweb/js-libraries.js index 79e3afe201e0..9da211cbe63e 100644 --- a/lighthouse-core/audits/dobetterweb/js-libraries.js +++ b/lighthouse-core/audits/dobetterweb/js-libraries.js @@ -61,4 +61,4 @@ class JsLibrariesAudit extends Audit { } module.exports = JsLibrariesAudit; -module.exports.UIStrings = UIStrings; \ No newline at end of file +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js index 3efac1ee87d5..cf9f588679b7 100644 --- a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +++ b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js @@ -193,7 +193,7 @@ class NoVulnerableLibrariesAudit extends Audit { let displayValue = ''; if (totalVulns > 0) { - displayValue = str_(UIStrings.displayValue,{itemCount: totalVulns}) + displayValue = str_(UIStrings.displayValue, {itemCount: totalVulns}); } /** @type {LH.Audit.Details.Table['headings']} */ diff --git a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js index adb06c26434b..a61af0608cf8 100644 --- a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +++ b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js @@ -62,4 +62,4 @@ class PasswordInputsCanBePastedIntoAudit extends Audit { } module.exports = PasswordInputsCanBePastedIntoAudit; -module.exports.UIStrings = UIStrings; \ No newline at end of file +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/dobetterweb/uses-http2.js b/lighthouse-core/audits/dobetterweb/uses-http2.js index 765ced3e0529..65650bc33f74 100644 --- a/lighthouse-core/audits/dobetterweb/uses-http2.js +++ b/lighthouse-core/audits/dobetterweb/uses-http2.js @@ -13,7 +13,6 @@ const URL = require('../../lib/url-shim.js'); const Audit = require('../audit.js'); -const Util = require('../../report/html/renderer/util.js'); const NetworkRecords = require('../../computed/network-records.js'); const i18n = require('../../lib/i18n/i18n.js'); @@ -103,4 +102,4 @@ class UsesHTTP2Audit extends Audit { } module.exports = UsesHTTP2Audit; -module.exports.UIStrings = UIStrings; \ No newline at end of file +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/errors-in-console.js b/lighthouse-core/audits/errors-in-console.js index f8232bb06399..3351761ae816 100644 --- a/lighthouse-core/audits/errors-in-console.js +++ b/lighthouse-core/audits/errors-in-console.js @@ -87,4 +87,4 @@ class ErrorLogs extends Audit { } module.exports = ErrorLogs; -module.exports.UIStrings = UIStrings; \ No newline at end of file +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index ae12cd8c85f3..54e05e3fa0bc 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -57,7 +57,7 @@ class ImageAspectRatio extends Audit { if (!Number.isFinite(actualAspectRatio) || !Number.isFinite(displayedAspectRatio)) { - return new Error(str_(UIStrings.warningCompute,{url})); + return new Error(str_(UIStrings.warningCompute, {url})); } return { @@ -123,4 +123,4 @@ class ImageAspectRatio extends Audit { } module.exports = ImageAspectRatio; -module.exports.UIStrings = UIStrings; \ No newline at end of file +module.exports.UIStrings = UIStrings; diff --git a/lighthouse-core/audits/is-on-https.js b/lighthouse-core/audits/is-on-https.js index 9967eb6300aa..879ec868c9f1 100644 --- a/lighthouse-core/audits/is-on-https.js +++ b/lighthouse-core/audits/is-on-https.js @@ -7,7 +7,6 @@ const Audit = require('./audit.js'); const URL = require('../lib/url-shim.js'); -const Util = require('../report/html/renderer/util.js'); const NetworkRecords = require('../computed/network-records.js'); const i18n = require('../lib/i18n/i18n.js'); diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 87fd392ab2ec..0d58e61c8692 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -94,9 +94,7 @@ const UIStrings = { seoCrawlingGroupTitle: 'Crawling and Indexing', /* Description of the navigation section within the Search Engine Optimization (SEO) category. Within this section are audits with descriptive titles that highlight ways to make a website accessible to search engine crawlers. */ seoCrawlingGroupDescription: 'To appear in search results, crawlers need access to your app.', - bestPracticesCategoryTitle: 'Best Practices', - /** Title of the Fast and Reliable section of the web app category. Within this section are audits that check if the web site loaded quickly and can reliably load even if the internet connection is very slow or goes offline. */ pwaFastReliableGroupTitle: 'Fast and reliable', /** Title of the Installable section of the web app category. Within this section are audits that check if Chrome supports installing the web site as an app on their device. */ From f2c45c0d0127caea92b24b13fdcf9f2830f3d573 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 31 May 2019 10:58:39 -0700 Subject: [PATCH 03/12] Fix tests, fix off-by-one error in is-on-https --- lighthouse-core/audits/is-on-https.js | 8 ++++---- lighthouse-core/test/audits/deprecations-test.js | 4 ++-- .../test/audits/dobetterweb/doctype-test.js | 12 +++++++----- .../test/audits/dobetterweb/uses-http2-test.js | 6 +++--- lighthouse-core/test/audits/is-on-https-test.js | 4 ++-- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/lighthouse-core/audits/is-on-https.js b/lighthouse-core/audits/is-on-https.js index 879ec868c9f1..02bc42f1a266 100644 --- a/lighthouse-core/audits/is-on-https.js +++ b/lighthouse-core/audits/is-on-https.js @@ -65,13 +65,13 @@ class HTTPS extends Audit { .filter(record => !HTTPS.isSecureRecord(record)) .map(record => URL.elideDataURI(record.url)); + const items = Array.from(new Set(insecureURLs)).map(url => ({url})); + let displayValue = ''; - if (insecureURLs.length > 0) { - displayValue = str_(UIStrings.displayValue, {itemCount: insecureURLs.length}); + if (items.length > 0) { + displayValue = str_(UIStrings.displayValue, {itemCount: items.length}); } - const items = Array.from(new Set(insecureURLs)).map(url => ({url})); - /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ {key: 'url', itemType: 'url', text: 'Insecure URL'}, diff --git a/lighthouse-core/test/audits/deprecations-test.js b/lighthouse-core/test/audits/deprecations-test.js index 2fbb0b8b523f..ab51ae8a1a62 100644 --- a/lighthouse-core/test/audits/deprecations-test.js +++ b/lighthouse-core/test/audits/deprecations-test.js @@ -31,7 +31,7 @@ describe('Console deprecations audit', () => { ], }); assert.equal(auditResult.score, 0); - assert.equal(auditResult.displayValue, '1 warning found'); + expect(auditResult.displayValue).toBeDisplayString('1 warning found'); assert.equal(auditResult.details.items.length, 1); assert.equal(auditResult.details.items[0].url, ''); assert.equal(auditResult.details.items[0].lineNumber, undefined); @@ -67,7 +67,7 @@ describe('Console deprecations audit', () => { ], }); assert.equal(auditResult.score, 0); - assert.equal(auditResult.displayValue, '2 warnings found'); + expect(auditResult.displayValue).toBeDisplayString('2 warnings found'); assert.equal(auditResult.details.items.length, 2); assert.equal(auditResult.details.items[0].url, URL); assert.equal(auditResult.details.items[0].lineNumber, 123); diff --git a/lighthouse-core/test/audits/dobetterweb/doctype-test.js b/lighthouse-core/test/audits/dobetterweb/doctype-test.js index 1c3479617e20..71d386e7bcba 100644 --- a/lighthouse-core/test/audits/dobetterweb/doctype-test.js +++ b/lighthouse-core/test/audits/dobetterweb/doctype-test.js @@ -16,7 +16,7 @@ describe('DOBETTERWEB: doctype audit', () => { Doctype: null, }); assert.equal(auditResult.score, 0); - assert.equal(auditResult.explanation, 'Document must contain a doctype'); + expect(auditResult.explanation).toBeDisplayString('Document must contain a doctype'); }); it('fails when the value of the name attribute is a value other then lowercase "html"', () => { @@ -28,7 +28,8 @@ describe('DOBETTERWEB: doctype audit', () => { }, }); assert.equal(auditResult.score, 0); - assert.equal(auditResult.explanation, 'Doctype name must be the lowercase string `html`'); + expect(auditResult.explanation).toBeDisplayString( + 'Doctype name must be the lowercase string `html`'); }); it('fails when the value of the name attribute is not the lowercase string "html"', () => { @@ -40,7 +41,8 @@ describe('DOBETTERWEB: doctype audit', () => { }, }); assert.equal(auditResult.score, 0); - assert.equal(auditResult.explanation, 'Doctype name must be the lowercase string `html`'); + expect(auditResult.explanation).toBeDisplayString( + 'Doctype name must be the lowercase string `html`'); }); it('fails when the publicId attribute is not an empty string', () => { @@ -52,7 +54,7 @@ describe('DOBETTERWEB: doctype audit', () => { }, }); assert.equal(auditResult.score, 0); - assert.equal(auditResult.explanation, 'Expected publicId to be an empty string'); + expect(auditResult.explanation).toBeDisplayString('Expected publicId to be an empty string'); }); it('fails when the systemId attribute is not an empty string', () => { @@ -64,7 +66,7 @@ describe('DOBETTERWEB: doctype audit', () => { }, }); assert.equal(auditResult.score, 0); - assert.equal(auditResult.explanation, 'Expected systemId to be an empty string'); + expect(auditResult.explanation).toBeDisplayString('Expected systemId to be an empty string'); }); it('succeeds when document contains a doctype, and the name value is "html"', () => { diff --git a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js index 3e4f51565d85..1a03e5a6f8dd 100644 --- a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js +++ b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js @@ -29,7 +29,7 @@ describe('Resources are fetched over http/2', () => { return UsesHTTP2Audit.audit(getArtifacts(networkRecords, URL), {computedCache: new Map()}).then( auditResult => { assert.equal(auditResult.score, 0); - assert.ok(auditResult.displayValue.match('3 requests not')); + expect(auditResult.displayValue).toBeDisplayString('3 requests not served via HTTP/2'); assert.equal(auditResult.details.items.length, 3); assert.equal( auditResult.details.items[0].url, @@ -46,7 +46,7 @@ describe('Resources are fetched over http/2', () => { const entryWithHTTP1 = networkRecords.slice(1, 2); return UsesHTTP2Audit.audit(getArtifacts(entryWithHTTP1, URL), {computedCache: new Map()}).then( auditResult => { - assert.ok(auditResult.displayValue.match('1 request not')); + expect(auditResult.displayValue).toBeDisplayString('1 request not served via HTTP/2'); } ); }); @@ -78,7 +78,7 @@ describe('Resources are fetched over http/2', () => { computedCache: new Map(), }).then(auditResult => { assert.equal(auditResult.score, 0); - assert.ok(auditResult.displayValue.match('1 request not')); + expect(auditResult.displayValue).toBeDisplayString('1 request not served via HTTP/2'); // Protocol is http/1.0 which we don't mark as fetched fetchedViaServiceWorker on line 73. assert.equal( auditResult.details.items[0].url, diff --git a/lighthouse-core/test/audits/is-on-https-test.js b/lighthouse-core/test/audits/is-on-https-test.js index d53717d89749..7bdc837eb9ea 100644 --- a/lighthouse-core/test/audits/is-on-https-test.js +++ b/lighthouse-core/test/audits/is-on-https-test.js @@ -28,7 +28,7 @@ describe('Security: HTTPS audit', () => { {url: 'https://google.com/', parsedURL: {scheme: 'https', host: 'google.com'}}, ]), {computedCache: new Map()}).then(result => { assert.strictEqual(result.score, 0); - assert.ok(result.displayValue.includes('requests found')); + expect(result.displayValue).toBeDisplayString('2 insecure requests found'); assert.strictEqual(result.extendedInfo.value.length, 2); }); }); @@ -40,7 +40,7 @@ describe('Security: HTTPS audit', () => { {url: 'https://google.com/', parsedURL: {scheme: 'https', host: 'google.com'}}, ]), {computedCache: new Map()}).then(result => { assert.strictEqual(result.score, 0); - assert.ok(result.displayValue.includes('request found')); + expect(result.displayValue).toBeDisplayString('1 insecure request found'); assert.deepEqual(result.extendedInfo.value[0], {url: 'http://insecure.com/image.jpeg'}); }); }); From 69d3c39d171267feb69d7f1bf026ddd243b8ee92 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 31 May 2019 11:24:58 -0700 Subject: [PATCH 04/12] Update table headers. --- lighthouse-core/audits/deprecations.js | 8 +- .../external-anchors-use-rel-noopener.js | 8 +- .../dobetterweb/geolocation-on-start.js | 4 +- .../audits/dobetterweb/js-libraries.js | 6 +- .../audits/dobetterweb/no-document-write.js | 4 +- .../dobetterweb/no-vulnerable-libraries.js | 9 +- .../dobetterweb/notification-on-start.js | 4 +- .../password-inputs-can-be-pasted-into.js | 3 +- .../audits/dobetterweb/uses-http2.js | 5 +- .../uses-passive-event-listeners.js | 4 +- lighthouse-core/audits/errors-in-console.js | 5 +- lighthouse-core/audits/image-aspect-ratio.js | 8 +- lighthouse-core/audits/is-on-https.js | 3 +- lighthouse-core/lib/i18n/en-US.json | 64 +++++++++++++++ lighthouse-core/lib/i18n/i18n.js | 1 + lighthouse-core/test/results/sample_v2.json | 82 ++++++++++++++++--- 16 files changed, 179 insertions(+), 39 deletions(-) diff --git a/lighthouse-core/audits/deprecations.js b/lighthouse-core/audits/deprecations.js index 0520740b30a1..883ab3baf620 100644 --- a/lighthouse-core/audits/deprecations.js +++ b/lighthouse-core/audits/deprecations.js @@ -23,6 +23,8 @@ const UIStrings = { =1 {1 warning found} other {# warnings found} }`, + columnDeprecate: 'Deprecation / Warning', + columnLine: 'Line', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -59,9 +61,9 @@ class Deprecations extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'value', itemType: 'code', text: 'Deprecation / Warning'}, - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'lineNumber', itemType: 'text', text: 'Line'}, + {key: 'value', itemType: 'code', text: str_(UIStrings.columnDeprecate)}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'lineNumber', itemType: 'text', text: str_(UIStrings.columnLine)}, ]; const details = Audit.makeTableDetails(headings, deprecations); diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index e145538dc3a2..3a5cb7b234b9 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -17,6 +17,8 @@ const UIStrings = { '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).', warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' + 'If not used as a hyperlink, consider removing target=_blank.', + columnTarget: 'Target', + columnRel: 'Rel', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -69,9 +71,9 @@ class ExternalAnchorsUseRelNoopenerAudit extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'href', itemType: 'url', text: 'URL'}, - {key: 'target', itemType: 'text', text: 'Target'}, - {key: 'rel', itemType: 'text', text: 'Rel'}, + {key: 'href', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'target', itemType: 'text', text: str_(UIStrings.columnTarget)}, + {key: 'rel', itemType: 'text', text: str_(UIStrings.columnRel)}, ]; const details = Audit.makeTableDetails(headings, failingAnchors); diff --git a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js index cf4aa61504b2..d17bd2398fb1 100644 --- a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +++ b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js @@ -48,8 +48,8 @@ class GeolocationOnStart extends ViolationAudit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'label', itemType: 'text', text: 'Location'}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'label', itemType: 'text', text: str_(i18n.UIStrings.columnLocation)}, ]; // TODO(bckenny): there should actually be a ts error here. results[0].stackTrace // should violate the results type. Shouldn't be removed from details items regardless. diff --git a/lighthouse-core/audits/dobetterweb/js-libraries.js b/lighthouse-core/audits/dobetterweb/js-libraries.js index 9da211cbe63e..5342f39a7b75 100644 --- a/lighthouse-core/audits/dobetterweb/js-libraries.js +++ b/lighthouse-core/audits/dobetterweb/js-libraries.js @@ -16,6 +16,8 @@ const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { title: 'Detected JavaScript libraries', description: 'All front-end JavaScript libraries detected on the page.', + columnName: 'Name', + columnVersion: 'Version', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -48,8 +50,8 @@ class JsLibrariesAudit extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'name', itemType: 'text', text: 'Name'}, - {key: 'version', itemType: 'text', text: 'Version'}, + {key: 'name', itemType: 'text', text: str_(UIStrings.columnName)}, + {key: 'version', itemType: 'text', text: str_(UIStrings.columnVersion)}, ]; const details = Audit.makeTableDetails(headings, libDetails, {}); diff --git a/lighthouse-core/audits/dobetterweb/no-document-write.js b/lighthouse-core/audits/dobetterweb/no-document-write.js index e49c6318918a..defd9749daa3 100644 --- a/lighthouse-core/audits/dobetterweb/no-document-write.js +++ b/lighthouse-core/audits/dobetterweb/no-document-write.js @@ -46,8 +46,8 @@ class NoDocWriteAudit extends ViolationAudit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'label', itemType: 'text', text: 'Location'}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'label', itemType: 'text', text: str_(i18n.UIStrings.columnLocation)}, ]; // TODO(bckenny): see TODO in geolocation-on-start const details = ViolationAudit.makeTableDetails(headings, results); diff --git a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js index cf9f588679b7..ad2b73e57c73 100644 --- a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +++ b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js @@ -30,6 +30,9 @@ const UIStrings = { =1 {1 vulnerability detected} other {# vulnerabilities detected} }`, + columnVersion: 'Library Version', + columnVuln: 'Vulnerability Count', + columnSeverity: 'Highest Severity', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -198,9 +201,9 @@ class NoVulnerableLibrariesAudit extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'detectedLib', itemType: 'link', text: 'Library Version'}, - {key: 'vulnCount', itemType: 'text', text: 'Vulnerability Count'}, - {key: 'highestSeverity', itemType: 'text', text: 'Highest Severity'}, + {key: 'detectedLib', itemType: 'link', text: str_(UIStrings.columnVersion)}, + {key: 'vulnCount', itemType: 'text', text: str_(UIStrings.columnVuln)}, + {key: 'highestSeverity', itemType: 'text', text: str_(UIStrings.columnSeverity)}, ]; const details = Audit.makeTableDetails(headings, vulnerabilityResults, {}); diff --git a/lighthouse-core/audits/dobetterweb/notification-on-start.js b/lighthouse-core/audits/dobetterweb/notification-on-start.js index 6ec74a6473cb..959ad6993665 100644 --- a/lighthouse-core/audits/dobetterweb/notification-on-start.js +++ b/lighthouse-core/audits/dobetterweb/notification-on-start.js @@ -47,8 +47,8 @@ class NotificationOnStart extends ViolationAudit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'label', itemType: 'text', text: 'Location'}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'label', itemType: 'text', text: str_(i18n.UIStrings.columnLocation)}, ]; // TODO(bckenny): see TODO in geolocation-on-start const details = ViolationAudit.makeTableDetails(headings, results); diff --git a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js index a61af0608cf8..b7c17b2704d2 100644 --- a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +++ b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js @@ -13,6 +13,7 @@ const UIStrings = { failureTitle: 'Prevents users to paste into password fields', description: 'Preventing password pasting undermines good security policy. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/password-pasting).', + columnFailingElem: 'Failing Elements', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -48,7 +49,7 @@ class PasswordInputsCanBePastedIntoAudit extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'node', itemType: 'node', text: 'Failing Elements'}, + {key: 'node', itemType: 'node', text: str_(UIStrings.columnFailingElem)}, ]; return { diff --git a/lighthouse-core/audits/dobetterweb/uses-http2.js b/lighthouse-core/audits/dobetterweb/uses-http2.js index 65650bc33f74..aa1b269063ac 100644 --- a/lighthouse-core/audits/dobetterweb/uses-http2.js +++ b/lighthouse-core/audits/dobetterweb/uses-http2.js @@ -25,6 +25,7 @@ const UIStrings = { =1 {1 request not served via HTTP/2} other {# requests not served via HTTP/2} }`, + columnProtocol: 'Protocol', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -82,8 +83,8 @@ class UsesHTTP2Audit extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'protocol', itemType: 'text', text: 'Protocol'}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'protocol', itemType: 'text', text: str_(UIStrings.columnProtocol)}, ]; const details = Audit.makeTableDetails(headings, resources); diff --git a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js index d61bbd2fc101..bfe7196edd7a 100644 --- a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +++ b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js @@ -47,8 +47,8 @@ class PassiveEventsAudit extends ViolationAudit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'label', itemType: 'text', text: 'Location'}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'label', itemType: 'text', text: str_(i18n.UIStrings.columnLocation)}, ]; // TODO(bckenny): see TODO in geolocation-on-start const details = ViolationAudit.makeTableDetails(headings, results); diff --git a/lighthouse-core/audits/errors-in-console.js b/lighthouse-core/audits/errors-in-console.js index 3351761ae816..a890169e4018 100644 --- a/lighthouse-core/audits/errors-in-console.js +++ b/lighthouse-core/audits/errors-in-console.js @@ -18,6 +18,7 @@ const UIStrings = { description: 'Errors logged to the console indicate unresolved problems. ' + 'They can come from network request failures and other browser concerns.', failureTitle: 'Browser errors were logged to the console', + columnDesc: 'Description', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -71,8 +72,8 @@ class ErrorLogs extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'description', itemType: 'code', text: 'Description'}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'description', itemType: 'code', text: str_(UIStrings.columnDesc)}, ]; const details = Audit.makeTableDetails(headings, tableRows); diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index 54e05e3fa0bc..be224f2f266a 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -21,6 +21,8 @@ const UIStrings = { description: 'Image display dimensions should match natural aspect ratio. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).', warningCompute: 'Invalid image sizing information {url}', + columnDisplayed: 'Aspect Ratio (Displayed)', + columnActual: 'Aspect Ratio (Actual)', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -109,9 +111,9 @@ class ImageAspectRatio extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ {key: 'url', itemType: 'thumbnail', text: ''}, - {key: 'url', itemType: 'url', text: 'URL'}, - {key: 'displayedAspectRatio', itemType: 'text', text: 'Aspect Ratio (Displayed)'}, - {key: 'actualAspectRatio', itemType: 'text', text: 'Aspect Ratio (Actual)'}, + {key: 'url', itemType: 'url', text: str_(i18n.UIStrings.columnURL)}, + {key: 'displayedAspectRatio', itemType: 'text', text: str_(UIStrings.columnDisplayed)}, + {key: 'actualAspectRatio', itemType: 'text', text: str_(UIStrings.columnActual)}, ]; return { diff --git a/lighthouse-core/audits/is-on-https.js b/lighthouse-core/audits/is-on-https.js index 02bc42f1a266..8da132f74955 100644 --- a/lighthouse-core/audits/is-on-https.js +++ b/lighthouse-core/audits/is-on-https.js @@ -22,6 +22,7 @@ const UIStrings = { =1 {1 insecure request found} other {# insecure requests found} }`, + columnInsecureURL: 'Insecure URL', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); @@ -74,7 +75,7 @@ class HTTPS extends Audit { /** @type {LH.Audit.Details.Table['headings']} */ const headings = [ - {key: 'url', itemType: 'url', text: 'Insecure URL'}, + {key: 'url', itemType: 'url', text: str_(UIStrings.columnInsecureURL)}, ]; return { diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index c95b0461436b..31389e797881 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -599,6 +599,14 @@ "message": "Minimize Critical Requests Depth", "description": "Imperative title of a Lighthouse audit that tells the user to reduce the depth of critical network requests to enhance initial load of a page. Critical request chains are series of dependent network requests that are important for page rendering. For example, here's a 4-request-deep chain: The biglogo.jpg image is required, but is requested via the styles.css style code, which is requested by the initialize.js javascript, which is requested by the page's HTML. This is displayed in a list of audit titles that Lighthouse generates." }, + "lighthouse-core/audits/deprecations.js | columnDeprecate": { + "message": "Deprecation / Warning", + "description": "" + }, + "lighthouse-core/audits/deprecations.js | columnLine": { + "message": "Line", + "description": "" + }, "lighthouse-core/audits/deprecations.js | description": { "message": "Deprecated APIs will eventually be removed from the browser. [Learn more](https://www.chromestatus.com/features#deprecated).", "description": "" @@ -699,6 +707,14 @@ "message": "Avoids an excessive DOM size", "description": "Title of a diagnostic audit that provides detail on the size of the web page's DOM. The size of a DOM is characterized by the total number of DOM elements and greatest DOM depth. This descriptive title is shown to users when the amount is acceptable and no user action is required." }, + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnRel": { + "message": "Rel", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnTarget": { + "message": "Target", + "description": "" + }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | description": { "message": "Add `rel=\"noopener\"` or `rel=\"noreferrer\"` to any external links to improve performance and prevent security vulnerabilities. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).", "description": "" @@ -727,6 +743,14 @@ "message": "Avoids requesting the geolocation permission on page load", "description": "" }, + "lighthouse-core/audits/dobetterweb/js-libraries.js | columnName": { + "message": "Name", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/js-libraries.js | columnVersion": { + "message": "Version", + "description": "" + }, "lighthouse-core/audits/dobetterweb/js-libraries.js | description": { "message": "All front-end JavaScript libraries detected on the page.", "description": "" @@ -747,6 +771,18 @@ "message": "Avoids `document.write()`", "description": "" }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnSeverity": { + "message": "Highest Severity", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVersion": { + "message": "Library Version", + "description": "" + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVuln": { + "message": "Vulnerability Count", + "description": "" + }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | description": { "message": "Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).", "description": "" @@ -775,6 +811,10 @@ "message": "Avoids requesting the notification permission on page load", "description": "" }, + "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | columnFailingElem": { + "message": "Failing Elements", + "description": "" + }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | description": { "message": "Preventing password pasting undermines good security policy. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/password-pasting).", "description": "" @@ -787,6 +827,10 @@ "message": "Allows users to paste into password fields", "description": "" }, + "lighthouse-core/audits/dobetterweb/uses-http2.js | columnProtocol": { + "message": "Protocol", + "description": "" + }, "lighthouse-core/audits/dobetterweb/uses-http2.js | description": { "message": "HTTP/2 offers many benefits over HTTP/1.1, including binary headers, multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).", "description": "" @@ -815,6 +859,10 @@ "message": "Uses passive listeners to improve scrolling performance", "description": "" }, + "lighthouse-core/audits/errors-in-console.js | columnDesc": { + "message": "Description", + "description": "" + }, "lighthouse-core/audits/errors-in-console.js | description": { "message": "Errors logged to the console indicate unresolved problems. They can come from network request failures and other browser concerns.", "description": "" @@ -839,6 +887,14 @@ "message": "All text remains visible during webfont loads", "description": "Title of a diagnostic audit that provides detail on if all the text on a webpage was visible while the page was loading its webfonts. This descriptive title is shown to users when the amount is acceptable and no user action is required." }, + "lighthouse-core/audits/image-aspect-ratio.js | columnActual": { + "message": "Aspect Ratio (Actual)", + "description": "" + }, + "lighthouse-core/audits/image-aspect-ratio.js | columnDisplayed": { + "message": "Aspect Ratio (Displayed)", + "description": "" + }, "lighthouse-core/audits/image-aspect-ratio.js | description": { "message": "Image display dimensions should match natural aspect ratio. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).", "description": "" @@ -855,6 +911,10 @@ "message": "Invalid image sizing information {url}", "description": "" }, + "lighthouse-core/audits/is-on-https.js | columnInsecureURL": { + "message": "Insecure URL", + "description": "" + }, "lighthouse-core/audits/is-on-https.js | description": { "message": "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).", "description": "" @@ -1467,6 +1527,10 @@ "message": "Cache TTL", "description": "Label for the TTL column in data tables, entries will be the time to live value of the cache header on a web resource" }, + "lighthouse-core/lib/i18n/i18n.js | columnLocation": { + "message": "Location", + "description": "" + }, "lighthouse-core/lib/i18n/i18n.js | columnSize": { "message": "Size", "description": "Label for the size column in data tables, entries will be the size of a web resource in kilobytes" diff --git a/lighthouse-core/lib/i18n/i18n.js b/lighthouse-core/lib/i18n/i18n.js index b93423b4a83f..cf6553563dd4 100644 --- a/lighthouse-core/lib/i18n/i18n.js +++ b/lighthouse-core/lib/i18n/i18n.js @@ -56,6 +56,7 @@ const UIStrings = { columnWastedMs: 'Potential Savings', /** Label for the time spent column in data tables, entries will be the number of milliseconds spent during a particular activity */ columnTimeSpent: 'Time Spent', + columnLocation: 'Location', /** Label for a row in a data table; entries will be the total number and byte size of all resources loaded by a web page. */ totalResourceType: 'Total', /** Label for a row in a data table; entries will be the total number and byte size of all 'Document' resources loaded by a web page. */ diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 7849a42d1e0c..60236f417823 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -5042,6 +5042,9 @@ "path": "audits[is-on-https].displayValue" } ], + "lighthouse-core/audits/is-on-https.js | columnInsecureURL": [ + "audits[is-on-https].details.headings[0].text" + ], "lighthouse-core/audits/metrics/first-contentful-paint.js | title": [ "audits[first-contentful-paint].title" ], @@ -5154,6 +5157,29 @@ "lighthouse-core/audits/errors-in-console.js | description": [ "audits[errors-in-console].description" ], + "lighthouse-core/lib/i18n/i18n.js | columnURL": [ + "audits[errors-in-console].details.headings[0].text", + "audits[image-aspect-ratio].details.headings[1].text", + "audits.deprecations.details.headings[1].text", + "audits[bootup-time].details.headings[0].text", + "audits[network-rtt].details.headings[0].text", + "audits[network-server-latency].details.headings[0].text", + "audits[uses-long-cache-ttl].details.headings[0].text", + "audits[total-byte-weight].details.headings[0].text", + "audits[render-blocking-resources].details.headings[0].label", + "audits[unminified-javascript].details.headings[0].label", + "audits[uses-webp-images].details.headings[1].label", + "audits[uses-text-compression].details.headings[0].label", + "audits[external-anchors-use-rel-noopener].details.headings[0].text", + "audits[geolocation-on-start].details.headings[0].text", + "audits[no-document-write].details.headings[0].text", + "audits[notification-on-start].details.headings[0].text", + "audits[uses-http2].details.headings[0].text", + "audits[uses-passive-event-listeners].details.headings[0].text" + ], + "lighthouse-core/audits/errors-in-console.js | columnDesc": [ + "audits[errors-in-console].details.headings[1].text" + ], "lighthouse-core/audits/time-to-first-byte.js | title": [ "audits[time-to-first-byte].title" ], @@ -5218,6 +5244,12 @@ "lighthouse-core/audits/image-aspect-ratio.js | description": [ "audits[image-aspect-ratio].description" ], + "lighthouse-core/audits/image-aspect-ratio.js | columnDisplayed": [ + "audits[image-aspect-ratio].details.headings[2].text" + ], + "lighthouse-core/audits/image-aspect-ratio.js | columnActual": [ + "audits[image-aspect-ratio].details.headings[3].text" + ], "lighthouse-core/audits/deprecations.js | failureTitle": [ "audits.deprecations.title" ], @@ -5232,6 +5264,12 @@ "path": "audits.deprecations.displayValue" } ], + "lighthouse-core/audits/deprecations.js | columnDeprecate": [ + "audits.deprecations.details.headings[0].text" + ], + "lighthouse-core/audits/deprecations.js | columnLine": [ + "audits.deprecations.details.headings[2].text" + ], "lighthouse-core/audits/mainthread-work-breakdown.js | title": [ "audits[mainthread-work-breakdown].title" ], @@ -5252,17 +5290,6 @@ "lighthouse-core/audits/bootup-time.js | description": [ "audits[bootup-time].description" ], - "lighthouse-core/lib/i18n/i18n.js | columnURL": [ - "audits[bootup-time].details.headings[0].text", - "audits[network-rtt].details.headings[0].text", - "audits[network-server-latency].details.headings[0].text", - "audits[uses-long-cache-ttl].details.headings[0].text", - "audits[total-byte-weight].details.headings[0].text", - "audits[render-blocking-resources].details.headings[0].label", - "audits[unminified-javascript].details.headings[0].label", - "audits[uses-webp-images].details.headings[1].label", - "audits[uses-text-compression].details.headings[0].label" - ], "lighthouse-core/audits/bootup-time.js | columnTotal": [ "audits[bootup-time].details.headings[1].text" ], @@ -5809,12 +5836,24 @@ "path": "audits[external-anchors-use-rel-noopener].warnings[0]" } ], + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnTarget": [ + "audits[external-anchors-use-rel-noopener].details.headings[1].text" + ], + "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnRel": [ + "audits[external-anchors-use-rel-noopener].details.headings[2].text" + ], "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | failureTitle": [ "audits[geolocation-on-start].title" ], "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | description": [ "audits[geolocation-on-start].description" ], + "lighthouse-core/lib/i18n/i18n.js | columnLocation": [ + "audits[geolocation-on-start].details.headings[1].text", + "audits[no-document-write].details.headings[1].text", + "audits[notification-on-start].details.headings[1].text", + "audits[uses-passive-event-listeners].details.headings[1].text" + ], "lighthouse-core/audits/dobetterweb/no-document-write.js | failureTitle": [ "audits[no-document-write].title" ], @@ -5835,12 +5874,27 @@ "path": "audits[no-vulnerable-libraries].displayValue" } ], + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVersion": [ + "audits[no-vulnerable-libraries].details.headings[0].text" + ], + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVuln": [ + "audits[no-vulnerable-libraries].details.headings[1].text" + ], + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnSeverity": [ + "audits[no-vulnerable-libraries].details.headings[2].text" + ], "lighthouse-core/audits/dobetterweb/js-libraries.js | title": [ "audits[js-libraries].title" ], "lighthouse-core/audits/dobetterweb/js-libraries.js | description": [ "audits[js-libraries].description" ], + "lighthouse-core/audits/dobetterweb/js-libraries.js | columnName": [ + "audits[js-libraries].details.headings[0].text" + ], + "lighthouse-core/audits/dobetterweb/js-libraries.js | columnVersion": [ + "audits[js-libraries].details.headings[1].text" + ], "lighthouse-core/audits/dobetterweb/notification-on-start.js | failureTitle": [ "audits[notification-on-start].title" ], @@ -5853,6 +5907,9 @@ "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | description": [ "audits[password-inputs-can-be-pasted-into].description" ], + "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | columnFailingElem": [ + "audits[password-inputs-can-be-pasted-into].details.headings[0].text" + ], "lighthouse-core/audits/dobetterweb/uses-http2.js | failureTitle": [ "audits[uses-http2].title" ], @@ -5867,6 +5924,9 @@ "path": "audits[uses-http2].displayValue" } ], + "lighthouse-core/audits/dobetterweb/uses-http2.js | columnProtocol": [ + "audits[uses-http2].details.headings[1].text" + ], "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | failureTitle": [ "audits[uses-passive-event-listeners].title" ], From 54704d17c0cc79b5c0b03584cf2f2d96fcfbaece Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 31 May 2019 11:55:53 -0700 Subject: [PATCH 05/12] fixed test --- lighthouse-core/test/audits/dobetterweb/uses-http2-test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js index 1a03e5a6f8dd..bc99293658d5 100644 --- a/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js +++ b/lighthouse-core/test/audits/dobetterweb/uses-http2-test.js @@ -36,8 +36,8 @@ describe('Resources are fetched over http/2', () => { 'https://webtide.com/wp-content/plugins/wp-pagenavi/pagenavi-css.css?ver=2.70' ); const headers = auditResult.details.headings; - assert.equal(headers[0].text, 'URL', 'table headings are correct and in order'); - assert.equal(headers[1].text, 'Protocol', 'table headings are correct and in order'); + expect(headers[0].text).toBeDisplayString('URL'); + expect(headers[1].text).toBeDisplayString('Protocol'); } ); }); From 197dc4bbf90b2a0bafc45114cb9df78f1aa74baf Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Fri, 31 May 2019 14:08:39 -0700 Subject: [PATCH 06/12] Initial descriptions. --- lighthouse-core/audits/deprecations.js | 6 + .../audits/dobetterweb/appcache-manifest.js | 4 + lighthouse-core/audits/dobetterweb/doctype.js | 7 + .../external-anchors-use-rel-noopener.js | 6 + .../dobetterweb/geolocation-on-start.js | 3 + .../audits/dobetterweb/js-libraries.js | 4 + .../audits/dobetterweb/no-document-write.js | 3 + .../dobetterweb/no-vulnerable-libraries.js | 7 + .../dobetterweb/notification-on-start.js | 3 + .../password-inputs-can-be-pasted-into.js | 4 + .../audits/dobetterweb/uses-http2.js | 5 + .../uses-passive-event-listeners.js | 3 + lighthouse-core/audits/errors-in-console.js | 6 +- lighthouse-core/audits/image-aspect-ratio.js | 6 + lighthouse-core/audits/is-on-https.js | 5 + lighthouse-core/config/default-config.js | 1 + lighthouse-core/lib/i18n/en-US.json | 144 +++++++++--------- lighthouse-core/lib/i18n/i18n.js | 1 + 18 files changed, 145 insertions(+), 73 deletions(-) diff --git a/lighthouse-core/audits/deprecations.js b/lighthouse-core/audits/deprecations.js index 883ab3baf620..400442d4b347 100644 --- a/lighthouse-core/audits/deprecations.js +++ b/lighthouse-core/audits/deprecations.js @@ -15,15 +15,21 @@ const Audit = require('./audit.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site does not use deprecated APIs. */ title: 'Avoids deprecated APIs', + /** Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site uses deprecated APIs. */ failureTitle: 'Uses deprecated APIs', + /** Description of a Lighthouse audit that tells the user why they should not use deprecated APIs on their site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Deprecated APIs will eventually be removed from the browser. ' + '[Learn more](https://www.chromestatus.com/features#deprecated).', + /** [ICU Syntax] Label for the audit identifying the number of warnings generated by using deprecated APIs. */ displayValue: `{itemCount, plural, =1 {1 warning found} other {# warnings found} }`, + /** Table column header for the deprecation or warning generated by the site. */ columnDeprecate: 'Deprecation / Warning', + /** Table column header for line that is using a deprecated API on the site. */ columnLine: 'Line', }; diff --git a/lighthouse-core/audits/dobetterweb/appcache-manifest.js b/lighthouse-core/audits/dobetterweb/appcache-manifest.js index 9eb0536e4f2e..1f133a89aa14 100644 --- a/lighthouse-core/audits/dobetterweb/appcache-manifest.js +++ b/lighthouse-core/audits/dobetterweb/appcache-manifest.js @@ -14,10 +14,14 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the use of the Application Cache API. This descriptive title is shown to users when they do not use the Application Cache API. */ title: 'Avoids Application Cache', + /** Title of a Lighthouse audit that provides detail on the use of the Application Cache API. This descriptive title is shown to users when they do use the Application Cache API, which is considered bad practice. */ failureTitle: 'Uses Application Cache', + /** Description of a Lighthouse audit that tells the user why they should not use the Application Cache API. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Application Cache is deprecated. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/appcache).', + /** Label for the audit identifying uses of the Application Cache. */ displayValue: 'Found "{AppCacheManifest}"', }; diff --git a/lighthouse-core/audits/dobetterweb/doctype.js b/lighthouse-core/audits/dobetterweb/doctype.js index c08320c4d479..27880238e5e6 100644 --- a/lighthouse-core/audits/dobetterweb/doctype.js +++ b/lighthouse-core/audits/dobetterweb/doctype.js @@ -9,14 +9,21 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is set to HTML. */ title: 'Page has the HTML doctype', + /** Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is not set to HTML. */ failureTitle: 'Page is missing the HTML doctype', + /** Description of a Lighthouse audit that tells the user why they should set the doctype as HTML. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Specifying a doctype prevents the browser ' + 'from switching to quirks-mode. Read more on the ' + '[MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)', + /** Explanatory message stating that the document has no doctype. */ explanationNoDoctype: 'Document must contain a doctype', + /** Explanatory message stating that the publicId field is not empty. */ explanationPublicId: 'Expected publicId to be an empty string', + /** Explanatory message stating that the systemId field is not empty. */ explanationSystemId: 'Expected systemId to be an empty string', + /** Explanatory message stating that the doctype is set, but is not "html" and is therefore invalid. */ explanationBadDoctype: 'Doctype name must be the lowercase string `html`', }; diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index 3a5cb7b234b9..02a45b1ccc4e 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -10,14 +10,20 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe. */ title: 'Links to cross-origin destinations are safe', + /** Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */ failureTitle: 'Links to cross-origin destinations are unsafe', + /** Description of a Lighthouse audit that tells the user why and how they should secure cross-origin links. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + 'performance and prevent security vulnerabilities. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).', + /** Warning that some links' destinations cannot be determined and therefor neither can their safety. */ warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' + 'If not used as a hyperlink, consider removing target=_blank.', + /** Table column header for the target of a URL. */ columnTarget: 'Target', + /** Table column header for the `rel=` value from the link. */ columnRel: 'Rel', }; diff --git a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js index d17bd2398fb1..7e5b46e38ea0 100644 --- a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +++ b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js @@ -15,8 +15,11 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on geolocation permissions requests. This descriptive title is shown to users when the page does not ask for geolocation permissions on load. */ title: 'Avoids requesting the geolocation permission on page load', + /** Title of a Lighthouse audit that provides detail on geolocation permissions requests. This descriptive title is shown to users when the page does ask for geolocation permissions on load. */ failureTitle: 'Requests the geolocation permission on page load', + /** Description of a Lighthouse audit that tells the user why they should not ask for geolocation permissions on load. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Users are mistrustful of or confused by sites that request their ' + 'location without context. Consider tying the request to user gestures instead. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).', diff --git a/lighthouse-core/audits/dobetterweb/js-libraries.js b/lighthouse-core/audits/dobetterweb/js-libraries.js index 5342f39a7b75..34b9e5a442c6 100644 --- a/lighthouse-core/audits/dobetterweb/js-libraries.js +++ b/lighthouse-core/audits/dobetterweb/js-libraries.js @@ -14,9 +14,13 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a site. */ title: 'Detected JavaScript libraries', + /** Description of a Lighthouse audit that tells the user what this audit is detecting. This is displayed after a user expands the section to see more. No character length limits. */ description: 'All front-end JavaScript libraries detected on the page.', + /** Table column header for the name of the Javascript library. */ columnName: 'Name', + /** Table column header for the version of the detected Javascript library. */ columnVersion: 'Version', }; diff --git a/lighthouse-core/audits/dobetterweb/no-document-write.js b/lighthouse-core/audits/dobetterweb/no-document-write.js index defd9749daa3..0e605a145b24 100644 --- a/lighthouse-core/audits/dobetterweb/no-document-write.js +++ b/lighthouse-core/audits/dobetterweb/no-document-write.js @@ -14,8 +14,11 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does not use `Document.write`. */ title: 'Avoids `document.write()`', + /** Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does use `Document.write`. */ failureTitle: 'Uses `document.write()`', + /** Description of a Lighthouse audit that tells the user why they should avoid `Document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'For users on slow connections, external scripts dynamically injected via ' + '`document.write()` can delay page load by tens of seconds. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).', diff --git a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js index ad2b73e57c73..ab4abda17e15 100644 --- a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +++ b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js @@ -19,19 +19,26 @@ const snykDatabase = require('../../../third-party/snyk/snapshot.json'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when all Javascript libraries are free of known security vulnerabilities. */ title: 'Avoids front-end JavaScript libraries' + ' with known security vulnerabilities', + /** Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when some detected Javascript libraries have known security vulnerabilities. */ failureTitle: 'Includes front-end JavaScript libraries' + ' with known security vulnerabilities', + /** Description of a Lighthouse audit that tells the user why they should be concerned about the third party Javascript libraries that they use. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Some third-party scripts may contain known security vulnerabilities ' + 'that are easily identified and exploited by attackers. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).', + /** [ICU Syntax] Label for the audit identifying the number of vulnerable Javascript libraries found. */ displayValue: `{itemCount, plural, =1 {1 vulnerability detected} other {# vulnerabilities detected} }`, + /** Table column header for the version of the Javascript library found. */ columnVersion: 'Library Version', + /** Table column header for the count of vulnerabilities found. */ columnVuln: 'Vulnerability Count', + /** Table column header for the severity of the vulnerabilities found in the detected Javascript libraries. */ columnSeverity: 'Highest Severity', }; diff --git a/lighthouse-core/audits/dobetterweb/notification-on-start.js b/lighthouse-core/audits/dobetterweb/notification-on-start.js index 959ad6993665..ea62e3a85bd3 100644 --- a/lighthouse-core/audits/dobetterweb/notification-on-start.js +++ b/lighthouse-core/audits/dobetterweb/notification-on-start.js @@ -15,8 +15,11 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does not ask for notification permission on load. */ title: 'Avoids requesting the notification permission on page load', + /** Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does ask for notification permission on load. */ failureTitle: 'Requests the notification permission on page load', + /** Description of a Lighthouse audit that tells the user why they should not ask for notification permission on load. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Users are mistrustful of or confused by sites that request to send ' + 'notifications without context. Consider tying the request to user gestures ' + 'instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/notifications-on-load).', diff --git a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js index b7c17b2704d2..f738b032a878 100644 --- a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +++ b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js @@ -9,10 +9,14 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site allows pasting of content into password fields. */ title: 'Allows users to paste into password fields', + /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site does not allow pasting of content into password fields. */ failureTitle: 'Prevents users to paste into password fields', + /** Description of a Lighthouse audit that tells the user why they should allow pasting of content into password fields. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Preventing password pasting undermines good security policy. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/password-pasting).', + /** Table column header for the HTML elements that do not allow pasting of content. */ columnFailingElem: 'Failing Elements', }; diff --git a/lighthouse-core/audits/dobetterweb/uses-http2.js b/lighthouse-core/audits/dobetterweb/uses-http2.js index aa1b269063ac..dada680b862a 100644 --- a/lighthouse-core/audits/dobetterweb/uses-http2.js +++ b/lighthouse-core/audits/dobetterweb/uses-http2.js @@ -17,14 +17,19 @@ const NetworkRecords = require('../../computed/network-records.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site uses HTTP/2 for its requests. */ title: 'Uses HTTP/2 for its own resources', + /** Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site does not use HTTP/2 for its requests. */ failureTitle: 'Does not use HTTP/2 for all of its resources', + /** Description of a Lighthouse audit that tells the user why they should use HTTP/2. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'HTTP/2 offers many benefits over HTTP/1.1, including binary headers, ' + 'multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).', + /** [ICU Syntax] Label for the audit identifying the number of requests that were not served with HTTP/2. */ displayValue: `{itemCount, plural, =1 {1 request not served via HTTP/2} other {# requests not served via HTTP/2} }`, + /** Table column header for the HTTP Protocol used in a request. */ columnProtocol: 'Protocol', }; diff --git a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js index bfe7196edd7a..c49ae0f1aeef 100644 --- a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +++ b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js @@ -15,8 +15,11 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does use passive listeners. */ title: 'Uses passive listeners to improve scrolling performance', + /** Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does not use passive listeners. */ failureTitle: 'Does not use passive listeners to improve scrolling performance', + /** Description of a Lighthouse audit that tells the user why they should use passive listeners on the site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: '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).', diff --git a/lighthouse-core/audits/errors-in-console.js b/lighthouse-core/audits/errors-in-console.js index a890169e4018..ec544721db45 100644 --- a/lighthouse-core/audits/errors-in-console.js +++ b/lighthouse-core/audits/errors-in-console.js @@ -14,10 +14,14 @@ const Audit = require('./audit.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when no browser errors were logged into the devtools console. */ title: 'No browser errors logged to the console', + /** Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when browser errors were logged into the devtools console. */ + failureTitle: 'Browser errors were logged to the console', + /** Description of a Lighthouse audit that tells the user why they should not log errors into the console. This is displayed after a user expands the section to see more. No character length limits. */ description: 'Errors logged to the console indicate unresolved problems. ' + 'They can come from network request failures and other browser concerns.', - failureTitle: 'Browser errors were logged to the console', + /** Table column header for the description of the browser error that was logged. */ columnDesc: 'Description', }; diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index be224f2f266a..c69cdb8a82f6 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -16,12 +16,18 @@ const URL = require('../lib/url-shim.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when all images use correct aspect ratios. */ title: 'Displays images with correct aspect ratio', + /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when not all images use correct aspect ratios. */ failureTitle: 'Displays images with incorrect aspect ratio', + /** Description of a Lighthouse audit that tells the user why they should maintain the correct aspect ratios for all images. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Image display dimensions should match natural aspect ratio. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).', + /** Warning that the sizing information cannot be collected for an image. */ warningCompute: 'Invalid image sizing information {url}', + /** Table column header for the displayed aspect ratio of an image. */ columnDisplayed: 'Aspect Ratio (Displayed)', + /** Table column header for the actual aspect ratio of an image. */ columnActual: 'Aspect Ratio (Actual)', }; diff --git a/lighthouse-core/audits/is-on-https.js b/lighthouse-core/audits/is-on-https.js index 8da132f74955..85e86f3b8247 100644 --- a/lighthouse-core/audits/is-on-https.js +++ b/lighthouse-core/audits/is-on-https.js @@ -11,17 +11,22 @@ const NetworkRecords = require('../computed/network-records.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { + /** Title of a Lighthouse audit that provides detail on the useage of HTTPS on a page. This descriptive title is shown to users when all requests on a page are fufilled using HTTPS. */ title: 'Uses HTTPS', + /** Title of a Lighthouse audit that provides detail on the useage of HTTPS on a page. This descriptive title is shown to users when some, or all, requests on the page use HTTP instead of HTTPS. */ failureTitle: 'Does not use HTTPS', + /** Description of a Lighthouse audit that tells the user *why* HTTPS use is important. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: '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).', + /** [ICU Syntax] Label for the audit identifying the number of insecure requests found. */ displayValue: `{itemCount, plural, =1 {1 insecure request found} other {# insecure requests found} }`, + /** Table column header for the URL's of non-HTTPS requests. */ columnInsecureURL: 'Insecure URL', }; diff --git a/lighthouse-core/config/default-config.js b/lighthouse-core/config/default-config.js index 0d58e61c8692..6760fc55b2bb 100644 --- a/lighthouse-core/config/default-config.js +++ b/lighthouse-core/config/default-config.js @@ -94,6 +94,7 @@ const UIStrings = { seoCrawlingGroupTitle: 'Crawling and Indexing', /* Description of the navigation section within the Search Engine Optimization (SEO) category. Within this section are audits with descriptive titles that highlight ways to make a website accessible to search engine crawlers. */ seoCrawlingGroupDescription: 'To appear in search results, crawlers need access to your app.', + /** Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters. */ bestPracticesCategoryTitle: 'Best Practices', /** Title of the Fast and Reliable section of the web app category. Within this section are audits that check if the web site loaded quickly and can reliably load even if the internet connection is very slow or goes offline. */ pwaFastReliableGroupTitle: 'Fast and reliable', diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 31389e797881..a590373675bd 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -601,71 +601,71 @@ }, "lighthouse-core/audits/deprecations.js | columnDeprecate": { "message": "Deprecation / Warning", - "description": "" + "description": "Table column header for the deprecation or warning generated by the site." }, "lighthouse-core/audits/deprecations.js | columnLine": { "message": "Line", - "description": "" + "description": "Table column header for line that is using a deprecated API on the site." }, "lighthouse-core/audits/deprecations.js | description": { "message": "Deprecated APIs will eventually be removed from the browser. [Learn more](https://www.chromestatus.com/features#deprecated).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should not use deprecated APIs on their site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/deprecations.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 warning found}\n other {# warnings found}\n }", - "description": "" + "description": "[ICU Syntax] Label for the audit identifying the number of warnings generated by using deprecated APIs." }, "lighthouse-core/audits/deprecations.js | failureTitle": { "message": "Uses deprecated APIs", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site uses deprecated APIs." }, "lighthouse-core/audits/deprecations.js | title": { "message": "Avoids deprecated APIs", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site does not use deprecated APIs." }, "lighthouse-core/audits/dobetterweb/appcache-manifest.js | description": { "message": "Application Cache is deprecated. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/appcache).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should not use the Application Cache API. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/appcache-manifest.js | displayValue": { "message": "Found \"{AppCacheManifest}\"", - "description": "" + "description": "Label for the audit identifying uses of the Application Cache." }, "lighthouse-core/audits/dobetterweb/appcache-manifest.js | failureTitle": { "message": "Uses Application Cache", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the use of the Application Cache API. This descriptive title is shown to users when they do use the Application Cache API, which is considered bad practice." }, "lighthouse-core/audits/dobetterweb/appcache-manifest.js | title": { "message": "Avoids Application Cache", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the use of the Application Cache API. This descriptive title is shown to users when they do not use the Application Cache API." }, "lighthouse-core/audits/dobetterweb/doctype.js | description": { "message": "Specifying a doctype prevents the browser from switching to quirks-mode. Read more on the [MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should set the doctype as HTML. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/doctype.js | explanationBadDoctype": { "message": "Doctype name must be the lowercase string `html`", - "description": "" + "description": "Explanatory message stating that the doctype is set, but is not \"html\" and is therefore invalid." }, "lighthouse-core/audits/dobetterweb/doctype.js | explanationNoDoctype": { "message": "Document must contain a doctype", - "description": "" + "description": "Explanatory message stating that the document has no doctype." }, "lighthouse-core/audits/dobetterweb/doctype.js | explanationPublicId": { "message": "Expected publicId to be an empty string", - "description": "" + "description": "Explanatory message stating that the publicId field is not empty." }, "lighthouse-core/audits/dobetterweb/doctype.js | explanationSystemId": { "message": "Expected systemId to be an empty string", - "description": "" + "description": "Explanatory message stating that the systemId field is not empty." }, "lighthouse-core/audits/dobetterweb/doctype.js | failureTitle": { "message": "Page is missing the HTML doctype", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is not set to HTML." }, "lighthouse-core/audits/dobetterweb/doctype.js | title": { "message": "Page has the HTML doctype", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is set to HTML." }, "lighthouse-core/audits/dobetterweb/dom-size.js | columnElement": { "message": "Element", @@ -709,171 +709,171 @@ }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnRel": { "message": "Rel", - "description": "" + "description": "Table column header for the `rel=` value from the link." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnTarget": { "message": "Target", - "description": "" + "description": "Table column header for the target of a URL." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | description": { "message": "Add `rel=\"noopener\"` or `rel=\"noreferrer\"` to any external links to improve performance and prevent security vulnerabilities. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why and how they should secure cross-origin links. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | failureTitle": { "message": "Links to cross-origin destinations are unsafe", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | title": { "message": "Links to cross-origin destinations are safe", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | warning": { "message": "Unable to determine the destination for anchor ({anchorHTML}). If not used as a hyperlink, consider removing target=_blank.", - "description": "" + "description": "Warning that some links' destinations cannot be determined and therefor neither can their safety." }, "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | description": { "message": "Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to user gestures instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should not ask for geolocation permissions on load. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | failureTitle": { "message": "Requests the geolocation permission on page load", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on geolocation permissions requests. This descriptive title is shown to users when the page does ask for geolocation permissions on load." }, "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | title": { "message": "Avoids requesting the geolocation permission on page load", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on geolocation permissions requests. This descriptive title is shown to users when the page does not ask for geolocation permissions on load." }, "lighthouse-core/audits/dobetterweb/js-libraries.js | columnName": { "message": "Name", - "description": "" + "description": "Table column header for the name of the Javascript library." }, "lighthouse-core/audits/dobetterweb/js-libraries.js | columnVersion": { "message": "Version", - "description": "" + "description": "Table column header for the version of the detected Javascript library." }, "lighthouse-core/audits/dobetterweb/js-libraries.js | description": { "message": "All front-end JavaScript libraries detected on the page.", - "description": "" + "description": "Description of a Lighthouse audit that tells the user what this audit is detecting. This is displayed after a user expands the section to see more. No character length limits." }, "lighthouse-core/audits/dobetterweb/js-libraries.js | title": { "message": "Detected JavaScript libraries", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a site." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | description": { "message": "For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should avoid `Document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | failureTitle": { "message": "Uses `document.write()`", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does use `Document.write`." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | title": { "message": "Avoids `document.write()`", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does not use `Document.write`." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnSeverity": { "message": "Highest Severity", - "description": "" + "description": "Table column header for the severity of the vulnerabilities found in the detected Javascript libraries." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVersion": { "message": "Library Version", - "description": "" + "description": "Table column header for the version of the Javascript library found." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVuln": { "message": "Vulnerability Count", - "description": "" + "description": "Table column header for the count of vulnerabilities found." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | description": { "message": "Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should be concerned about the third party Javascript libraries that they use. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 vulnerability detected}\n other {# vulnerabilities detected}\n }", - "description": "" + "description": "[ICU Syntax] Label for the audit identifying the number of vulnerable Javascript libraries found." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | failureTitle": { "message": "Includes front-end JavaScript libraries with known security vulnerabilities", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when some detected Javascript libraries have known security vulnerabilities." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | title": { "message": "Avoids front-end JavaScript libraries with known security vulnerabilities", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when all Javascript libraries are free of known security vulnerabilities." }, "lighthouse-core/audits/dobetterweb/notification-on-start.js | description": { "message": "Users are mistrustful of or confused by sites that request to send notifications without context. Consider tying the request to user gestures instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/notifications-on-load).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should not ask for notification permission on load. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/notification-on-start.js | failureTitle": { "message": "Requests the notification permission on page load", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does ask for notification permission on load." }, "lighthouse-core/audits/dobetterweb/notification-on-start.js | title": { "message": "Avoids requesting the notification permission on page load", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does not ask for notification permission on load." }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | columnFailingElem": { "message": "Failing Elements", - "description": "" + "description": "Table column header for the HTML elements that do not allow pasting of content." }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | description": { "message": "Preventing password pasting undermines good security policy. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/password-pasting).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should allow pasting of content into password fields. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | failureTitle": { "message": "Prevents users to paste into password fields", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site does not allow pasting of content into password fields." }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | title": { "message": "Allows users to paste into password fields", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site allows pasting of content into password fields." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | columnProtocol": { "message": "Protocol", - "description": "" + "description": "Table column header for the HTTP Protocol used in a request." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | description": { "message": "HTTP/2 offers many benefits over HTTP/1.1, including binary headers, multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should use HTTP/2. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 request not served via HTTP/2}\n other {# requests not served via HTTP/2}\n }", - "description": "" + "description": "[ICU Syntax] Label for the audit identifying the number of requests that were not served with HTTP/2." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | failureTitle": { "message": "Does not use HTTP/2 for all of its resources", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site does not use HTTP/2 for its requests." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | title": { "message": "Uses HTTP/2 for its own resources", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site uses HTTP/2 for its requests." }, "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | description": { "message": "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).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should use passive listeners on the site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | failureTitle": { "message": "Does not use passive listeners to improve scrolling performance", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does not use passive listeners." }, "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | title": { "message": "Uses passive listeners to improve scrolling performance", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does use passive listeners." }, "lighthouse-core/audits/errors-in-console.js | columnDesc": { "message": "Description", - "description": "" + "description": "Table column header for the description of the browser error that was logged." }, "lighthouse-core/audits/errors-in-console.js | description": { "message": "Errors logged to the console indicate unresolved problems. They can come from network request failures and other browser concerns.", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should not log errors into the console. This is displayed after a user expands the section to see more. No character length limits." }, "lighthouse-core/audits/errors-in-console.js | failureTitle": { "message": "Browser errors were logged to the console", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when browser errors were logged into the devtools console." }, "lighthouse-core/audits/errors-in-console.js | title": { "message": "No browser errors logged to the console", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when no browser errors were logged into the devtools console." }, "lighthouse-core/audits/font-display.js | description": { "message": "Leverage the font-display CSS feature to ensure text is user-visible while webfonts are loading. [Learn more](https://developers.google.com/web/updates/2016/02/font-display).", @@ -889,47 +889,47 @@ }, "lighthouse-core/audits/image-aspect-ratio.js | columnActual": { "message": "Aspect Ratio (Actual)", - "description": "" + "description": "Table column header for the actual aspect ratio of an image." }, "lighthouse-core/audits/image-aspect-ratio.js | columnDisplayed": { "message": "Aspect Ratio (Displayed)", - "description": "" + "description": "Table column header for the displayed aspect ratio of an image." }, "lighthouse-core/audits/image-aspect-ratio.js | description": { "message": "Image display dimensions should match natural aspect ratio. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user why they should maintain the correct aspect ratios for all images. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/image-aspect-ratio.js | failureTitle": { "message": "Displays images with incorrect aspect ratio", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when not all images use correct aspect ratios." }, "lighthouse-core/audits/image-aspect-ratio.js | title": { "message": "Displays images with correct aspect ratio", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when all images use correct aspect ratios." }, "lighthouse-core/audits/image-aspect-ratio.js | warningCompute": { "message": "Invalid image sizing information {url}", - "description": "" + "description": "Warning that the sizing information cannot be collected for an image." }, "lighthouse-core/audits/is-on-https.js | columnInsecureURL": { "message": "Insecure URL", - "description": "" + "description": "Table column header for the URL's of non-HTTPS requests." }, "lighthouse-core/audits/is-on-https.js | description": { "message": "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).", - "description": "" + "description": "Description of a Lighthouse audit that tells the user *why* HTTPS use is important. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/is-on-https.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 insecure request found}\n other {# insecure requests found}\n }", - "description": "" + "description": "[ICU Syntax] Label for the audit identifying the number of insecure requests found." }, "lighthouse-core/audits/is-on-https.js | failureTitle": { "message": "Does not use HTTPS", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the useage of HTTPS on a page. This descriptive title is shown to users when some, or all, requests on the page use HTTP instead of HTTPS." }, "lighthouse-core/audits/is-on-https.js | title": { "message": "Uses HTTPS", - "description": "" + "description": "Title of a Lighthouse audit that provides detail on the useage of HTTPS on a page. This descriptive title is shown to users when all requests on a page are fufilled using HTTPS." }, "lighthouse-core/audits/load-fast-enough-for-pwa.js | description": { "message": "A fast page load over a cellular network ensures a good mobile user experience. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/fast-3g).", @@ -1425,7 +1425,7 @@ }, "lighthouse-core/config/default-config.js | bestPracticesCategoryTitle": { "message": "Best Practices", - "description": "" + "description": "Title of the Best Practices category of audits. This is displayed at the top of a list of audits focused on topics related to following web development best practices and accepted guidelines. Also used as a label of a score gauge; try to limit to 20 characters." }, "lighthouse-core/config/default-config.js | budgetsGroupDescription": { "message": "Performance budgets set standards for the performance of your site.", @@ -1529,7 +1529,7 @@ }, "lighthouse-core/lib/i18n/i18n.js | columnLocation": { "message": "Location", - "description": "" + "description": "Label for the location column in data tables, entries will be the location of a specific entity, the entity may be a file in a directory, or a place in the world, it is generic" }, "lighthouse-core/lib/i18n/i18n.js | columnSize": { "message": "Size", diff --git a/lighthouse-core/lib/i18n/i18n.js b/lighthouse-core/lib/i18n/i18n.js index cf6553563dd4..21c15f91d163 100644 --- a/lighthouse-core/lib/i18n/i18n.js +++ b/lighthouse-core/lib/i18n/i18n.js @@ -56,6 +56,7 @@ const UIStrings = { columnWastedMs: 'Potential Savings', /** Label for the time spent column in data tables, entries will be the number of milliseconds spent during a particular activity */ columnTimeSpent: 'Time Spent', + /** Label for the location column in data tables, entries will be the location of a specific entity, the entity may be a file in a directory, or a place in the world, it is generic */ columnLocation: 'Location', /** Label for a row in a data table; entries will be the total number and byte size of all resources loaded by a web page. */ totalResourceType: 'Total', From 93a81cb06ae5bfc76d5e3323c00a036a62107802 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 12 Jun 2019 09:37:46 -0400 Subject: [PATCH 07/12] Stringback Batch suggestions Co-Authored-By: Paul Irish Co-Authored-By: Brendan Kenny --- lighthouse-core/audits/deprecations.js | 4 ++-- lighthouse-core/audits/dobetterweb/doctype.js | 4 ++-- .../dobetterweb/external-anchors-use-rel-noopener.js | 4 ++-- .../audits/dobetterweb/geolocation-on-start.js | 4 ++-- lighthouse-core/audits/dobetterweb/no-document-write.js | 6 +++--- .../audits/dobetterweb/no-vulnerable-libraries.js | 4 ++-- lighthouse-core/audits/dobetterweb/uses-http2.js | 8 ++++---- .../audits/dobetterweb/uses-passive-event-listeners.js | 6 +++--- lighthouse-core/audits/errors-in-console.js | 6 +++--- lighthouse-core/audits/image-aspect-ratio.js | 4 ++-- lighthouse-core/audits/is-on-https.js | 4 ++-- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lighthouse-core/audits/deprecations.js b/lighthouse-core/audits/deprecations.js index 400442d4b347..fadd132cdbcf 100644 --- a/lighthouse-core/audits/deprecations.js +++ b/lighthouse-core/audits/deprecations.js @@ -27,9 +27,9 @@ const UIStrings = { =1 {1 warning found} other {# warnings found} }`, - /** Table column header for the deprecation or warning generated by the site. */ + /** Header of the table column which displays the warning message describing use of a deprecated API by code running in the web page. */ columnDeprecate: 'Deprecation / Warning', - /** Table column header for line that is using a deprecated API on the site. */ + /** Table column header for line of code (eg. 432) that is using a deprecated API. */ columnLine: 'Line', }; diff --git a/lighthouse-core/audits/dobetterweb/doctype.js b/lighthouse-core/audits/dobetterweb/doctype.js index 27880238e5e6..49281d37ad44 100644 --- a/lighthouse-core/audits/dobetterweb/doctype.js +++ b/lighthouse-core/audits/dobetterweb/doctype.js @@ -12,8 +12,8 @@ const UIStrings = { /** Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is set to HTML. */ title: 'Page has the HTML doctype', /** Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is not set to HTML. */ - failureTitle: 'Page is missing the HTML doctype', - /** Description of a Lighthouse audit that tells the user why they should set the doctype as HTML. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ + failureTitle: 'Page lacks the HTML doctype, thus triggering quirks-mode', + /** Description of a Lighthouse audit that tells the user why they should define an HTML doctype. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Specifying a doctype prevents the browser ' + 'from switching to quirks-mode. Read more on the ' + '[MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)', diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index 02a45b1ccc4e..f57c682870b2 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -18,10 +18,10 @@ const UIStrings = { description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + 'performance and prevent security vulnerabilities. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).', - /** Warning that some links' destinations cannot be determined and therefor neither can their safety. */ + /** Warning that some links' destinations cannot be determined and therefore the audit cannot evaluate the link's safety. */ warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' + 'If not used as a hyperlink, consider removing target=_blank.', - /** Table column header for the target of a URL. */ + /** Table column header for the target attribute of the link. Each entry is either an empty string or a string like `_blank`. */ columnTarget: 'Target', /** Table column header for the `rel=` value from the link. */ columnRel: 'Rel', diff --git a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js index 7e5b46e38ea0..208040e26c58 100644 --- a/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +++ b/lighthouse-core/audits/dobetterweb/geolocation-on-start.js @@ -15,13 +15,13 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on geolocation permissions requests. This descriptive title is shown to users when the page does not ask for geolocation permissions on load. */ + /** Title of a Lighthouse audit that provides detail on geolocation permission requests while the page is loading. This descriptive title is shown to users when the page does not ask for geolocation permissions on load. */ title: 'Avoids requesting the geolocation permission on page load', /** Title of a Lighthouse audit that provides detail on geolocation permissions requests. This descriptive title is shown to users when the page does ask for geolocation permissions on load. */ failureTitle: 'Requests the geolocation permission on page load', /** Description of a Lighthouse audit that tells the user why they should not ask for geolocation permissions on load. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Users are mistrustful of or confused by sites that request their ' + - 'location without context. Consider tying the request to user gestures instead. ' + + 'location without context. Consider tying the request to a user action instead. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).', }; diff --git a/lighthouse-core/audits/dobetterweb/no-document-write.js b/lighthouse-core/audits/dobetterweb/no-document-write.js index 0e605a145b24..832e70a4a0e8 100644 --- a/lighthouse-core/audits/dobetterweb/no-document-write.js +++ b/lighthouse-core/audits/dobetterweb/no-document-write.js @@ -14,11 +14,11 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does not use `Document.write`. */ + /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the site does not use `document.write`. */ title: 'Avoids `document.write()`', - /** Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does use `Document.write`. */ + /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the site does use `document.write`. */ failureTitle: 'Uses `document.write()`', - /** Description of a Lighthouse audit that tells the user why they should avoid `Document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ + /** Description of a Lighthouse audit that tells the user why they should avoid `document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'For users on slow connections, external scripts dynamically injected via ' + '`document.write()` can delay page load by tens of seconds. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).', diff --git a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js index ab4abda17e15..ac9f3ea96f62 100644 --- a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +++ b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js @@ -36,9 +36,9 @@ const UIStrings = { }`, /** Table column header for the version of the Javascript library found. */ columnVersion: 'Library Version', - /** Table column header for the count of vulnerabilities found. */ + /** Table column header for the count of vulnerabilities found within a JavaSscript library. */ columnVuln: 'Vulnerability Count', - /** Table column header for the severity of the vulnerabilities found in the detected Javascript libraries. */ + /** Table column header for the severity of the vulnerabilities found within a Javascript library. */ columnSeverity: 'Highest Severity', }; diff --git a/lighthouse-core/audits/dobetterweb/uses-http2.js b/lighthouse-core/audits/dobetterweb/uses-http2.js index dada680b862a..b6a31699deb8 100644 --- a/lighthouse-core/audits/dobetterweb/uses-http2.js +++ b/lighthouse-core/audits/dobetterweb/uses-http2.js @@ -17,19 +17,19 @@ const NetworkRecords = require('../../computed/network-records.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site uses HTTP/2 for its requests. */ + /** Title of a Lighthouse audit that provides detail on whether a website uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the site uses HTTP/2 for its requests. */ title: 'Uses HTTP/2 for its own resources', - /** Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site does not use HTTP/2 for its requests. */ + /** Title of a Lighthouse audit that provides detail on whether a website uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the site does not use HTTP/2 for its requests. */ failureTitle: 'Does not use HTTP/2 for all of its resources', /** Description of a Lighthouse audit that tells the user why they should use HTTP/2. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'HTTP/2 offers many benefits over HTTP/1.1, including binary headers, ' + 'multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).', - /** [ICU Syntax] Label for the audit identifying the number of requests that were not served with HTTP/2. */ + /** [ICU Syntax] Label identifying the number of network requests that were not served with HTTP/2. */ displayValue: `{itemCount, plural, =1 {1 request not served via HTTP/2} other {# requests not served via HTTP/2} }`, - /** Table column header for the HTTP Protocol used in a request. */ + /** Label for a column in a data table; entries in the column will be the HTTP Protocol used to make a network request. */ columnProtocol: 'Protocol', }; diff --git a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js index c49ae0f1aeef..04e570730d7b 100644 --- a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +++ b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js @@ -15,11 +15,11 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does use passive listeners. */ + /** Title of a Lighthouse audit that provides detail on the site's use of passive event listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does use passive listeners. */ title: 'Uses passive listeners to improve scrolling performance', - /** Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does not use passive listeners. */ + /** Title of a Lighthouse audit that provides detail on the site's use of passive event listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does not use passive listeners. */ failureTitle: 'Does not use passive listeners to improve scrolling performance', - /** Description of a Lighthouse audit that tells the user why they should use passive listeners on the site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ + /** Description of a Lighthouse audit that tells the user why they should use passive event listeners on the site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: '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).', diff --git a/lighthouse-core/audits/errors-in-console.js b/lighthouse-core/audits/errors-in-console.js index ec544721db45..22b6afae448b 100644 --- a/lighthouse-core/audits/errors-in-console.js +++ b/lighthouse-core/audits/errors-in-console.js @@ -16,12 +16,12 @@ const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { /** Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when no browser errors were logged into the devtools console. */ title: 'No browser errors logged to the console', - /** Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when browser errors were logged into the devtools console. */ + /** Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when browser errors occurred and were logged into the devtools console. */ failureTitle: 'Browser errors were logged to the console', - /** Description of a Lighthouse audit that tells the user why they should not log errors into the console. This is displayed after a user expands the section to see more. No character length limits. */ + /** Description of a Lighthouse audit that tells the user why errors being logged to the devtools console are a cause for concern and so should be fixed. This is displayed after a user expands the section to see more. No character length limits. */ description: 'Errors logged to the console indicate unresolved problems. ' + 'They can come from network request failures and other browser concerns.', - /** Table column header for the description of the browser error that was logged. */ + /** Label for a column in a data table; entries in the column will be the descriptions of logged browser errors. */ columnDesc: 'Description', }; diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index c69cdb8a82f6..ae4c41c1a936 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -25,9 +25,9 @@ const UIStrings = { '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).', /** Warning that the sizing information cannot be collected for an image. */ warningCompute: 'Invalid image sizing information {url}', - /** Table column header for the displayed aspect ratio of an image. */ + /** Label for a column in a data table; entries in the column will be the numeric aspect ratio of an image as displayed in a web page. */ columnDisplayed: 'Aspect Ratio (Displayed)', - /** Table column header for the actual aspect ratio of an image. */ + /** Label for a column in a data table; entries in the column will be the numeric aspect ratio of the raw (actual) image. */ columnActual: 'Aspect Ratio (Actual)', }; diff --git a/lighthouse-core/audits/is-on-https.js b/lighthouse-core/audits/is-on-https.js index 85e86f3b8247..9b1d245fdfff 100644 --- a/lighthouse-core/audits/is-on-https.js +++ b/lighthouse-core/audits/is-on-https.js @@ -21,12 +21,12 @@ const UIStrings = { '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).', - /** [ICU Syntax] Label for the audit identifying the number of insecure requests found. */ + /** [ICU Syntax] Label identifying the number of insecure network requests found by an audit of a web page. */ displayValue: `{itemCount, plural, =1 {1 insecure request found} other {# insecure requests found} }`, - /** Table column header for the URL's of non-HTTPS requests. */ + /** Label for a column in a data table; entries in the column will be the URLs of insecure (non-HTTPS) network requests. */ columnInsecureURL: 'Insecure URL', }; From e50a72e441d396772362cf5773996e539a2d9746 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 12 Jun 2019 09:57:07 -0400 Subject: [PATCH 08/12] replace 'site' with 'page' in description strings --- lighthouse-core/audits/deprecations.js | 6 +- lighthouse-core/audits/dobetterweb/doctype.js | 4 +- .../external-anchors-use-rel-noopener.js | 4 +- .../audits/dobetterweb/js-libraries.js | 2 +- .../audits/dobetterweb/no-document-write.js | 4 +- .../dobetterweb/no-vulnerable-libraries.js | 4 +- .../dobetterweb/notification-on-start.js | 4 +- .../password-inputs-can-be-pasted-into.js | 4 +- .../audits/dobetterweb/uses-http2.js | 4 +- .../uses-passive-event-listeners.js | 6 +- lighthouse-core/audits/image-aspect-ratio.js | 4 +- lighthouse-core/lib/i18n/en-US.json | 86 +++++++++---------- 12 files changed, 66 insertions(+), 66 deletions(-) diff --git a/lighthouse-core/audits/deprecations.js b/lighthouse-core/audits/deprecations.js index fadd132cdbcf..f7eb7b14bfb2 100644 --- a/lighthouse-core/audits/deprecations.js +++ b/lighthouse-core/audits/deprecations.js @@ -15,11 +15,11 @@ const Audit = require('./audit.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site does not use deprecated APIs. */ + /** Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the page does not use deprecated APIs. */ title: 'Avoids deprecated APIs', - /** Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site uses deprecated APIs. */ + /** Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the page uses deprecated APIs. */ failureTitle: 'Uses deprecated APIs', - /** Description of a Lighthouse audit that tells the user why they should not use deprecated APIs on their site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ + /** Description of a Lighthouse audit that tells the user why they should not use deprecated APIs on their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Deprecated APIs will eventually be removed from the browser. ' + '[Learn more](https://www.chromestatus.com/features#deprecated).', /** [ICU Syntax] Label for the audit identifying the number of warnings generated by using deprecated APIs. */ diff --git a/lighthouse-core/audits/dobetterweb/doctype.js b/lighthouse-core/audits/dobetterweb/doctype.js index 49281d37ad44..48f38df9c789 100644 --- a/lighthouse-core/audits/dobetterweb/doctype.js +++ b/lighthouse-core/audits/dobetterweb/doctype.js @@ -9,9 +9,9 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is set to HTML. */ + /** Title of a Lighthouse audit that provides detail on the doctype of a page. This descriptive title is shown to users when the pages's doctype is set to HTML. */ title: 'Page has the HTML doctype', - /** Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is not set to HTML. */ + /** Title of a Lighthouse audit that provides detail on the doctype of a page. This descriptive title is shown to users when the page's doctype is not set to HTML. */ failureTitle: 'Page lacks the HTML doctype, thus triggering quirks-mode', /** Description of a Lighthouse audit that tells the user why they should define an HTML doctype. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Specifying a doctype prevents the browser ' + diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index f57c682870b2..7c504c1a479d 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -10,9 +10,9 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe. */ + /** Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe. */ title: 'Links to cross-origin destinations are safe', - /** Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */ + /** Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */ failureTitle: 'Links to cross-origin destinations are unsafe', /** Description of a Lighthouse audit that tells the user why and how they should secure cross-origin links. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + diff --git a/lighthouse-core/audits/dobetterweb/js-libraries.js b/lighthouse-core/audits/dobetterweb/js-libraries.js index 34b9e5a442c6..676866fb4f40 100644 --- a/lighthouse-core/audits/dobetterweb/js-libraries.js +++ b/lighthouse-core/audits/dobetterweb/js-libraries.js @@ -14,7 +14,7 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a site. */ + /** Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a page. */ title: 'Detected JavaScript libraries', /** Description of a Lighthouse audit that tells the user what this audit is detecting. This is displayed after a user expands the section to see more. No character length limits. */ description: 'All front-end JavaScript libraries detected on the page.', diff --git a/lighthouse-core/audits/dobetterweb/no-document-write.js b/lighthouse-core/audits/dobetterweb/no-document-write.js index 832e70a4a0e8..77368e048fba 100644 --- a/lighthouse-core/audits/dobetterweb/no-document-write.js +++ b/lighthouse-core/audits/dobetterweb/no-document-write.js @@ -14,9 +14,9 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the site does not use `document.write`. */ + /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does not use `document.write`. */ title: 'Avoids `document.write()`', - /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the site does use `document.write`. */ + /** Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does use `document.write`. */ failureTitle: 'Uses `document.write()`', /** Description of a Lighthouse audit that tells the user why they should avoid `document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'For users on slow connections, external scripts dynamically injected via ' + diff --git a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js index ac9f3ea96f62..50eabd24310a 100644 --- a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +++ b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js @@ -19,10 +19,10 @@ const snykDatabase = require('../../../third-party/snyk/snapshot.json'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when all Javascript libraries are free of known security vulnerabilities. */ + /** Title of a Lighthouse audit that provides detail on Javascript libraries the page uses. This descriptive title is shown to users when all Javascript libraries are free of known security vulnerabilities. */ title: 'Avoids front-end JavaScript libraries' + ' with known security vulnerabilities', - /** Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when some detected Javascript libraries have known security vulnerabilities. */ + /** Title of a Lighthouse audit that provides detail on Javascript libraries the page uses. This descriptive title is shown to users when some detected Javascript libraries have known security vulnerabilities. */ failureTitle: 'Includes front-end JavaScript libraries' + ' with known security vulnerabilities', /** Description of a Lighthouse audit that tells the user why they should be concerned about the third party Javascript libraries that they use. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ diff --git a/lighthouse-core/audits/dobetterweb/notification-on-start.js b/lighthouse-core/audits/dobetterweb/notification-on-start.js index ea62e3a85bd3..25559a96cec0 100644 --- a/lighthouse-core/audits/dobetterweb/notification-on-start.js +++ b/lighthouse-core/audits/dobetterweb/notification-on-start.js @@ -15,9 +15,9 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does not ask for notification permission on load. */ + /** Title of a Lighthouse audit that provides detail on the page's notification permission requests. This descriptive title is shown to users when the page does not ask for notification permission on load. */ title: 'Avoids requesting the notification permission on page load', - /** Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does ask for notification permission on load. */ + /** Title of a Lighthouse audit that provides detail on the page's notification permission requests. This descriptive title is shown to users when the page does ask for notification permission on load. */ failureTitle: 'Requests the notification permission on page load', /** Description of a Lighthouse audit that tells the user why they should not ask for notification permission on load. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Users are mistrustful of or confused by sites that request to send ' + diff --git a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js index f738b032a878..f75d1f172d2a 100644 --- a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +++ b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js @@ -9,9 +9,9 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site allows pasting of content into password fields. */ + /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page allows pasting of content into password fields. */ title: 'Allows users to paste into password fields', - /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site does not allow pasting of content into password fields. */ + /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page does not allow pasting of content into password fields. */ failureTitle: 'Prevents users to paste into password fields', /** Description of a Lighthouse audit that tells the user why they should allow pasting of content into password fields. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Preventing password pasting undermines good security policy. ' + diff --git a/lighthouse-core/audits/dobetterweb/uses-http2.js b/lighthouse-core/audits/dobetterweb/uses-http2.js index b6a31699deb8..50e6f8746586 100644 --- a/lighthouse-core/audits/dobetterweb/uses-http2.js +++ b/lighthouse-core/audits/dobetterweb/uses-http2.js @@ -17,9 +17,9 @@ const NetworkRecords = require('../../computed/network-records.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on whether a website uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the site uses HTTP/2 for its requests. */ + /** Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page uses HTTP/2 for its requests. */ title: 'Uses HTTP/2 for its own resources', - /** Title of a Lighthouse audit that provides detail on whether a website uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the site does not use HTTP/2 for its requests. */ + /** Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page does not use HTTP/2 for its requests. */ failureTitle: 'Does not use HTTP/2 for all of its resources', /** Description of a Lighthouse audit that tells the user why they should use HTTP/2. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'HTTP/2 offers many benefits over HTTP/1.1, including binary headers, ' + diff --git a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js index 04e570730d7b..24e476c0a8c4 100644 --- a/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +++ b/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js @@ -15,11 +15,11 @@ const ViolationAudit = require('../violation-audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the site's use of passive event listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does use passive listeners. */ + /** Title of a Lighthouse audit that provides detail on the page's use of passive event listeners used to improve the scrolling performance of the page. This descriptive title is shown to users when the page does use passive listeners. */ title: 'Uses passive listeners to improve scrolling performance', - /** Title of a Lighthouse audit that provides detail on the site's use of passive event listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does not use passive listeners. */ + /** Title of a Lighthouse audit that provides detail on the page's use of passive event listeners used to improve the scrolling performance of the page. This descriptive title is shown to users when the page does not use passive listeners. */ failureTitle: 'Does not use passive listeners to improve scrolling performance', - /** Description of a Lighthouse audit that tells the user why they should use passive event listeners on the site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ + /** Description of a Lighthouse audit that tells the user why they should use passive event listeners on the page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: '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).', diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index ae4c41c1a936..bded9297f7b8 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -16,9 +16,9 @@ const URL = require('../lib/url-shim.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when all images use correct aspect ratios. */ + /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when all images use correct aspect ratios. */ title: 'Displays images with correct aspect ratio', - /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when not all images use correct aspect ratios. */ + /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when not all images use correct aspect ratios. */ failureTitle: 'Displays images with incorrect aspect ratio', /** Description of a Lighthouse audit that tells the user why they should maintain the correct aspect ratios for all images. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Image display dimensions should match natural aspect ratio. ' + diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 25991ae81d14..d882459d9f89 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -601,15 +601,15 @@ }, "lighthouse-core/audits/deprecations.js | columnDeprecate": { "message": "Deprecation / Warning", - "description": "Table column header for the deprecation or warning generated by the site." + "description": "Header of the table column which displays the warning message describing use of a deprecated API by code running in the web page." }, "lighthouse-core/audits/deprecations.js | columnLine": { "message": "Line", - "description": "Table column header for line that is using a deprecated API on the site." + "description": "Table column header for line of code (eg. 432) that is using a deprecated API." }, "lighthouse-core/audits/deprecations.js | description": { "message": "Deprecated APIs will eventually be removed from the browser. [Learn more](https://www.chromestatus.com/features#deprecated).", - "description": "Description of a Lighthouse audit that tells the user why they should not use deprecated APIs on their site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." + "description": "Description of a Lighthouse audit that tells the user why they should not use deprecated APIs on their page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/deprecations.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 warning found}\n other {# warnings found}\n }", @@ -617,11 +617,11 @@ }, "lighthouse-core/audits/deprecations.js | failureTitle": { "message": "Uses deprecated APIs", - "description": "Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site uses deprecated APIs." + "description": "Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the page uses deprecated APIs." }, "lighthouse-core/audits/deprecations.js | title": { "message": "Avoids deprecated APIs", - "description": "Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the site does not use deprecated APIs." + "description": "Title of a Lighthouse audit that provides detail on the use of deprecated APIs. This descriptive title is shown to users when the page does not use deprecated APIs." }, "lighthouse-core/audits/dobetterweb/appcache-manifest.js | description": { "message": "Application Cache is deprecated. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/appcache).", @@ -641,7 +641,7 @@ }, "lighthouse-core/audits/dobetterweb/doctype.js | description": { "message": "Specifying a doctype prevents the browser from switching to quirks-mode. Read more on the [MDN Web Docs page](https://developer.mozilla.org/en-US/docs/Glossary/Doctype)", - "description": "Description of a Lighthouse audit that tells the user why they should set the doctype as HTML. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." + "description": "Description of a Lighthouse audit that tells the user why they should define an HTML doctype. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/doctype.js | explanationBadDoctype": { "message": "Doctype name must be the lowercase string `html`", @@ -660,12 +660,12 @@ "description": "Explanatory message stating that the systemId field is not empty." }, "lighthouse-core/audits/dobetterweb/doctype.js | failureTitle": { - "message": "Page is missing the HTML doctype", - "description": "Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is not set to HTML." + "message": "Page lacks the HTML doctype, thus triggering quirks-mode", + "description": "Title of a Lighthouse audit that provides detail on the doctype of a page. This descriptive title is shown to users when the page's doctype is not set to HTML." }, "lighthouse-core/audits/dobetterweb/doctype.js | title": { "message": "Page has the HTML doctype", - "description": "Title of a Lighthouse audit that provides detail on the doctype of a site. This descriptive title is shown to users when the site's doctype is set to HTML." + "description": "Title of a Lighthouse audit that provides detail on the doctype of a page. This descriptive title is shown to users when the pages's doctype is set to HTML." }, "lighthouse-core/audits/dobetterweb/dom-size.js | columnElement": { "message": "Element", @@ -713,7 +713,7 @@ }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnTarget": { "message": "Target", - "description": "Table column header for the target of a URL." + "description": "Table column header for the target attribute of the link. Each entry is either an empty string or a string like `_blank`." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | description": { "message": "Add `rel=\"noopener\"` or `rel=\"noreferrer\"` to any external links to improve performance and prevent security vulnerabilities. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).", @@ -721,18 +721,18 @@ }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | failureTitle": { "message": "Links to cross-origin destinations are unsafe", - "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe." + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | title": { "message": "Links to cross-origin destinations are safe", - "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a site contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe." + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | warning": { "message": "Unable to determine the destination for anchor ({anchorHTML}). If not used as a hyperlink, consider removing target=_blank.", - "description": "Warning that some links' destinations cannot be determined and therefor neither can their safety." + "description": "Warning that some links' destinations cannot be determined and therefore the audit cannot evaluate the link's safety." }, "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | description": { - "message": "Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to user gestures instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).", + "message": "Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to a user action instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).", "description": "Description of a Lighthouse audit that tells the user why they should not ask for geolocation permissions on load. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | failureTitle": { @@ -741,7 +741,7 @@ }, "lighthouse-core/audits/dobetterweb/geolocation-on-start.js | title": { "message": "Avoids requesting the geolocation permission on page load", - "description": "Title of a Lighthouse audit that provides detail on geolocation permissions requests. This descriptive title is shown to users when the page does not ask for geolocation permissions on load." + "description": "Title of a Lighthouse audit that provides detail on geolocation permission requests while the page is loading. This descriptive title is shown to users when the page does not ask for geolocation permissions on load." }, "lighthouse-core/audits/dobetterweb/js-libraries.js | columnName": { "message": "Name", @@ -757,23 +757,23 @@ }, "lighthouse-core/audits/dobetterweb/js-libraries.js | title": { "message": "Detected JavaScript libraries", - "description": "Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a site." + "description": "Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a page." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | description": { "message": "For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).", - "description": "Description of a Lighthouse audit that tells the user why they should avoid `Document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." + "description": "Description of a Lighthouse audit that tells the user why they should avoid `document.write`. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | failureTitle": { "message": "Uses `document.write()`", - "description": "Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does use `Document.write`." + "description": "Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does use `document.write`." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | title": { "message": "Avoids `document.write()`", - "description": "Title of a Lighthouse audit that provides detail on the page's use of the `Document.write` API. This descriptive title is shown to users when the site does not use `Document.write`." + "description": "Title of a Lighthouse audit that provides detail on the page's use of the `document.write` API. This descriptive title is shown to users when the page does not use `document.write`." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnSeverity": { "message": "Highest Severity", - "description": "Table column header for the severity of the vulnerabilities found in the detected Javascript libraries." + "description": "Table column header for the severity of the vulnerabilities found within a Javascript library." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVersion": { "message": "Library Version", @@ -781,7 +781,7 @@ }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVuln": { "message": "Vulnerability Count", - "description": "Table column header for the count of vulnerabilities found." + "description": "Table column header for the count of vulnerabilities found within a JavaSscript library." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | description": { "message": "Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).", @@ -793,11 +793,11 @@ }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | failureTitle": { "message": "Includes front-end JavaScript libraries with known security vulnerabilities", - "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when some detected Javascript libraries have known security vulnerabilities." + "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the page uses. This descriptive title is shown to users when some detected Javascript libraries have known security vulnerabilities." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | title": { "message": "Avoids front-end JavaScript libraries with known security vulnerabilities", - "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the site uses. This descriptive title is shown to users when all Javascript libraries are free of known security vulnerabilities." + "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the page uses. This descriptive title is shown to users when all Javascript libraries are free of known security vulnerabilities." }, "lighthouse-core/audits/dobetterweb/notification-on-start.js | description": { "message": "Users are mistrustful of or confused by sites that request to send notifications without context. Consider tying the request to user gestures instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/notifications-on-load).", @@ -805,11 +805,11 @@ }, "lighthouse-core/audits/dobetterweb/notification-on-start.js | failureTitle": { "message": "Requests the notification permission on page load", - "description": "Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does ask for notification permission on load." + "description": "Title of a Lighthouse audit that provides detail on the page's notification permission requests. This descriptive title is shown to users when the page does ask for notification permission on load." }, "lighthouse-core/audits/dobetterweb/notification-on-start.js | title": { "message": "Avoids requesting the notification permission on page load", - "description": "Title of a Lighthouse audit that provides detail on the sites' notification permission requests. This descriptive title is shown to users when the page does not ask for notification permission on load." + "description": "Title of a Lighthouse audit that provides detail on the page's notification permission requests. This descriptive title is shown to users when the page does not ask for notification permission on load." }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | columnFailingElem": { "message": "Failing Elements", @@ -821,15 +821,15 @@ }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | failureTitle": { "message": "Prevents users to paste into password fields", - "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site does not allow pasting of content into password fields." + "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page does not allow pasting of content into password fields." }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | title": { "message": "Allows users to paste into password fields", - "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a site allows pasting of content into password fields." + "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page allows pasting of content into password fields." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | columnProtocol": { "message": "Protocol", - "description": "Table column header for the HTTP Protocol used in a request." + "description": "Label for a column in a data table; entries in the column will be the HTTP Protocol used to make a network request." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | description": { "message": "HTTP/2 offers many benefits over HTTP/1.1, including binary headers, multiplexing, and server push. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/http2).", @@ -837,39 +837,39 @@ }, "lighthouse-core/audits/dobetterweb/uses-http2.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 request not served via HTTP/2}\n other {# requests not served via HTTP/2}\n }", - "description": "[ICU Syntax] Label for the audit identifying the number of requests that were not served with HTTP/2." + "description": "[ICU Syntax] Label identifying the number of network requests that were not served with HTTP/2." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | failureTitle": { "message": "Does not use HTTP/2 for all of its resources", - "description": "Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site does not use HTTP/2 for its requests." + "description": "Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page does not use HTTP/2 for its requests." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | title": { "message": "Uses HTTP/2 for its own resources", - "description": "Title of a Lighthouse audit that provides detail on whether the site uses HTTP/2 for its requested resources. This descriptive title is shown to users when the site uses HTTP/2 for its requests." + "description": "Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page uses HTTP/2 for its requests." }, "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | description": { "message": "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).", - "description": "Description of a Lighthouse audit that tells the user why they should use passive listeners on the site. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." + "description": "Description of a Lighthouse audit that tells the user why they should use passive event listeners on the page. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation." }, "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | failureTitle": { "message": "Does not use passive listeners to improve scrolling performance", - "description": "Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does not use passive listeners." + "description": "Title of a Lighthouse audit that provides detail on the page's use of passive event listeners used to improve the scrolling performance of the page. This descriptive title is shown to users when the page does not use passive listeners." }, "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | title": { "message": "Uses passive listeners to improve scrolling performance", - "description": "Title of a Lighthouse audit that provides detail on the site's use of passive listeners used to improve the scrolling performance of the site. This descriptive title is shown to users when the site does use passive listeners." + "description": "Title of a Lighthouse audit that provides detail on the page's use of passive event listeners used to improve the scrolling performance of the page. This descriptive title is shown to users when the page does use passive listeners." }, "lighthouse-core/audits/errors-in-console.js | columnDesc": { "message": "Description", - "description": "Table column header for the description of the browser error that was logged." + "description": "Label for a column in a data table; entries in the column will be the descriptions of logged browser errors." }, "lighthouse-core/audits/errors-in-console.js | description": { "message": "Errors logged to the console indicate unresolved problems. They can come from network request failures and other browser concerns.", - "description": "Description of a Lighthouse audit that tells the user why they should not log errors into the console. This is displayed after a user expands the section to see more. No character length limits." + "description": "Description of a Lighthouse audit that tells the user why errors being logged to the devtools console are a cause for concern and so should be fixed. This is displayed after a user expands the section to see more. No character length limits." }, "lighthouse-core/audits/errors-in-console.js | failureTitle": { "message": "Browser errors were logged to the console", - "description": "Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when browser errors were logged into the devtools console." + "description": "Title of a Lighthouse audit that provides detail on browser errors. This descriptive title is shown to users when browser errors occurred and were logged into the devtools console." }, "lighthouse-core/audits/errors-in-console.js | title": { "message": "No browser errors logged to the console", @@ -889,11 +889,11 @@ }, "lighthouse-core/audits/image-aspect-ratio.js | columnActual": { "message": "Aspect Ratio (Actual)", - "description": "Table column header for the actual aspect ratio of an image." + "description": "Label for a column in a data table; entries in the column will be the numeric aspect ratio of the raw (actual) image." }, "lighthouse-core/audits/image-aspect-ratio.js | columnDisplayed": { "message": "Aspect Ratio (Displayed)", - "description": "Table column header for the displayed aspect ratio of an image." + "description": "Label for a column in a data table; entries in the column will be the numeric aspect ratio of an image as displayed in a web page." }, "lighthouse-core/audits/image-aspect-ratio.js | description": { "message": "Image display dimensions should match natural aspect ratio. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).", @@ -901,11 +901,11 @@ }, "lighthouse-core/audits/image-aspect-ratio.js | failureTitle": { "message": "Displays images with incorrect aspect ratio", - "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when not all images use correct aspect ratios." + "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when not all images use correct aspect ratios." }, "lighthouse-core/audits/image-aspect-ratio.js | title": { "message": "Displays images with correct aspect ratio", - "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a site. This descriptive title is shown to users when all images use correct aspect ratios." + "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when all images use correct aspect ratios." }, "lighthouse-core/audits/image-aspect-ratio.js | warningCompute": { "message": "Invalid image sizing information {url}", @@ -913,7 +913,7 @@ }, "lighthouse-core/audits/is-on-https.js | columnInsecureURL": { "message": "Insecure URL", - "description": "Table column header for the URL's of non-HTTPS requests." + "description": "Label for a column in a data table; entries in the column will be the URLs of insecure (non-HTTPS) network requests." }, "lighthouse-core/audits/is-on-https.js | description": { "message": "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).", @@ -921,7 +921,7 @@ }, "lighthouse-core/audits/is-on-https.js | displayValue": { "message": "{itemCount, plural,\n =1 {1 insecure request found}\n other {# insecure requests found}\n }", - "description": "[ICU Syntax] Label for the audit identifying the number of insecure requests found." + "description": "[ICU Syntax] Label identifying the number of insecure network requests found by an audit of a web page." }, "lighthouse-core/audits/is-on-https.js | failureTitle": { "message": "Does not use HTTPS", From ed99afe371eea8f1bf8fd08954c0243dc831df26 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 12 Jun 2019 09:59:48 -0400 Subject: [PATCH 09/12] a page -> the page --- .../external-anchors-use-rel-noopener.js | 4 ++-- .../audits/dobetterweb/js-libraries.js | 2 +- .../password-inputs-can-be-pasted-into.js | 4 ++-- .../audits/dobetterweb/uses-http2.js | 4 ++-- lighthouse-core/audits/image-aspect-ratio.js | 4 ++-- lighthouse-core/lib/i18n/en-US.json | 18 +++++++++--------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index 7c504c1a479d..5960304b44e9 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -10,9 +10,9 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe. */ + /** Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe. */ title: 'Links to cross-origin destinations are safe', - /** Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */ + /** Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */ failureTitle: 'Links to cross-origin destinations are unsafe', /** Description of a Lighthouse audit that tells the user why and how they should secure cross-origin links. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + diff --git a/lighthouse-core/audits/dobetterweb/js-libraries.js b/lighthouse-core/audits/dobetterweb/js-libraries.js index 676866fb4f40..02a546d8f61f 100644 --- a/lighthouse-core/audits/dobetterweb/js-libraries.js +++ b/lighthouse-core/audits/dobetterweb/js-libraries.js @@ -14,7 +14,7 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a page. */ + /** Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on the page. */ title: 'Detected JavaScript libraries', /** Description of a Lighthouse audit that tells the user what this audit is detecting. This is displayed after a user expands the section to see more. No character length limits. */ description: 'All front-end JavaScript libraries detected on the page.', diff --git a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js index f75d1f172d2a..b417988ca634 100644 --- a/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +++ b/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js @@ -9,9 +9,9 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page allows pasting of content into password fields. */ + /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when the page allows pasting of content into password fields. */ title: 'Allows users to paste into password fields', - /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page does not allow pasting of content into password fields. */ + /** Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when the page does not allow pasting of content into password fields. */ failureTitle: 'Prevents users to paste into password fields', /** Description of a Lighthouse audit that tells the user why they should allow pasting of content into password fields. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Preventing password pasting undermines good security policy. ' + diff --git a/lighthouse-core/audits/dobetterweb/uses-http2.js b/lighthouse-core/audits/dobetterweb/uses-http2.js index 50e6f8746586..73d2524fb612 100644 --- a/lighthouse-core/audits/dobetterweb/uses-http2.js +++ b/lighthouse-core/audits/dobetterweb/uses-http2.js @@ -17,9 +17,9 @@ const NetworkRecords = require('../../computed/network-records.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page uses HTTP/2 for its requests. */ + /** Title of a Lighthouse audit that provides detail on whether the webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page uses HTTP/2 for its requests. */ title: 'Uses HTTP/2 for its own resources', - /** Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page does not use HTTP/2 for its requests. */ + /** Title of a Lighthouse audit that provides detail on whether the webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page does not use HTTP/2 for its requests. */ failureTitle: 'Does not use HTTP/2 for all of its resources', /** Description of a Lighthouse audit that tells the user why they should use HTTP/2. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'HTTP/2 offers many benefits over HTTP/1.1, including binary headers, ' + diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index bded9297f7b8..d46036e04178 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -16,9 +16,9 @@ const URL = require('../lib/url-shim.js'); const i18n = require('../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when all images use correct aspect ratios. */ + /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on the page. This descriptive title is shown to users when all images use correct aspect ratios. */ title: 'Displays images with correct aspect ratio', - /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when not all images use correct aspect ratios. */ + /** Title of a Lighthouse audit that provides detail on the aspect ratios of all images on the page. This descriptive title is shown to users when not all images use correct aspect ratios. */ failureTitle: 'Displays images with incorrect aspect ratio', /** Description of a Lighthouse audit that tells the user why they should maintain the correct aspect ratios for all images. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Image display dimensions should match natural aspect ratio. ' + diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index d882459d9f89..7121476c2d7e 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -721,11 +721,11 @@ }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | failureTitle": { "message": "Links to cross-origin destinations are unsafe", - "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe." + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | title": { "message": "Links to cross-origin destinations are safe", - "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that a page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe." + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | warning": { "message": "Unable to determine the destination for anchor ({anchorHTML}). If not used as a hyperlink, consider removing target=_blank.", @@ -757,7 +757,7 @@ }, "lighthouse-core/audits/dobetterweb/js-libraries.js | title": { "message": "Detected JavaScript libraries", - "description": "Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on a page." + "description": "Title of a Lighthouse audit that provides detail on the Javascript libraries that are used on the page." }, "lighthouse-core/audits/dobetterweb/no-document-write.js | description": { "message": "For users on slow connections, external scripts dynamically injected via `document.write()` can delay page load by tens of seconds. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/document-write).", @@ -821,11 +821,11 @@ }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | failureTitle": { "message": "Prevents users to paste into password fields", - "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page does not allow pasting of content into password fields." + "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when the page does not allow pasting of content into password fields." }, "lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js | title": { "message": "Allows users to paste into password fields", - "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when a page allows pasting of content into password fields." + "description": "Title of a Lighthouse audit that provides detail on the ability to paste into password fields. This descriptive title is shown to users when the page allows pasting of content into password fields." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | columnProtocol": { "message": "Protocol", @@ -841,11 +841,11 @@ }, "lighthouse-core/audits/dobetterweb/uses-http2.js | failureTitle": { "message": "Does not use HTTP/2 for all of its resources", - "description": "Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page does not use HTTP/2 for its requests." + "description": "Title of a Lighthouse audit that provides detail on whether the webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page does not use HTTP/2 for its requests." }, "lighthouse-core/audits/dobetterweb/uses-http2.js | title": { "message": "Uses HTTP/2 for its own resources", - "description": "Title of a Lighthouse audit that provides detail on whether a webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page uses HTTP/2 for its requests." + "description": "Title of a Lighthouse audit that provides detail on whether the webpage uses HTTP/2 for resources it requests over the network. This descriptive title is shown to users when the page uses HTTP/2 for its requests." }, "lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js | description": { "message": "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).", @@ -901,11 +901,11 @@ }, "lighthouse-core/audits/image-aspect-ratio.js | failureTitle": { "message": "Displays images with incorrect aspect ratio", - "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when not all images use correct aspect ratios." + "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on the page. This descriptive title is shown to users when not all images use correct aspect ratios." }, "lighthouse-core/audits/image-aspect-ratio.js | title": { "message": "Displays images with correct aspect ratio", - "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on a page. This descriptive title is shown to users when all images use correct aspect ratios." + "description": "Title of a Lighthouse audit that provides detail on the aspect ratios of all images on the page. This descriptive title is shown to users when all images use correct aspect ratios." }, "lighthouse-core/audits/image-aspect-ratio.js | warningCompute": { "message": "Invalid image sizing information {url}", From cc06d9d89c942a1191f81db73650481edbedad3f Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Wed, 12 Jun 2019 10:08:00 -0400 Subject: [PATCH 10/12] Converted column description strings to new format --- lighthouse-core/lib/i18n/en-US.json | 14 +++++++------- lighthouse-core/lib/i18n/i18n.js | 18 +++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index 7121476c2d7e..085a0eafe127 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -1529,11 +1529,11 @@ }, "lighthouse-core/lib/i18n/i18n.js | columnCacheTTL": { "message": "Cache TTL", - "description": "Label for the TTL column in data tables, entries will be the time to live value of the cache header on a web resource" + "description": "Label for a column in a data table; entries will be the time to live value of the cache header on a web resource." }, "lighthouse-core/lib/i18n/i18n.js | columnLocation": { "message": "Location", - "description": "Label for the location column in data tables, entries will be the location of a specific entity, the entity may be a file in a directory, or a place in the world, it is generic" + "description": "Label for a column in a data table; entries will be the location of a specific line of code in a file, in the format \"line: 102\"." }, "lighthouse-core/lib/i18n/i18n.js | columnRequests": { "message": "Requests", @@ -1545,11 +1545,11 @@ }, "lighthouse-core/lib/i18n/i18n.js | columnSize": { "message": "Size", - "description": "Label for the size column in data tables, entries will be the size of a web resource in kilobytes" + "description": "Label for a column in a data table; entries will be the size of a web resource in kilobytes." }, "lighthouse-core/lib/i18n/i18n.js | columnTimeSpent": { "message": "Time Spent", - "description": "Label for the time spent column in data tables, entries will be the number of milliseconds spent during a particular activity" + "description": "Label for a column in a data table; entries will be the number of milliseconds spent during a particular activity." }, "lighthouse-core/lib/i18n/i18n.js | columnTransferSize": { "message": "Transfer Size", @@ -1557,15 +1557,15 @@ }, "lighthouse-core/lib/i18n/i18n.js | columnURL": { "message": "URL", - "description": "Label for the URL column in data tables, entries will be the URL of a web resource" + "description": "Label for a column in a data table; entries will be the URL of a web resource" }, "lighthouse-core/lib/i18n/i18n.js | columnWastedBytes": { "message": "Potential Savings", - "description": "Label for the wasted bytes column in data tables, entries will be the number of kilobytes the user could reduce their page by if they implemented the suggestions" + "description": "Label for a column in a data table; entries will be the number of kilobytes the user could reduce their page by if they implemented the suggestions." }, "lighthouse-core/lib/i18n/i18n.js | columnWastedMs": { "message": "Potential Savings", - "description": "Label for the wasted bytes column in data tables, entries will be the number of milliseconds the user could reduce page load by if they implemented the suggestions" + "description": "Label for a column in a data table; entries will be the number of milliseconds the user could reduce page load by if they implemented the suggestions." }, "lighthouse-core/lib/i18n/i18n.js | displayValueByteSavings": { "message": "Potential savings of {wastedBytes, number, bytes} KB", diff --git a/lighthouse-core/lib/i18n/i18n.js b/lighthouse-core/lib/i18n/i18n.js index 2ead1d9bcf8d..05d9e95e5b02 100644 --- a/lighthouse-core/lib/i18n/i18n.js +++ b/lighthouse-core/lib/i18n/i18n.js @@ -44,25 +44,25 @@ const UIStrings = { displayValueByteSavings: 'Potential savings of {wastedBytes, number, bytes}\xa0KB', /** Label shown per-audit to show how many milliseconds faster the page load could be if the user implemented the suggestions. The `{wastedMs}` placeholder will be replaced with the time duration, shown in milliseconds (e.g. 140 ms) */ displayValueMsSavings: 'Potential savings of {wastedMs, number, milliseconds}\xa0ms', - /** Label for the URL column in data tables, entries will be the URL of a web resource */ + /** Label for a column in a data table; entries will be the URL of a web resource */ columnURL: 'URL', - /** Label for the size column in data tables, entries will be the size of a web resource in kilobytes */ + /** Label for a column in a data table; entries will be the size of a web resource in kilobytes. */ columnSize: 'Size', - /** Label for the TTL column in data tables, entries will be the time to live value of the cache header on a web resource */ + /** Label for a column in a data table; entries will be the time to live value of the cache header on a web resource. */ columnCacheTTL: 'Cache TTL', - /** Label for the wasted bytes column in data tables, entries will be the number of kilobytes the user could reduce their page by if they implemented the suggestions */ + /** Label for a column in a data table; entries will be the number of kilobytes the user could reduce their page by if they implemented the suggestions. */ columnWastedBytes: 'Potential Savings', - /** Label for the wasted bytes column in data tables, entries will be the number of milliseconds the user could reduce page load by if they implemented the suggestions */ + /** Label for a column in a data table; entries will be the number of milliseconds the user could reduce page load by if they implemented the suggestions. */ columnWastedMs: 'Potential Savings', - /** Label for the time spent column in data tables, entries will be the number of milliseconds spent during a particular activity */ + /** Label for a column in a data table; entries will be the number of milliseconds spent during a particular activity. */ columnTimeSpent: 'Time Spent', - /** Label for the location column in data tables, entries will be the location of a specific entity, the entity may be a file in a directory, or a place in the world, it is generic */ + /** Label for a column in a data table; entries will be the location of a specific line of code in a file, in the format "line: 102". */ columnLocation: 'Location', /** Label for a column in a data table; entries will be types of resources loaded over the network, e.g. "Scripts", "Third-Party", "Stylesheet". */ columnResourceType: 'Resource Type', - /** Label for a column in a data table; entries will be the number of network requests done by a webpage.*/ + /** Label for a column in a data table; entries will be the number of network requests done by a webpage. */ columnRequests: 'Requests', - /** Label for a column in a data table; entries will be the number of kilobytes transferred to load a set of files.*/ + /** Label for a column in a data table; entries will be the number of kilobytes transferred to load a set of files. */ columnTransferSize: 'Transfer Size', /** Label for a row in a data table; entries will be the total number and byte size of all resources loaded by a web page. */ totalResourceType: 'Total', From fa189b67bdeb30ec7ad595e7bd191cb2d02150b6 Mon Sep 17 00:00:00 2001 From: Shane Exterkamp Date: Tue, 25 Jun 2019 11:41:57 -0700 Subject: [PATCH 11/12] brendan foodback round 2 --- .../external-anchors-use-rel-noopener.js | 8 ++--- .../audits/dobetterweb/js-libraries.js | 4 +-- .../dobetterweb/no-vulnerable-libraries.js | 23 ++++++++++--- lighthouse-core/audits/image-aspect-ratio.js | 2 +- lighthouse-core/lib/i18n/en-US.json | 32 +++++++++++++------ lighthouse-core/test/results/sample_v2.json | 5 ++- proto/sample_v2_round_trip.json | 2 +- 7 files changed, 52 insertions(+), 24 deletions(-) diff --git a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js index 5960304b44e9..f7ad647bb108 100644 --- a/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js +++ b/lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js @@ -10,9 +10,9 @@ const Audit = require('../audit.js'); const i18n = require('../../lib/i18n/i18n.js'); const UIStrings = { - /** Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe. */ + /** Title of a Lighthouse audit that provides detail on the cross-origin links that the web page contains, and whether the links can be considered safe. This descriptive title is shown to users when all links are safe. */ title: 'Links to cross-origin destinations are safe', - /** Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */ + /** Title of a Lighthouse audit that provides detail on the cross-origin links that the web page contains, and whether the links can be considered safe. This descriptive title is shown to users when not all links can be considered safe. */ failureTitle: 'Links to cross-origin destinations are unsafe', /** Description of a Lighthouse audit that tells the user why and how they should secure cross-origin links. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Add `rel="noopener"` or `rel="noreferrer"` to any external links to improve ' + @@ -21,9 +21,9 @@ const UIStrings = { /** Warning that some links' destinations cannot be determined and therefore the audit cannot evaluate the link's safety. */ warning: 'Unable to determine the destination for anchor ({anchorHTML}). ' + 'If not used as a hyperlink, consider removing target=_blank.', - /** Table column header for the target attribute of the link. Each entry is either an empty string or a string like `_blank`. */ + /** Label for a column in a data table; entries will be the target attribute of a link. Each entry is either an empty string or a string like `_blank`. */ columnTarget: 'Target', - /** Table column header for the `rel=` value from the link. */ + /** Label for a column in a data table; entries will be the values of the html "rel" attribute from link in a page. */ columnRel: 'Rel', }; diff --git a/lighthouse-core/audits/dobetterweb/js-libraries.js b/lighthouse-core/audits/dobetterweb/js-libraries.js index 02a546d8f61f..684feb7192bd 100644 --- a/lighthouse-core/audits/dobetterweb/js-libraries.js +++ b/lighthouse-core/audits/dobetterweb/js-libraries.js @@ -18,9 +18,9 @@ const UIStrings = { title: 'Detected JavaScript libraries', /** Description of a Lighthouse audit that tells the user what this audit is detecting. This is displayed after a user expands the section to see more. No character length limits. */ description: 'All front-end JavaScript libraries detected on the page.', - /** Table column header for the name of the Javascript library. */ + /** Label for a column in a data table; entries will be the names of the detected Javascript libraries. */ columnName: 'Name', - /** Table column header for the version of the detected Javascript library. */ + /** Label for a column in a data table; entries will be the version numbers of the detected Javascript libraries. */ columnVersion: 'Version', }; diff --git a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js index 50eabd24310a..ec3036e1053a 100644 --- a/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +++ b/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js @@ -34,18 +34,31 @@ const UIStrings = { =1 {1 vulnerability detected} other {# vulnerabilities detected} }`, - /** Table column header for the version of the Javascript library found. */ + /** Label for a column in a data table; entries will be the version numbers of the Javascript libraries found. */ columnVersion: 'Library Version', - /** Table column header for the count of vulnerabilities found within a JavaSscript library. */ + /** Label for a column in a data table; entries will be the counts of JavaScript-library vulnerabilities found. */ columnVuln: 'Vulnerability Count', - /** Table column header for the severity of the vulnerabilities found within a Javascript library. */ + /** Label for a column in a data table; entries will be the severity of the vulnerabilities found within a Javascript library. */ columnSeverity: 'Highest Severity', + /** Table row value for the severity of a small, or low impact Javascript vulnerability. Part of a ranking scale in the form: low, medium, high. */ + rowSeverityLow: 'Low', + /** Table row value for the severity of a Javascript vulnerability. Part of a ranking scale in the form: low, medium, high. */ + rowSeverityMedium: 'Medium', + /** Table row value for the severity of a high impact, or dangerous Javascript vulnerability. Part of a ranking scale in the form: low, medium, high. */ + rowSeverityHigh: 'High', }; const str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings); const SEMVER_REGEX = /^(\d+\.\d+\.\d+)[^-0-9]+/; +/** @type {Object} */ +const rowMap = { + 'low': str_(UIStrings.rowSeverityLow), + 'medium': str_(UIStrings.rowSeverityMedium), + 'high': str_(UIStrings.rowSeverityHigh), +}; + /** @typedef {{npm: Object}}>>}} SnykDB */ /** @typedef {{severity: string, numericSeverity: number, library: string, url: string}} Vulnerability */ @@ -133,7 +146,7 @@ class NoVulnerableLibrariesAudit extends Audit { const vulns = matchingVulns.map(vuln => { return { - severity: vuln.severity, + severity: rowMap[vuln.severity], numericSeverity: this.severityMap[vuln.severity], library: `${lib.name}@${normalizedVersion}`, url: 'https://snyk.io/vuln/' + vuln.id, @@ -179,7 +192,7 @@ class NoVulnerableLibrariesAudit extends Audit { let highestSeverity; if (vulns.length > 0) { - highestSeverity = this.highestSeverity(vulns).replace(/^\w/, l => l.toUpperCase()); + highestSeverity = this.highestSeverity(vulns); vulnerabilityResults.push({ highestSeverity, diff --git a/lighthouse-core/audits/image-aspect-ratio.js b/lighthouse-core/audits/image-aspect-ratio.js index d46036e04178..8dd975f975c2 100644 --- a/lighthouse-core/audits/image-aspect-ratio.js +++ b/lighthouse-core/audits/image-aspect-ratio.js @@ -23,7 +23,7 @@ const UIStrings = { /** Description of a Lighthouse audit that tells the user why they should maintain the correct aspect ratios for all images. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */ description: 'Image display dimensions should match natural aspect ratio. ' + '[Learn more](https://developers.google.com/web/tools/lighthouse/audits/aspect-ratio).', - /** Warning that the sizing information cannot be collected for an image. */ + /** Warning that the size information for an image was nonsensical. `url` will be replaced with the url of that image. */ warningCompute: 'Invalid image sizing information {url}', /** Label for a column in a data table; entries in the column will be the numeric aspect ratio of an image as displayed in a web page. */ columnDisplayed: 'Aspect Ratio (Displayed)', diff --git a/lighthouse-core/lib/i18n/en-US.json b/lighthouse-core/lib/i18n/en-US.json index ed876ff14788..65d2a4356a9e 100644 --- a/lighthouse-core/lib/i18n/en-US.json +++ b/lighthouse-core/lib/i18n/en-US.json @@ -709,11 +709,11 @@ }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnRel": { "message": "Rel", - "description": "Table column header for the `rel=` value from the link." + "description": "Label for a column in a data table; entries will be the values of the html \"rel\" attribute from link in a page." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | columnTarget": { "message": "Target", - "description": "Table column header for the target attribute of the link. Each entry is either an empty string or a string like `_blank`." + "description": "Label for a column in a data table; entries will be the target attribute of a link. Each entry is either an empty string or a string like `_blank`." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | description": { "message": "Add `rel=\"noopener\"` or `rel=\"noreferrer\"` to any external links to improve performance and prevent security vulnerabilities. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/noopener).", @@ -721,11 +721,11 @@ }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | failureTitle": { "message": "Links to cross-origin destinations are unsafe", - "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when not all links can be considered safe." + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that the web page contains, and whether the links can be considered safe. This descriptive title is shown to users when not all links can be considered safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | title": { "message": "Links to cross-origin destinations are safe", - "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that the page contains, and whether they can be considered safe. This descriptive title is shown to users when all links are safe." + "description": "Title of a Lighthouse audit that provides detail on the cross-origin links that the web page contains, and whether the links can be considered safe. This descriptive title is shown to users when all links are safe." }, "lighthouse-core/audits/dobetterweb/external-anchors-use-rel-noopener.js | warning": { "message": "Unable to determine the destination for anchor ({anchorHTML}). If not used as a hyperlink, consider removing target=_blank.", @@ -745,11 +745,11 @@ }, "lighthouse-core/audits/dobetterweb/js-libraries.js | columnName": { "message": "Name", - "description": "Table column header for the name of the Javascript library." + "description": "Label for a column in a data table; entries will be the names of the detected Javascript libraries." }, "lighthouse-core/audits/dobetterweb/js-libraries.js | columnVersion": { "message": "Version", - "description": "Table column header for the version of the detected Javascript library." + "description": "Label for a column in a data table; entries will be the version numbers of the detected Javascript libraries." }, "lighthouse-core/audits/dobetterweb/js-libraries.js | description": { "message": "All front-end JavaScript libraries detected on the page.", @@ -773,15 +773,15 @@ }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnSeverity": { "message": "Highest Severity", - "description": "Table column header for the severity of the vulnerabilities found within a Javascript library." + "description": "Label for a column in a data table; entries will be the severity of the vulnerabilities found within a Javascript library." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVersion": { "message": "Library Version", - "description": "Table column header for the version of the Javascript library found." + "description": "Label for a column in a data table; entries will be the version numbers of the Javascript libraries found." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnVuln": { "message": "Vulnerability Count", - "description": "Table column header for the count of vulnerabilities found within a JavaSscript library." + "description": "Label for a column in a data table; entries will be the counts of JavaScript-library vulnerabilities found." }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | description": { "message": "Some third-party scripts may contain known security vulnerabilities that are easily identified and exploited by attackers. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/vulnerabilities).", @@ -795,6 +795,18 @@ "message": "Includes front-end JavaScript libraries with known security vulnerabilities", "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the page uses. This descriptive title is shown to users when some detected Javascript libraries have known security vulnerabilities." }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | rowSeverityHigh": { + "message": "High", + "description": "Table row value for the severity of a high impact, or dangerous Javascript vulnerability. Part of a ranking scale in the form: low, medium, high." + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | rowSeverityLow": { + "message": "Low", + "description": "Table row value for the severity of a small, or low impact Javascript vulnerability. Part of a ranking scale in the form: low, medium, high." + }, + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | rowSeverityMedium": { + "message": "Medium", + "description": "Table row value for the severity of a Javascript vulnerability. Part of a ranking scale in the form: low, medium, high." + }, "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | title": { "message": "Avoids front-end JavaScript libraries with known security vulnerabilities", "description": "Title of a Lighthouse audit that provides detail on Javascript libraries the page uses. This descriptive title is shown to users when all Javascript libraries are free of known security vulnerabilities." @@ -913,7 +925,7 @@ }, "lighthouse-core/audits/image-aspect-ratio.js | warningCompute": { "message": "Invalid image sizing information {url}", - "description": "Warning that the sizing information cannot be collected for an image." + "description": "Warning that the size information for an image was nonsensical. `url` will be replaced with the url of that image." }, "lighthouse-core/audits/is-on-https.js | columnInsecureURL": { "message": "Insecure URL", diff --git a/lighthouse-core/test/results/sample_v2.json b/lighthouse-core/test/results/sample_v2.json index 05a05fb33c9e..c638cf3ce515 100644 --- a/lighthouse-core/test/results/sample_v2.json +++ b/lighthouse-core/test/results/sample_v2.json @@ -2701,7 +2701,7 @@ "geolocation-on-start": { "id": "geolocation-on-start", "title": "Requests the geolocation permission on page load", - "description": "Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to user gestures instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).", + "description": "Users are mistrustful of or confused by sites that request their location without context. Consider tying the request to a user action instead. [Learn more](https://developers.google.com/web/tools/lighthouse/audits/geolocation-on-load).", "score": 0, "scoreDisplayMode": "binary", "details": { @@ -5931,6 +5931,9 @@ "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | columnSeverity": [ "audits[no-vulnerable-libraries].details.headings[2].text" ], + "lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js | rowSeverityMedium": [ + "audits[no-vulnerable-libraries].details.items[0].highestSeverity" + ], "lighthouse-core/audits/dobetterweb/js-libraries.js | title": [ "audits[js-libraries].title" ], diff --git a/proto/sample_v2_round_trip.json b/proto/sample_v2_round_trip.json index 039e87ba3819..07c8e4c5e9b9 100644 --- a/proto/sample_v2_round_trip.json +++ b/proto/sample_v2_round_trip.json @@ -810,7 +810,7 @@ "title": "`` or `