lighthouse 9.5.0-dev.20220531 → 9.5.0-dev.20220603

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.
@@ -304,20 +304,27 @@ class Driver {
304
304
  return;
305
305
  }
306
306
 
307
- // Events from subtargets will be stringified and sent back on `Target.receivedMessageFromTarget`.
308
- // We want to receive information about network requests from iframes, so enable the Network domain.
309
- await this.sendCommandToSession('Network.enable', event.sessionId);
310
-
311
- // We also want to receive information about subtargets of subtargets, so make sure we autoattach recursively.
312
- await this.sendCommandToSession('Target.setAutoAttach', event.sessionId, {
313
- autoAttach: true,
314
- flatten: true,
315
- // Pause targets on startup so we don't miss anything
316
- waitForDebuggerOnStart: true,
317
- });
318
-
319
- // We suspended the target when we auto-attached, so make sure it goes back to being normal.
320
- await this.sendCommandToSession('Runtime.runIfWaitingForDebugger', event.sessionId);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse",
3
- "version": "9.5.0-dev.20220531",
3
+ "version": "9.5.0-dev.20220603",
4
4
  "description": "Automated auditing, performance metrics, and best practices for the web.",
5
5
  "main": "./lighthouse-core/index.js",
6
6
  "bin": {