autoAttachRelated method

Future<void> autoAttachRelated(
  1. TargetID targetId,
  2. bool waitForDebuggerOnStart, {
  3. TargetFilter? filter,
})

Adds the specified target to the list of targets that will be monitored for any related target creation (such as child frames, child workers and new versions of service worker) and reported through attachedToTarget. The specified target is also auto-attached. This cancels the effect of any previous setAutoAttach and is also cancelled by subsequent setAutoAttach. Only available at the Browser target. waitForDebuggerOnStart Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets. filter Only targets matching filter will be attached.

Implementation

Future<void> autoAttachRelated(TargetID targetId, bool waitForDebuggerOnStart,
    {TargetFilter? filter}) async {
  await _client.send('Target.autoAttachRelated', {
    'targetId': targetId,
    'waitForDebuggerOnStart': waitForDebuggerOnStart,
    if (filter != null) 'filter': filter,
  });
}