-
public final class TargetDomainSupports additional targets discovery and allows to attach to them.
-
-
Method Summary
Modifier and Type Method Description final Flow<TargetEvent>events()Subscribes to all events related to this domain. final Flow<TargetEvent.AttachedToTargetEvent>attachedToTarget()Issued when attached to target because of auto-attach or attachToTargetcommand.final Flow<TargetEvent.DetachedFromTargetEvent>detachedFromTarget()Issued when detached from target for any reason (including detachFromTargetcommand).final Flow<TargetEvent.ReceivedMessageFromTargetEvent>receivedMessageFromTarget()Notifies about a new protocol message received from the session (as reported in attachedToTargetevent).final Flow<TargetEvent.TargetCreatedEvent>targetCreated()Issued when a possible inspection target is created. final Flow<TargetEvent.TargetDestroyedEvent>targetDestroyed()Issued when a target is destroyed. final Flow<TargetEvent.TargetCrashedEvent>targetCrashed()Issued when a target has crashed. final Flow<TargetEvent.TargetInfoChangedEvent>targetInfoChanged()Issued when some information about a target has changed. final UnitactivateTarget(ActivateTargetRequest input)Activates (focuses) the target. final AttachToTargetResponseattachToTarget(AttachToTargetRequest input)Attaches to the target with given id. final AttachToBrowserTargetResponseattachToBrowserTarget()Attaches to the browser target, only uses flat sessionId mode. final CloseTargetResponsecloseTarget(CloseTargetRequest input)Closes the target. final UnitexposeDevToolsProtocol(ExposeDevToolsProtocolRequest input)Inject object to the target's main frame that provides a communication channel with browser target. final CreateBrowserContextResponsecreateBrowserContext(CreateBrowserContextRequest input)Creates a new empty BrowserContext. final GetBrowserContextsResponsegetBrowserContexts()Returns all browser contexts created with Target.createBrowserContextmethod.final CreateTargetResponsecreateTarget(CreateTargetRequest input)Creates a new page. final UnitdetachFromTarget(DetachFromTargetRequest input)Detaches session with given id. final UnitdisposeBrowserContext(DisposeBrowserContextRequest input)Deletes a BrowserContext. final GetTargetInfoResponsegetTargetInfo(GetTargetInfoRequest input)Returns information about a target. final GetTargetsResponsegetTargets()Retrieves a list of available targets. final UnitsendMessageToTarget(SendMessageToTargetRequest input)Sends protocol message over session with given id. final UnitsetAutoAttach(SetAutoAttachRequest input)Controls whether to automatically attach to new targets which are considered to be related to this one. final UnitsetDiscoverTargets(SetDiscoverTargetsRequest input)Controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyedevents.final UnitsetRemoteLocations(SetRemoteLocationsRequest input)Enables target discovery for the specified locations, when setDiscoverTargetswas set totrue.-
-
Method Detail
-
events
final Flow<TargetEvent> events()
Subscribes to all events related to this domain.
-
attachedToTarget
final Flow<TargetEvent.AttachedToTargetEvent> attachedToTarget()
Issued when attached to target because of auto-attach or
attachToTargetcommand.
-
detachedFromTarget
final Flow<TargetEvent.DetachedFromTargetEvent> detachedFromTarget()
Issued when detached from target for any reason (including
detachFromTargetcommand). Can be issued multiple times per target if multiple sessions have been attached to it.
-
receivedMessageFromTarget
final Flow<TargetEvent.ReceivedMessageFromTargetEvent> receivedMessageFromTarget()
Notifies about a new protocol message received from the session (as reported in
attachedToTargetevent).
-
targetCreated
final Flow<TargetEvent.TargetCreatedEvent> targetCreated()
Issued when a possible inspection target is created.
-
targetDestroyed
final Flow<TargetEvent.TargetDestroyedEvent> targetDestroyed()
Issued when a target is destroyed.
-
targetCrashed
final Flow<TargetEvent.TargetCrashedEvent> targetCrashed()
Issued when a target has crashed.
-
targetInfoChanged
final Flow<TargetEvent.TargetInfoChangedEvent> targetInfoChanged()
Issued when some information about a target has changed. This only happens between
targetCreatedandtargetDestroyed.
-
activateTarget
final Unit activateTarget(ActivateTargetRequest input)
Activates (focuses) the target.
-
attachToTarget
final AttachToTargetResponse attachToTarget(AttachToTargetRequest input)
Attaches to the target with given id.
-
attachToBrowserTarget
final AttachToBrowserTargetResponse attachToBrowserTarget()
Attaches to the browser target, only uses flat sessionId mode.
-
closeTarget
final CloseTargetResponse closeTarget(CloseTargetRequest input)
Closes the target. If the target is a page that gets closed too.
-
exposeDevToolsProtocol
final Unit exposeDevToolsProtocol(ExposeDevToolsProtocolRequest input)
Inject object to the target's main frame that provides a communication channel with browser target.
Injected object will be available as
window[bindingName].The object has the follwing API:
binding.send(json)- a method to send messages over the remote debugging protocolbinding.onmessage = json => handleMessage(json)- a callback that will be called for the protocol notifications and command responses.
-
createBrowserContext
final CreateBrowserContextResponse createBrowserContext(CreateBrowserContextRequest input)
Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.
-
getBrowserContexts
final GetBrowserContextsResponse getBrowserContexts()
Returns all browser contexts created with
Target.createBrowserContextmethod.
-
createTarget
final CreateTargetResponse createTarget(CreateTargetRequest input)
Creates a new page.
-
detachFromTarget
final Unit detachFromTarget(DetachFromTargetRequest input)
Detaches session with given id.
-
disposeBrowserContext
final Unit disposeBrowserContext(DisposeBrowserContextRequest input)
Deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.
-
getTargetInfo
final GetTargetInfoResponse getTargetInfo(GetTargetInfoRequest input)
Returns information about a target.
-
getTargets
final GetTargetsResponse getTargets()
Retrieves a list of available targets.
-
sendMessageToTarget
@Deprecated(message = "Deprecated in the Chrome DevTools protocol") final Unit sendMessageToTarget(SendMessageToTargetRequest input)
Sends protocol message over session with given id. Consider using flat mode instead; see commands attachToTarget, setAutoAttach, and crbug.com/991325.
-
setAutoAttach
final Unit setAutoAttach(SetAutoAttachRequest input)
Controls whether to automatically attach to new targets which are considered to be related to this one. When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets.
-
setDiscoverTargets
final Unit setDiscoverTargets(SetDiscoverTargetsRequest input)
Controls whether to discover available targets and notify via
targetCreated/targetInfoChanged/targetDestroyedevents.
-
setRemoteLocations
final Unit setRemoteLocations(SetRemoteLocationsRequest input)
Enables target discovery for the specified locations, when
setDiscoverTargetswas set totrue.
-
-
-
-