lighthouse 9.5.0-dev.20220621 → 9.5.0-dev.20220622

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 (29) hide show
  1. package/lighthouse-cli/bin.js +8 -2
  2. package/lighthouse-cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +43 -0
  3. package/lighthouse-cli/test/smokehouse/report-assert-test.js +96 -30
  4. package/lighthouse-cli/test/smokehouse/report-assert.js +36 -35
  5. package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +1 -1
  6. package/lighthouse-core/config/config-helpers.js +15 -0
  7. package/lighthouse-core/fraggle-rock/config/config.js +45 -1
  8. package/lighthouse-core/fraggle-rock/gather/driver.js +13 -5
  9. package/lighthouse-core/fraggle-rock/gather/session.js +23 -67
  10. package/lighthouse-core/gather/driver/navigation.js +1 -1
  11. package/lighthouse-core/gather/driver/network-monitor.js +14 -59
  12. package/lighthouse-core/gather/driver/target-manager.js +110 -45
  13. package/lighthouse-core/gather/driver.js +24 -16
  14. package/lighthouse-core/gather/gatherers/devtools-log.js +7 -11
  15. package/lighthouse-core/gather/gatherers/full-page-screenshot.js +1 -1
  16. package/lighthouse-core/index.js +24 -9
  17. package/lighthouse-core/lib/cdt/Common.js +13 -0
  18. package/lighthouse-core/lib/cdt/Platform.js +3 -0
  19. package/lighthouse-core/lib/cdt/generated/ParsedURL.js +178 -0
  20. package/lighthouse-core/lib/cdt/generated/SourceMap.js +155 -62
  21. package/package.json +2 -2
  22. package/third-party/devtools-tests/README.md +14 -0
  23. package/third-party/devtools-tests/e2e/lighthouse/generate-report_test.ts +29 -0
  24. package/third-party/devtools-tests/e2e/lighthouse/indexeddb-warning_test.ts +29 -0
  25. package/third-party/devtools-tests/e2e/resources/lighthouse/lighthouse-storage.html +11 -0
  26. package/third-party/download-content-shell/README.md +1 -0
  27. package/third-party/download-content-shell/download-content-shell.js +6 -1
  28. package/types/gatherer.d.ts +5 -2
  29. package/types/protocol.d.ts +19 -17
@@ -0,0 +1,11 @@
1
+ <!DOCTYPE html>
2
+ <head>
3
+ <meta charset="UTF-8">
4
+ <script>
5
+ // Indexeddb
6
+ window.indexedDB.open("DataBase", 3);
7
+ </script>
8
+ </head>
9
+ <body>
10
+ hi
11
+ </body>
@@ -6,3 +6,4 @@ Some minor patches on top from the Lighthouse Authors:
6
6
 
7
7
  * deleting code we don't need
8
8
  * changing output path
9
+ * --resolve-executable-path
@@ -34,7 +34,6 @@ function main() {
34
34
  console.log('Unable to download because of error:', error);
35
35
  }
36
36
  }
37
- main();
38
37
 
39
38
  function onUploadedCommitPosition(commitPosition) {
40
39
  const contentShellDirPath = path.resolve(CACHE_PATH, commitPosition, 'out', TARGET);
@@ -176,3 +175,9 @@ function getContentShellBinaryPath(dirPath) {
176
175
  return path.resolve(dirPath, 'Content Shell.app', 'Contents', 'MacOS', 'Content Shell');
177
176
  }
178
177
  }
178
+
179
+ if (process.argv[2] === '--resolve-executable-path') {
180
+ console.log(getContentShellBinaryPath(process.argv[3]));
181
+ } else {
182
+ main();
183
+ }
@@ -28,8 +28,6 @@ declare module Gatherer {
28
28
  setNextProtocolTimeout(ms: number): void;
29
29
  on<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
30
30
  once<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
31
- addProtocolMessageListener(callback: (payload: Protocol.RawEventMessage) => void): void
32
- removeProtocolMessageListener(callback: (payload: Protocol.RawEventMessage) => void): void
33
31
  off<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
34
32
  sendCommand<TMethod extends keyof LH.CrdpCommands>(method: TMethod, ...params: LH.CrdpCommands[TMethod]['paramsType']): Promise<LH.CrdpCommands[TMethod]['returnType']>;
35
33
  dispose(): Promise<void>;
@@ -41,6 +39,11 @@ declare module Gatherer {
41
39
  executionContext: ExecutionContext;
42
40
  fetcher: Fetcher;
43
41
  url: () => Promise<string>;
42
+ targetManager: {
43
+ rootSession(): FRProtocolSession;
44
+ on(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void
45
+ off(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void
46
+ };
44
47
  }
45
48
 
46
49
  /** The limited context interface shared between pre and post Fraggle Rock Lighthouse. */
@@ -5,6 +5,23 @@
5
5
  */
6
6
 
7
7
  declare module Protocol {
8
+ /**
9
+ * An intermediate type, used to create a record of all possible Crdp raw event
10
+ * messages, keyed on method. e.g. {
11
+ * 'Domain.method1Name': {method: 'Domain.method1Name', params: EventPayload1},
12
+ * 'Domain.method2Name': {method: 'Domain.method2Name', params: EventPayload2},
13
+ * }
14
+ */
15
+ type RawEventMessageRecord = {
16
+ [K in keyof LH.CrdpEvents]: {
17
+ method: K,
18
+ // Drop [] for `undefined` (so a JS value is valid).
19
+ params: LH.CrdpEvents[K] extends [] ? undefined: LH.CrdpEvents[K][number]
20
+ // If sessionId is not set, it means the event was from the root target.
21
+ sessionId?: string;
22
+ };
23
+ }
24
+
8
25
  /**
9
26
  * Union of raw (over the wire) message format of all possible Crdp events,
10
27
  * of the form `{method: 'Domain.event', params: eventPayload}`.
@@ -50,24 +67,9 @@ declare module Protocol {
50
67
  once<E extends keyof TEventRecord>(event: E, listener: (...args: TEventRecord[E]) => void): void;
51
68
 
52
69
  emit<E extends keyof TEventRecord>(event: E, ...request: TEventRecord[E]): void;
53
- }
54
- }
55
70
 
56
- /**
57
- * An intermediate type, used to create a record of all possible Crdp raw event
58
- * messages, keyed on method. e.g. {
59
- * 'Domain.method1Name': {method: 'Domain.method1Name', params: EventPayload1},
60
- * 'Domain.method2Name': {method: 'Domain.method2Name', params: EventPayload2},
61
- * }
62
- */
63
- type RawEventMessageRecord = {
64
- [K in keyof LH.CrdpEvents]: {
65
- method: K,
66
- // Drop [] for `undefined` (so a JS value is valid).
67
- params: LH.CrdpEvents[K] extends [] ? undefined: LH.CrdpEvents[K][number]
68
- // If sessionId is not set, it means the event was from the root target.
69
- sessionId?: string;
70
- };
71
+ listenerCount<E extends keyof TEventRecord>(event: E): number;
72
+ }
71
73
  }
72
74
 
73
75
  export default Protocol;