lighthouse 11.7.0-dev.20240409 → 11.7.0-dev.20240411

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/cli/cli-flags.js +3 -3
  2. package/cli/test/smokehouse/core-tests.js +0 -16
  3. package/cli/test/smokehouse/frontends/smokehouse-bin.js +2 -2
  4. package/core/audits/byte-efficiency/render-blocking-resources.js +25 -26
  5. package/core/audits/layout-shifts.js +1 -1
  6. package/core/computed/metrics/lantern-first-contentful-paint.js +3 -2
  7. package/core/computed/metrics/lantern-first-meaningful-paint.js +3 -2
  8. package/core/computed/metrics/lantern-interactive.js +3 -2
  9. package/core/computed/metrics/lantern-largest-contentful-paint.js +3 -2
  10. package/core/computed/metrics/lantern-max-potential-fid.js +3 -2
  11. package/core/computed/metrics/lantern-metric.d.ts +5 -0
  12. package/core/computed/metrics/lantern-metric.js +23 -1
  13. package/core/computed/metrics/lantern-speed-index.js +3 -2
  14. package/core/computed/navigation-insights.d.ts +36 -0
  15. package/core/computed/navigation-insights.js +35 -0
  16. package/core/computed/trace-engine-result.d.ts +16 -3
  17. package/core/computed/trace-engine-result.js +19 -14
  18. package/core/config/default-config.js +6 -51
  19. package/core/config/filters.js +0 -1
  20. package/core/gather/gatherers/root-causes.d.ts +2 -2
  21. package/core/gather/gatherers/root-causes.js +6 -5
  22. package/core/gather/gatherers/trace-elements.d.ts +2 -2
  23. package/core/gather/gatherers/trace-elements.js +2 -2
  24. package/core/lib/lantern/cpu-node.d.ts +7 -1
  25. package/core/lib/lantern/cpu-node.js +12 -2
  26. package/core/lib/lantern/lantern-error.d.ts +8 -0
  27. package/core/lib/lantern/lantern-error.js +9 -0
  28. package/core/lib/lantern/metrics/first-meaningful-paint.js +2 -4
  29. package/core/lib/lantern/metrics/interactive.js +1 -1
  30. package/core/lib/lantern/metrics/largest-contentful-paint.js +3 -3
  31. package/core/lib/lantern/network-node.js +28 -4
  32. package/core/lib/lantern/page-dependency-graph.js +14 -2
  33. package/core/lib/lantern/simulator/simulator.js +1 -1
  34. package/core/lib/lh-error.js +3 -3
  35. package/core/runner.js +0 -1
  36. package/dist/report/bundle.esm.js +11 -95
  37. package/dist/report/flow.js +16 -100
  38. package/dist/report/standalone.js +12 -96
  39. package/flow-report/src/help-dialog.tsx +0 -1
  40. package/flow-report/src/i18n/i18n.d.ts +0 -4
  41. package/flow-report/src/i18n/ui-strings.d.ts +0 -1
  42. package/flow-report/src/i18n/ui-strings.js +0 -2
  43. package/package.json +1 -1
  44. package/readme.md +2 -2
  45. package/report/assets/styles.css +1 -43
  46. package/report/assets/templates.html +0 -95
  47. package/report/renderer/components.d.ts +2 -2
  48. package/report/renderer/components.js +2 -103
  49. package/report/renderer/report-renderer.js +2 -12
  50. package/report/renderer/report-ui-features.js +1 -1
  51. package/report/renderer/report-utils.d.ts +0 -1
  52. package/report/renderer/report-utils.js +0 -3
  53. package/shared/localization/locales/ar-XB.json +0 -174
  54. package/shared/localization/locales/ar.json +0 -174
  55. package/shared/localization/locales/bg.json +0 -174
  56. package/shared/localization/locales/ca.json +0 -174
  57. package/shared/localization/locales/cs.json +0 -174
  58. package/shared/localization/locales/da.json +0 -174
  59. package/shared/localization/locales/de.json +0 -174
  60. package/shared/localization/locales/el.json +0 -174
  61. package/shared/localization/locales/en-GB.json +0 -174
  62. package/shared/localization/locales/en-US.json +0 -177
  63. package/shared/localization/locales/en-XA.json +0 -174
  64. package/shared/localization/locales/en-XL.json +0 -177
  65. package/shared/localization/locales/es-419.json +0 -174
  66. package/shared/localization/locales/es.json +0 -174
  67. package/shared/localization/locales/fi.json +0 -174
  68. package/shared/localization/locales/fil.json +0 -174
  69. package/shared/localization/locales/fr.json +0 -174
  70. package/shared/localization/locales/he.json +0 -174
  71. package/shared/localization/locales/hi.json +0 -174
  72. package/shared/localization/locales/hr.json +0 -174
  73. package/shared/localization/locales/hu.json +0 -174
  74. package/shared/localization/locales/id.json +0 -174
  75. package/shared/localization/locales/it.json +0 -174
  76. package/shared/localization/locales/ja.json +0 -174
  77. package/shared/localization/locales/ko.json +0 -174
  78. package/shared/localization/locales/lt.json +0 -174
  79. package/shared/localization/locales/lv.json +0 -174
  80. package/shared/localization/locales/nl.json +0 -174
  81. package/shared/localization/locales/no.json +0 -174
  82. package/shared/localization/locales/pl.json +0 -174
  83. package/shared/localization/locales/pt-PT.json +0 -174
  84. package/shared/localization/locales/pt.json +0 -174
  85. package/shared/localization/locales/ro.json +0 -174
  86. package/shared/localization/locales/ru.json +0 -174
  87. package/shared/localization/locales/sk.json +0 -174
  88. package/shared/localization/locales/sl.json +0 -174
  89. package/shared/localization/locales/sr-Latn.json +0 -174
  90. package/shared/localization/locales/sr.json +0 -174
  91. package/shared/localization/locales/sv.json +0 -174
  92. package/shared/localization/locales/ta.json +0 -174
  93. package/shared/localization/locales/te.json +0 -174
  94. package/shared/localization/locales/th.json +0 -174
  95. package/shared/localization/locales/tr.json +0 -174
  96. package/shared/localization/locales/uk.json +0 -174
  97. package/shared/localization/locales/vi.json +0 -174
  98. package/shared/localization/locales/zh-HK.json +0 -174
  99. package/shared/localization/locales/zh-TW.json +0 -174
  100. package/shared/localization/locales/zh.json +0 -174
  101. package/tsconfig.json +0 -1
  102. package/types/artifacts.d.ts +15 -90
  103. package/types/audit.d.ts +0 -10
  104. package/types/internal/smokehouse.d.ts +1 -1
  105. package/types/lhr/lhr.d.ts +0 -2
  106. package/core/audits/content-width.d.ts +0 -17
  107. package/core/audits/content-width.js +0 -76
  108. package/core/audits/installable-manifest.d.ts +0 -111
  109. package/core/audits/installable-manifest.js +0 -248
  110. package/core/audits/manual/pwa-cross-browser.d.ts +0 -12
  111. package/core/audits/manual/pwa-cross-browser.js +0 -40
  112. package/core/audits/manual/pwa-each-page-has-url.d.ts +0 -12
  113. package/core/audits/manual/pwa-each-page-has-url.js +0 -38
  114. package/core/audits/manual/pwa-page-transitions.d.ts +0 -12
  115. package/core/audits/manual/pwa-page-transitions.js +0 -38
  116. package/core/audits/maskable-icon.d.ts +0 -25
  117. package/core/audits/maskable-icon.js +0 -70
  118. package/core/audits/multi-check-audit.d.ts +0 -28
  119. package/core/audits/multi-check-audit.js +0 -82
  120. package/core/audits/splash-screen.d.ts +0 -37
  121. package/core/audits/splash-screen.js +0 -98
  122. package/core/audits/themed-omnibox.d.ts +0 -42
  123. package/core/audits/themed-omnibox.js +0 -102
  124. package/core/computed/manifest-values.d.ts +0 -24
  125. package/core/computed/manifest-values.js +0 -136
  126. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +0 -47
  127. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +0 -233
  128. package/core/gather/gatherers/installability-errors.d.ts +0 -17
  129. package/core/gather/gatherers/installability-errors.js +0 -56
  130. package/core/gather/gatherers/web-app-manifest.d.ts +0 -32
  131. package/core/gather/gatherers/web-app-manifest.js +0 -106
  132. package/report/renderer/pwa-category-renderer.d.ts +0 -55
  133. package/report/renderer/pwa-category-renderer.js +0 -184
  134. package/third-party/chromium-synchronization/installability-errors-test.js +0 -79
