From 4ae89ba3606d329e9efded877b4629457b10f4f3 Mon Sep 17 00:00:00 2001 From: Adam Read Date: Wed, 27 Oct 2021 10:22:09 +0200 Subject: [PATCH 1/6] Update installable-manifest audit to cover pipeline-restarted case. When a desktop PWA is uninstalled but has other open windows in scope, the pipeline-restarted message will be logged, signalling that the app install banner state has been reset. pipeline-restarted will be ignored by Lighthouse, as there is currently no reason audit the behavior of desktop PWAs after the app has been uninstalled. The related test has also been updated to run again. --- lighthouse-core/audits/installable-manifest.js | 7 +++++++ .../chromium-synchronization/installability-errors-test.js | 3 +-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lighthouse-core/audits/installable-manifest.js b/lighthouse-core/audits/installable-manifest.js index 7ae7ecabb91c..8fc0c0e8e0d8 100644 --- a/lighthouse-core/audits/installable-manifest.js +++ b/lighthouse-core/audits/installable-manifest.js @@ -93,6 +93,8 @@ const UIStrings = { 'manifest-location-changed': `Manifest URL changed while the manifest was being fetched.`, /** Warning message explaining that the page does not work offline. */ 'warn-not-offline-capable': `Page does not work offline. The page will not be regarded as installable after Chrome 93, stable release August 2021.`, + /** Message logged when the web app has been uninstalled o desktop, signalling that the install banner state is being reset. */ + 'pipeline-restarted': 'PWA has been uninstalled and installability checks resetting.', }; /* eslint-enable max-len */ @@ -144,6 +146,11 @@ class InstallableManifest extends Audit { continue; } + // Filter out errorId 'pipline-restarted' since it only applies when the PWA is uninstalled. + if (err.errorId === 'pipeline-restarted') { + continue; + } + // @ts-expect-error errorIds from protocol should match up against the strings dict const matchingString = UIStrings[err.errorId]; diff --git a/third-party/chromium-synchronization/installability-errors-test.js b/third-party/chromium-synchronization/installability-errors-test.js index 70031d7d7f75..d2c50373ce34 100644 --- a/third-party/chromium-synchronization/installability-errors-test.js +++ b/third-party/chromium-synchronization/installability-errors-test.js @@ -74,8 +74,7 @@ Array [ `); }); - // TODO: https://github.com/GoogleChrome/lighthouse/issues/13147 - it.skip('are each handled explicitly in the gatherer', () => { + it('are each handled explicitly in the gatherer', () => { const errorStrings = Object.keys(InstallableManifestAudit.UIStrings) .filter(key => chromiumErrorIds.includes(key)) .sort(); From b353bef8cca917a3f84e678da9e05787baee2e60 Mon Sep 17 00:00:00 2001 From: Adam Read Date: Fri, 12 Nov 2021 16:24:03 +0100 Subject: [PATCH 2/6] Update installable-manifest.js Minor spelling mistake. --- lighthouse-core/audits/installable-manifest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-core/audits/installable-manifest.js b/lighthouse-core/audits/installable-manifest.js index 8fc0c0e8e0d8..3e08573f0238 100644 --- a/lighthouse-core/audits/installable-manifest.js +++ b/lighthouse-core/audits/installable-manifest.js @@ -146,7 +146,7 @@ class InstallableManifest extends Audit { continue; } - // Filter out errorId 'pipline-restarted' since it only applies when the PWA is uninstalled. + // Filter out errorId 'pipeline-restarted' since it only applies when the PWA is uninstalled. if (err.errorId === 'pipeline-restarted') { continue; } From 29efa9b856712a52ddcd9f40d6f9d2223394bcf5 Mon Sep 17 00:00:00 2001 From: Adam Read Date: Fri, 12 Nov 2021 16:27:40 +0100 Subject: [PATCH 3/6] Update installable-manifest.js Fixing formatting errors --- lighthouse-core/audits/installable-manifest.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lighthouse-core/audits/installable-manifest.js b/lighthouse-core/audits/installable-manifest.js index 3e08573f0238..84e9407688bb 100644 --- a/lighthouse-core/audits/installable-manifest.js +++ b/lighthouse-core/audits/installable-manifest.js @@ -21,7 +21,7 @@ const UIStrings = { 'columnValue': 'Failure reason', /** * @description [ICU Syntax] Label for an audit identifying the number of installability errors found in the page. - */ + */ 'displayValue': `{itemCount, plural, =1 {1 reason} other {# reasons} @@ -50,15 +50,15 @@ const UIStrings = { * for the current page encloses the scope and start URL from the manifest. */ 'no-matching-service-worker': `No matching service worker detected. You may need to reload the page, or check that the scope of the service worker for the current page encloses the scope and start URL from the manifest.`, /** - * @description Error message explaining that the manifest does not contain a suitable icon. - * @example {192} value0 - */ + * @description Error message explaining that the manifest does not contain a suitable icon. + * @example {192} value0 + */ 'manifest-missing-suitable-icon': `Manifest does not contain a suitable icon - PNG, SVG or WebP format of at least {value0}\xa0px is required, the sizes attribute must be set, and the purpose attribute, if set, must include "any".`, /** - * @description Error message explaining that the manifest does not supply an icon of the correct format. - * @example {192} value0 - */ + * @description Error message explaining that the manifest does not supply an icon of the correct format. + * @example {192} value0 + */ 'no-acceptable-icon': `No supplied icon is at least {value0}\xa0px square in PNG, SVG or WebP format, with the purpose attribute unset or set to "any"`, /** Error message explaining that the icon could not be downloaded. */ From 7788f3c70120b41cc79d44c69b367c2609ef1fa5 Mon Sep 17 00:00:00 2001 From: Adam Read Date: Fri, 12 Nov 2021 16:33:56 +0100 Subject: [PATCH 4/6] Update installable-manifest.js Re-adding protocol-timeout to my branch. --- lighthouse-core/audits/installable-manifest.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lighthouse-core/audits/installable-manifest.js b/lighthouse-core/audits/installable-manifest.js index 84e9407688bb..7ce25c02725f 100644 --- a/lighthouse-core/audits/installable-manifest.js +++ b/lighthouse-core/audits/installable-manifest.js @@ -93,6 +93,8 @@ const UIStrings = { 'manifest-location-changed': `Manifest URL changed while the manifest was being fetched.`, /** Warning message explaining that the page does not work offline. */ 'warn-not-offline-capable': `Page does not work offline. The page will not be regarded as installable after Chrome 93, stable release August 2021.`, + /** Error message explaining that Lighthouse failed while detecting a service worker, and directing the user to try again in a new Chrome. */ + 'protocol-timeout': `Lighthouse could not determine if there was a service worker. Please try with a newer version of Chrome.`, /** Message logged when the web app has been uninstalled o desktop, signalling that the install banner state is being reset. */ 'pipeline-restarted': 'PWA has been uninstalled and installability checks resetting.', }; From e20d6a6f32510def0254a839e48f3d7c91a39af3 Mon Sep 17 00:00:00 2001 From: Adam Read Date: Wed, 17 Nov 2021 09:45:47 +0100 Subject: [PATCH 5/6] Adding strings to localization. --- shared/localization/locales/en-US.json | 3 +++ shared/localization/locales/en-XL.json | 3 +++ 2 files changed, 6 insertions(+) diff --git a/shared/localization/locales/en-US.json b/shared/localization/locales/en-US.json index aec28806f23a..e16ff2c88bf1 100644 --- a/shared/localization/locales/en-US.json +++ b/shared/localization/locales/en-US.json @@ -1076,6 +1076,9 @@ "lighthouse-core/audits/installable-manifest.js | warn-not-offline-capable": { "message": "Page does not work offline. The page will not be regarded as installable after Chrome 93, stable release August 2021." }, + "lighthouse-core/audits/installable-manifest.js | pipeline-restarted": { + "message": "PWA has been uninstalled and installability checks resetting." + }, "lighthouse-core/audits/is-on-https.js | allowed": { "message": "Allowed" }, diff --git a/shared/localization/locales/en-XL.json b/shared/localization/locales/en-XL.json index 4f5cf0457200..0b77bc6fe624 100644 --- a/shared/localization/locales/en-XL.json +++ b/shared/localization/locales/en-XL.json @@ -1076,6 +1076,9 @@ "lighthouse-core/audits/installable-manifest.js | warn-not-offline-capable": { "message": "P̂áĝé d̂óêś n̂ót̂ ẃôŕk̂ óf̂f́l̂ín̂é. T̂h́ê ṕâǵê ẃîĺl̂ ńôt́ b̂é r̂éĝár̂d́êd́ âś îńŝt́âĺl̂áb̂ĺê áf̂t́êŕ Ĉh́r̂óm̂é 93, ŝt́âb́l̂é r̂él̂éâśê Áûǵûśt̂ 2021." }, + "lighthouse-core/audits/installable-manifest.js | pipeline-restarted": { + "message": "P̂ẂÂ h́âś b̂éêń ûńîńŝt́âĺl̂éd̂ án̂d́ îńŝt́âĺl̂áb̂íl̂ít̂ý ĉh́êćk̂ś r̂éŝét̂t́îńĝ." + }, "lighthouse-core/audits/is-on-https.js | allowed": { "message": "Âĺl̂óŵéd̂" }, From b2192cc480a260483c66d5304c41d83abffc4ba8 Mon Sep 17 00:00:00 2001 From: Adam Read Date: Wed, 17 Nov 2021 10:08:53 +0100 Subject: [PATCH 6/6] Apparently the localized strings need to go in the right place... --- shared/localization/locales/en-US.json | 6 +++--- shared/localization/locales/en-XL.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/shared/localization/locales/en-US.json b/shared/localization/locales/en-US.json index e16ff2c88bf1..112ed42badb0 100644 --- a/shared/localization/locales/en-US.json +++ b/shared/localization/locales/en-US.json @@ -1052,6 +1052,9 @@ "lighthouse-core/audits/installable-manifest.js | not-offline-capable": { "message": "Page does not work offline" }, + "lighthouse-core/audits/installable-manifest.js | pipeline-restarted": { + "message": "PWA has been uninstalled and installability checks resetting." + }, "lighthouse-core/audits/installable-manifest.js | platform-not-supported-on-android": { "message": "The specified application platform is not supported on Android" }, @@ -1076,9 +1079,6 @@ "lighthouse-core/audits/installable-manifest.js | warn-not-offline-capable": { "message": "Page does not work offline. The page will not be regarded as installable after Chrome 93, stable release August 2021." }, - "lighthouse-core/audits/installable-manifest.js | pipeline-restarted": { - "message": "PWA has been uninstalled and installability checks resetting." - }, "lighthouse-core/audits/is-on-https.js | allowed": { "message": "Allowed" }, diff --git a/shared/localization/locales/en-XL.json b/shared/localization/locales/en-XL.json index 0b77bc6fe624..302a3a8b3d89 100644 --- a/shared/localization/locales/en-XL.json +++ b/shared/localization/locales/en-XL.json @@ -1052,6 +1052,9 @@ "lighthouse-core/audits/installable-manifest.js | not-offline-capable": { "message": "P̂áĝé d̂óêś n̂ót̂ ẃôŕk̂ óf̂f́l̂ín̂é" }, + "lighthouse-core/audits/installable-manifest.js | pipeline-restarted": { + "message": "P̂ẂÂ h́âś b̂éêń ûńîńŝt́âĺl̂éd̂ án̂d́ îńŝt́âĺl̂áb̂íl̂ít̂ý ĉh́êćk̂ś r̂éŝét̂t́îńĝ." + }, "lighthouse-core/audits/installable-manifest.js | platform-not-supported-on-android": { "message": "T̂h́ê śp̂éĉíf̂íêd́ âṕp̂ĺîćât́îón̂ ṕl̂át̂f́ôŕm̂ íŝ ńôt́ ŝúp̂ṕôŕt̂éd̂ ón̂ Án̂d́r̂óîd́" }, @@ -1076,9 +1079,6 @@ "lighthouse-core/audits/installable-manifest.js | warn-not-offline-capable": { "message": "P̂áĝé d̂óêś n̂ót̂ ẃôŕk̂ óf̂f́l̂ín̂é. T̂h́ê ṕâǵê ẃîĺl̂ ńôt́ b̂é r̂éĝár̂d́êd́ âś îńŝt́âĺl̂áb̂ĺê áf̂t́êŕ Ĉh́r̂óm̂é 93, ŝt́âb́l̂é r̂él̂éâśê Áûǵûśt̂ 2021." }, - "lighthouse-core/audits/installable-manifest.js | pipeline-restarted": { - "message": "P̂ẂÂ h́âś b̂éêń ûńîńŝt́âĺl̂éd̂ án̂d́ îńŝt́âĺl̂áb̂íl̂ít̂ý ĉh́êćk̂ś r̂éŝét̂t́îńĝ." - }, "lighthouse-core/audits/is-on-https.js | allowed": { "message": "Âĺl̂óŵéd̂" },