attach To Target
Creates a new ChildSession attached to the target with the given targetId. The new session shares the same underlying web socket connection as this BrowserSession.
Note that a ChildSession is a generic session that doesn't carry information about the exact target type, and thus doesn't offer very useful APIs. It is meant to be converted to a more specific session type using one of the converter extensions (ChildSession.as*()).
For example, if you're attaching to a worker, use ChildSession.asWorkerSession to get a WorkerSession, which offers the relevant domains for you.
Note: if you want to create a NEW page (or tab) and attach to it, use newPage instead. It will save you the trouble of creating the target, handling its browser context, and dealing with the return type.