lighthouse 9.5.0-dev.20220317 → 9.5.0-dev.20220318
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.
|
@@ -18,20 +18,8 @@ class JsUsage extends FRGatherer {
|
|
|
18
18
|
|
|
19
19
|
constructor() {
|
|
20
20
|
super();
|
|
21
|
-
/** @type {LH.Crdp.Debugger.ScriptParsedEvent[]} */
|
|
22
|
-
this._scriptParsedEvents = [];
|
|
23
21
|
/** @type {LH.Crdp.Profiler.ScriptCoverage[]} */
|
|
24
22
|
this._scriptUsages = [];
|
|
25
|
-
this.onScriptParsed = this.onScriptParsed.bind(this);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param {LH.Crdp.Debugger.ScriptParsedEvent} event
|
|
30
|
-
*/
|
|
31
|
-
onScriptParsed(event) {
|
|
32
|
-
if (event.embedderName) {
|
|
33
|
-
this._scriptParsedEvents.push(event);
|
|
34
|
-
}
|
|
35
23
|
}
|
|
36
24
|
|
|
37
25
|
/**
|
|
@@ -54,24 +42,6 @@ class JsUsage extends FRGatherer {
|
|
|
54
42
|
await session.sendCommand('Profiler.disable');
|
|
55
43
|
}
|
|
56
44
|
|
|
57
|
-
/**
|
|
58
|
-
* @param {LH.Gatherer.FRTransitionalContext} context
|
|
59
|
-
*/
|
|
60
|
-
async startSensitiveInstrumentation(context) {
|
|
61
|
-
const session = context.driver.defaultSession;
|
|
62
|
-
session.on('Debugger.scriptParsed', this.onScriptParsed);
|
|
63
|
-
await session.sendCommand('Debugger.enable');
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* @param {LH.Gatherer.FRTransitionalContext} context
|
|
68
|
-
*/
|
|
69
|
-
async stopSensitiveInstrumentation(context) {
|
|
70
|
-
const session = context.driver.defaultSession;
|
|
71
|
-
await session.sendCommand('Debugger.disable');
|
|
72
|
-
session.off('Debugger.scriptParsed', this.onScriptParsed);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
45
|
/**
|
|
76
46
|
* @return {Promise<LH.Artifacts['JsUsage']>}
|
|
77
47
|
*/
|
package/package.json
CHANGED