lighthouse 9.5.0-dev.20220601 → 9.5.0-dev.20220602
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.
- package/lighthouse-core/gather/driver.js +21 -14
- package/package.json +1 -1
|
@@ -304,20 +304,27 @@ class Driver {
|
|
|
304
304
|
return;
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
//
|
|
308
|
-
//
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
//
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
//
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
307
|
+
// Note: This is only reached for _out of process_ iframes (OOPIFs).
|
|
308
|
+
// If the iframe is in the same process as its embedding document, that means they
|
|
309
|
+
// share the same target.
|
|
310
|
+
|
|
311
|
+
// A target won't acknowledge/respond to protocol methods (or, at least for Network.enable)
|
|
312
|
+
// until it is resumed. But also we're paranoid about sending Network.enable _slightly_ too late,
|
|
313
|
+
// so we issue that method first. Therefore, we don't await on this serially, but await all at once.
|
|
314
|
+
await Promise.all([
|
|
315
|
+
// Events from subtargets will be stringified and sent back on `Target.receivedMessageFromTarget`.
|
|
316
|
+
// We want to receive information about network requests from iframes, so enable the Network domain.
|
|
317
|
+
this.sendCommandToSession('Network.enable', event.sessionId),
|
|
318
|
+
// We also want to receive information about subtargets of subtargets, so make sure we autoattach recursively.
|
|
319
|
+
this.sendCommandToSession('Target.setAutoAttach', event.sessionId, {
|
|
320
|
+
autoAttach: true,
|
|
321
|
+
flatten: true,
|
|
322
|
+
// Pause targets on startup so we don't miss anything
|
|
323
|
+
waitForDebuggerOnStart: true,
|
|
324
|
+
}),
|
|
325
|
+
// We suspended the target when we auto-attached, so make sure it goes back to being normal.
|
|
326
|
+
this.sendCommandToSession('Runtime.runIfWaitingForDebugger', event.sessionId),
|
|
327
|
+
]);
|
|
321
328
|
}
|
|
322
329
|
|
|
323
330
|
/**
|
package/package.json
CHANGED