@@ -16,6 +16,7 @@ import speedline from 'speedline-core';
16
16
  import * as CDTSourceMap from '../core/lib/cdt/generated/SourceMap.js';
17
17
  import {ArbitraryEqualityMap} from '../core/lib/arbitrary-equality-map.js';
18
18
  import type { TaskNode as _TaskNode } from '../core/lib/tracehouse/main-thread-tasks.js';
19
+ import type {EnabledHandlers} from '../core/computed/trace-engine-result.js';
19
20
  import AuditDetails from './lhr/audit-details.js'
20
21
  import Config from './config.js';
21
22
  import Gatherer from './gatherer.js';
@@ -45,8 +46,6 @@ interface UniversalBaseArtifacts {
45
46
  LighthouseRunWarnings: Array<string | IcuMessage>;
46
47
  /** The benchmark index that indicates rough device class. */
47
48
  BenchmarkIndex: number;
48
- /** Many benchmark indexes. Many. */
49
- BenchmarkIndexes?: number[];
50
49
  /** An object containing information about the testing configuration used by Lighthouse. */
51
50
  settings: Config.Settings;
52
51
  /** The timing instrumentation of the gather portion of a run. */
@@ -79,18 +78,20 @@ interface ContextualBaseArtifacts {
79
78
  interface PublicGathererArtifacts {
80
79
  /** ConsoleMessages deprecation and intervention warnings, console API calls, and exceptions logged by Chrome during page load. */
81
80
  ConsoleMessages: Artifacts.ConsoleMessage[];
82
- /** All the iframe elements in the page. */
83
- IFrameElements: Artifacts.IFrameElement[];
84
- /** The contents of the main HTML document network resource. */
85
- MainDocumentContent: string;
81
+ /** The primary log of devtools protocol activity. */
82
+ DevtoolsLog: DevtoolsLog;
86
83
  /** Information on size and loading for all the images in the page. Natural size information for `picture` and CSS images is only available if the image was one of the largest 50 images. */
87
84
  ImageElements: Artifacts.ImageElement[];
88
85
  /** All the link elements on the page or equivalently declared in `Link` headers. @see https://html.spec.whatwg.org/multipage/links.html */
89
86
  LinkElements: Artifacts.LinkElement[];
87
+ /** The contents of the main HTML document network resource. */
88
+ MainDocumentContent: string;
90
89
  /** The values of the <meta> elements in the head. */
91
90
  MetaElements: Array<{name?: string, content?: string, property?: string, httpEquiv?: string, charset?: string, node: Artifacts.NodeDetails}>;
92
91
  /** Information on all scripts in the page. */
93
92
  Scripts: Artifacts.Script[];
93
+ /** The primary trace taken over the entire run. */
94
+ Trace: Trace;
94
95
  /** The dimensions and devicePixelRatio of the loaded viewport. */
95
96
  ViewportDimensions: Artifacts.ViewportDimensions;
96
97
  }
@@ -110,8 +111,6 @@ export interface GathererArtifacts extends PublicGathererArtifacts {
110
111
  CacheContents: string[];
111
112
  /** CSS coverage information for styles used by page's final state. */
112
113
  CSSUsage: {rules: Crdp.CSS.RuleUsage[], stylesheets: Artifacts.CSSStyleSheetInfo[]};
113
- /** The primary log of devtools protocol activity. */
114
- DevtoolsLog: DevtoolsLog;
115
114
  /** The log of devtools protocol activity if there was a page load error and Chrome navigated to a `chrome-error://` page. */
116
115
  DevtoolsLogError: DevtoolsLog;
117
116
  /** Information on the document's doctype(or null if not present), specifically the name, publicId, and systemId.
@@ -121,16 +120,14 @@ export interface GathererArtifacts extends PublicGathererArtifacts {
121
120
  DOMStats: Artifacts.DOMStats;
122
121
  /** Information on poorly sized font usage and the text affected by it. */
123
122
  FontSize: Artifacts.FontSize;
123
+ /** All the iframe elements in the page. */
124
+ IFrameElements: Artifacts.IFrameElement[];
124
125
  /** All the input elements, including associated form and label elements. */
125
126
  Inputs: {inputs: Artifacts.InputElement[]; forms: Artifacts.FormElement[]; labels: Artifacts.LabelElement[]};
126
127
  /** Screenshot of the entire page (rather than just the above the fold content). */
127
128
  FullPageScreenshot: LHResult.FullPageScreenshot | null;
128
- /** Information about event listeners registered on the global object. */
129
- GlobalListeners: Array<Artifacts.GlobalListener>;
130
129
  /** The issues surfaced in the devtools Issues panel */
131
130
  InspectorIssues: Artifacts.InspectorIssues;
132
- /** Errors preventing page being installable as PWA. */
133
- InstallabilityErrors: Artifacts.InstallabilityErrors;
134
131
  /** JS coverage information for code used during audit. Keyed by script id. */
135
132
  // 'url' is excluded because it can be overridden by a magic sourceURL= comment, which makes keeping it a dangerous footgun!
136
133
  JsUsage: Record<string, Omit<Crdp.Profiler.ScriptCoverage, 'url'>>;
@@ -150,18 +147,10 @@ export interface GathererArtifacts extends PublicGathererArtifacts {
150
147
  SourceMaps: Array<Artifacts.SourceMap>;
151
148
  /** Information on detected tech stacks (e.g. JS libraries) used by the page. */
152
149
  Stacks: Artifacts.DetectedStack[];
153
- /** Information on <script> and <link> tags blocking first paint. */
154
- TagsBlockingFirstPaint: Artifacts.TagBlockingFirstPaint[];
155
- /** Information about tap targets including their position and size. */
156
- TapTargets: Artifacts.TapTarget[];
157
- /** The primary trace taken over the entire run. */
158
- Trace: Trace;
159
150
  /** The trace if there was a page load error and Chrome navigated to a `chrome-error://` page. */
160
151
  TraceError: Trace;
161
152
  /** Elements associated with metrics (ie: Largest Contentful Paint element). */
162
153
  TraceElements: Artifacts.TraceElement[];
163
- /** Parsed version of the page's Web App Manifest, or null if none found. */
164
- WebAppManifest: Artifacts.Manifest | null;
165
154
  /** COMPAT: A set of traces, keyed by passName. */
166
155
  traces: {[passName: string]: Trace};
167
156
  /** COMPAT: A set of DevTools debugger protocol records, keyed by passName. */
@@ -193,6 +182,8 @@ declare module Artifacts {
193
182
  finalDisplayedUrl: string;
194
183
  }
195
184
 
185
+ type Rect = AuditDetails.Rect;
186
+
196
187
  interface NodeDetails {
197
188
  lhId: string,
198
189
  devtoolsNodePath: string,
@@ -298,19 +289,6 @@ declare module Artifacts {
298
289
  content?: string;
299
290
  }
300
291
 
301
- interface ScriptElement {
302
- type: string | null
303
- src: string | null
304
- /** The `id` property of the script element; null if it had no `id` or if `source` is 'network'. */
305
- id: string | null
306
- async: boolean
307
- defer: boolean
308
- /** Details for node in DOM for the script element */
309
- node: NodeDetails | null
310
- /** Where the script was discovered, either in the head, the body, or network records. */
311
- source: 'head'|'body'|'network'
312
- }
313
-
314
292
  /** @see https://sourcemaps.info/spec.html#h.qz3o9nc69um5 */
315
293
  type RawSourceMap = {
316
294
  /** File version and must be a positive integer. */
@@ -436,10 +414,6 @@ declare module Artifacts {
436
414
  // TODO(bckenny): real type for parsed manifest.
437
415
  type Manifest = ReturnType<typeof parseManifest>;
438
416
 
439
- interface InstallabilityErrors {
440
- errors: Crdp.Page.InstallabilityError[];
441
- }
442
-
443
417
  interface ImageElement {
444
418
  /** The resolved source URL of the image. Similar to `currentSrc`, but resolved for CSS images as well. */
445
419
  src: string;
@@ -527,27 +501,6 @@ declare module Artifacts {
527
501
  resourceSize: number;
528
502
  }
529
503
 
530
- interface TagBlockingFirstPaint {
531
- startTime: number;
532
- endTime: number;
533
- transferSize: number;
534
- tag: {
535
- tagName: 'LINK'|'SCRIPT';
536
- /** The value of `HTMLLinkElement.href` or `HTMLScriptElement.src`. */
537
- url: string;
538
- /** A record of when changes to the `HTMLLinkElement.media` attribute occurred and if the new media type matched the page. */
539
- mediaChanges?: Array<{href: string, media: string, msSinceHTMLEnd: number, matches: boolean}>;
540
- };
541
- }
542
-
543
- type Rect = AuditDetails.Rect;
544
-
545
- interface TapTarget {
546
- node: NodeDetails;
547
- href: string;
548
- clientRects: Rect[];
549
- }
550
-
551
504
  interface TraceElement {
552
505
  traceEventType: 'largest-contentful-paint'|'layout-shift'|'animation'|'responsiveness';
553
506
  node: NodeDetails;
@@ -556,7 +509,10 @@ declare module Artifacts {
556
509
  type?: string;
557
510
  }
558
511
 
559
- type TraceEngineResult = TraceEngine.Handlers.Types.TraceParseData;
512
+ interface TraceEngineResult {
513
+ data: TraceEngine.Handlers.Types.EnabledHandlerDataWithMeta<EnabledHandlers>;
514
+ insights: TraceEngine.Insights.Types.TraceInsightData<EnabledHandlers>;
515
+ }
560
516
 
561
517
  interface TraceEngineRootCauses {
562
518
  layoutShifts: Record<number, LayoutShiftRootCausesData>;
@@ -601,25 +557,6 @@ declare module Artifacts {
601
557
  }
602
558
  }
603
559
 
604
- type ManifestValueCheckID = 'hasStartUrl'|'hasIconsAtLeast144px'|'hasIconsAtLeast512px'|'fetchesIcon'|'hasPWADisplayValue'|'hasBackgroundColor'|'hasThemeColor'|'hasShortName'|'hasName'|'shortNameLength'|'hasMaskableIcon';
605
-
606
- type ManifestValues = {
607
- isParseFailure: false;
608
- allChecks: {
609
- id: ManifestValueCheckID;
610
- failureText: string;
611
- passing: boolean;
612
- }[];
613
- } | {
614
- isParseFailure: true;
615
- parseFailureReason: string;
616
- allChecks: {
617
- id: ManifestValueCheckID;
618
- failureText: string;
619
- passing: boolean;
620
- }[];
621
- }
622
-
623
560
  type MeasureEntry = LHResult.MeasureEntry;
624
561
 
625
562
  interface MetricComputationDataInput {
@@ -838,18 +775,6 @@ declare module Artifacts {
838
775
  node: NodeDetails;
839
776
  }
840
777
 
841
- /** Information about an event listener registered on the global object. */
842
- interface GlobalListener {
843
- /** Event listener type, limited to those events currently of interest. */
844
- type: 'pagehide'|'unload'|'visibilitychange';
845
- /** The DevTools protocol script identifier. */
846
- scriptId: string;
847
- /** Line number in the script (0-based). */
848
- lineNumber: number;
849
- /** Column number in the script (0-based). */
850
- columnNumber: number;
851
- }
852
-
853
778
  /** Describes a generic console message. */
854
779
  interface BaseConsoleMessage {
855
780
  /**
package/types/audit.d.ts CHANGED
@@ -117,16 +117,6 @@ declare module Audit {
117
117
 
118
118
  /** Type returned by Audit.audit(). Only score is required. */
119
119
  type Product = NonNumericProduct | NumericProduct;
120
-
121
- type MultiCheckAuditP1 = Partial<Record<Artifacts.ManifestValueCheckID, boolean>>;
122
- type MultiCheckAuditP2 = Partial<Artifacts.ManifestValues>;
123
- interface MultiCheckAuditP3 {
124
- failures: Array<string>;
125
- manifestValues?: undefined;
126
- allChecks?: undefined;
127
- }
128
-
129
- type MultiCheckAuditDetails = MultiCheckAuditP1 & MultiCheckAuditP2 & MultiCheckAuditP3;
130
120
  }
131
121
 
132
122
  export default Audit;
@@ -33,7 +33,7 @@ declare global {
33
33
  }
34
34
 
35
35
  export interface TestDfn {
36
- /** Identification of test. Can be used for group selection (e.g. `yarn smoke pwa` will run all tests with `id.includes('pwa')`). */
36
+ /** Identification of test. Can be used for group selection (e.g. `yarn smoke csp` will run all tests with `id.includes('csp')`). */
37
37
  id: string;
38
38
  /** Expected test results. */
39
39
  expectations: ExpectedRunnerResult;
@@ -71,8 +71,6 @@ declare module Result {
71
71
  networkUserAgent: string;
72
72
  /** The benchmark index number that indicates rough device class. */
73
73
  benchmarkIndex: number;
74
- /** Many benchmark indexes. */
75
- benchmarkIndexes?: number[];
76
74
  /** The version of libraries with which these results were generated. Ex: axe-core. */
77
75
  credits?: Record<string, string|undefined>,
78
76
  }
@@ -1,17 +0,0 @@
1
- export default ContentWidth;
2
- declare class ContentWidth extends Audit {
3
- /**
4
- * @param {LH.Artifacts} artifacts
5
- * @param {LH.Audit.Context} context
6
- * @return {LH.Audit.Product}
7
- */
8
- static audit(artifacts: LH.Artifacts, context: LH.Audit.Context): LH.Audit.Product;
9
- }
10
- export namespace UIStrings {
11
- const title: string;
12
- const failureTitle: string;
13
- const description: string;
14
- const explanation: string;
15
- }
16
- import { Audit } from './audit.js';
17
- //# sourceMappingURL=content-width.d.ts.map
@@ -1,76 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2016 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- import {Audit} from './audit.js';
8
- import * as i18n from '../lib/i18n/i18n.js';
9
-
10
- const UIStrings = {
11
- /** Title of a Lighthouse audit that provides detail on the content size of a web site compared to the viewport, which is the size of the screen the site is displayed on. This descriptive title is shown to users when the site's content is sized appropriately. */
12
- title: 'Content is sized correctly for the viewport',
13
- /** Title of a Lighthouse audit that provides detail on the content size of a web site compared to the viewport, which is the size of the screen the site is displayed on. This descriptive title is shown to users when the site's content is not sized appropriately. */
14
- failureTitle: 'Content is not sized correctly for the viewport',
15
- /** Description of a Lighthouse audit that tells the user why they should care that a site's content size should match its viewport size, which is the size of the screen the site is displayed on. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
16
- description: 'If the width of your app\'s content doesn\'t match the width ' +
17
- 'of the viewport, your app might not be optimized for mobile screens. ' +
18
- '[Learn how to size content for the viewport](https://developer.chrome.com/docs/lighthouse/pwa/content-width/).',
19
- /**
20
- * @description Explanatory message stating that the viewport size and window size differ.
21
- * @example {100} innerWidth
22
- * @example {101} outerWidth
23
- * */
24
- explanation: 'The viewport size of {innerWidth}px does not match the window ' +
25
- 'size of {outerWidth}px.',
26
- };
27
-
28
- const str_ = i18n.createIcuMessageFn(import.meta.url, UIStrings);
29
-
30
- class ContentWidth extends Audit {
31
- /**
32
- * @return {LH.Audit.Meta}
33
- */
34
- static get meta() {
35
- return {
36
- id: 'content-width',
37
- title: str_(UIStrings.title),
38
- failureTitle: str_(UIStrings.failureTitle),
39
- description: str_(UIStrings.description),
40
- requiredArtifacts: ['ViewportDimensions'],
41
- };
42
- }
43
-
44
- /**
45
- * @param {LH.Artifacts} artifacts
46
- * @param {LH.Audit.Context} context
47
- * @return {LH.Audit.Product}
48
- */
49
- static audit(artifacts, context) {
50
- const viewportWidth = artifacts.ViewportDimensions.innerWidth;
51
- const windowWidth = artifacts.ViewportDimensions.outerWidth;
52
- const widthsMatch = viewportWidth === windowWidth;
53
-
54
- if (context.settings.formFactor === 'desktop') {
55
- return {
56
- score: 1,
57
- notApplicable: true,
58
- };
59
- }
60
-
61
- let explanation;
62
- if (!widthsMatch) {
63
- explanation = str_(UIStrings.explanation,
64
- {innerWidth: artifacts.ViewportDimensions.innerWidth,
65
- outerWidth: artifacts.ViewportDimensions.outerWidth});
66
- }
67
-
68
- return {
69
- score: Number(widthsMatch),
70
- explanation,
71
- };
72
- }
73
- }
74
-
75
- export default ContentWidth;
76
- export {UIStrings};
@@ -1,111 +0,0 @@
1
- export default InstallableManifest;
2
- /**
3
- * @fileoverview
4
- * Audits if the page's web app manifest and service worker qualify for triggering a beforeinstallprompt event.
5
- * https://github.com/GoogleChrome/lighthouse/issues/23#issuecomment-270453303
6
- *
7
- * Requirements based on Chrome Devtools' installability requirements.
8
- * Origin of logging:
9
- * https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/installable/installable_logging.cc
10
- * DevTools InstallabilityError implementation:
11
- * https://source.chromium.org/search?q=getInstallabilityErrorMessages&ss=chromium%2Fchromium%2Fsrc:third_party%2Fdevtools-frontend%2Fsrc%2Ffront_end%2Fresources%2F
12
- */
13
- declare class InstallableManifest extends Audit {
14
- /**
15
- * @param {LH.Artifacts} artifacts
16
- * @return {{i18nErrors: Array<LH.IcuMessage | string>; warnings: Array<LH.IcuMessage>}}
17
- */
18
- static getInstallabilityErrors(artifacts: LH.Artifacts): {
19
- i18nErrors: Array<LH.IcuMessage | string>;
20
- warnings: Array<LH.IcuMessage>;
21
- };
22
- /**
23
- * @param {LH.Artifacts} artifacts
24
- * @param {LH.Audit.Context} context
25
- * @return {Promise<LH.Audit.Product>}
26
- *
27
- */
28
- static audit(artifacts: LH.Artifacts, context: LH.Audit.Context): Promise<LH.Audit.Product>;
29
- }
30
- export const UIStrings: {
31
- /** Title of a Lighthouse audit that provides detail on if a website is installable as an application. This descriptive title is shown to users when a webapp is installable. */
32
- title: string;
33
- /** Title of a Lighthouse audit that provides detail on if a website is installable as an application. This descriptive title is shown to users when a webapp is not installable. */
34
- failureTitle: string;
35
- /** Description of a Lighthouse audit that tells the user why installability is important for webapps. This is displayed after a user expands the section to see more. No character length limits. The last sentence starting with 'Learn' becomes link text to additional documentation. */
36
- description: string;
37
- /** Label for a column in a data table; entries in the column will be a string explaining why a failure occurred. */
38
- columnValue: string;
39
- /**
40
- * @description [ICU Syntax] Label for an audit identifying the number of installability errors found in the page.
41
- */
42
- displayValue: string;
43
- /**
44
- * @description Error message describing a DevTools error id that was found and has not been identified by this audit.
45
- * @example {platform-not-supported-on-android} errorId
46
- */
47
- noErrorId: string;
48
- /** Error message explaining that the page is not loaded in the frame. */
49
- 'not-in-main-frame': string;
50
- /** Error message explaining that the page is served from a secure origin. */
51
- 'not-from-secure-origin': string;
52
- /** Error message explaining that the page has no manifest URL. */
53
- 'no-manifest': string;
54
- /** Error message explaining that the provided manifest URL is invalid. */
55
- 'start-url-not-valid': string;
56
- /** Error message explaining that the provided manifest does not contain a name or short_name field. */
57
- 'manifest-missing-name-or-short-name': string;
58
- /** Error message explaining that the manifest display property must be one of 'standalone', 'fullscreen', or 'minimal-ui'. */
59
- 'manifest-display-not-supported': string;
60
- /** Error message explaining that the manifest could not be fetched, might be empty, or could not be parsed. */
61
- 'manifest-empty': string;
62
- /** Error message explaining that the manifest could not be fetched, might be empty, or could not be parsed. */
63
- 'manifest-parsing-or-network-error': string;
64
- /**
65
- * @description Error message explaining that the manifest does not contain a suitable icon.
66
- * @example {192} value0
67
- */
68
- 'manifest-missing-suitable-icon': string;
69
- /**
70
- * @description Error message explaining that the manifest does not supply an icon of the correct format.
71
- * @example {192} value0
72
- */
73
- 'no-acceptable-icon': string;
74
- /** Error message explaining that the icon could not be downloaded. */
75
- 'cannot-download-icon': string;
76
- /** Error message explaining that the downloaded icon was empty or corrupt. */
77
- 'no-icon-available': string;
78
- /** Error message explaining that the specified application platform is not supported on Android. */
79
- 'platform-not-supported-on-android': string;
80
- /** Error message explaining that a Play store ID was not provided. */
81
- 'no-id-specified': string;
82
- /** Error message explaining that the Play Store app URL and Play Store ID do not match. */
83
- 'ids-do-not-match': string;
84
- /** Error message explaining that the app is already installed. */
85
- 'already-installed': string;
86
- /** Error message explaining that a URL in the manifest contains a username, password, or port. */
87
- 'url-not-supported-for-webapk': string;
88
- /** Error message explaining that the page is loaded in an incognito window. */
89
- 'in-incognito': string;
90
- /** Error message explaining that the page does not work offline. */
91
- 'not-offline-capable': string;
92
- /** Error message explaining that service worker could not be checked without a start_url. */
93
- 'no-url-for-service-worker': string;
94
- /** Error message explaining that the manifest specifies prefer_related_applications: true. */
95
- 'prefer-related-applications': string;
96
- /** Error message explaining that prefer_related_applications is only supported on Chrome Beta and Stable channels on Android. */
97
- 'prefer-related-applications-only-beta-stable': string;
98
- /** Error message explaining that the manifest contains 'display_override' field, and the
99
- first supported display mode must be one of 'standalone', 'fullscreen', or 'minimal-ui'. */
100
- 'manifest-display-override-not-supported': string;
101
- /** Error message explaining that the web manifest's URL changed while the manifest was being downloaded by the browser. */
102
- 'manifest-location-changed': string;
103
- /** Warning message explaining that the page does not work offline. */
104
- 'warn-not-offline-capable': string;
105
- /** Error message explaining that Lighthouse failed while checking if the page is installable, and directing the user to try again in a new Chrome. */
106
- 'protocol-timeout': string;
107
- /** Message logged when the web app has been uninstalled o desktop, signalling that the install banner state is being reset. */
108
- 'pipeline-restarted': string;
109
- };
110
- import { Audit } from './audit.js';
111
- //# sourceMappingURL=installable-manifest.d.ts.map