Skip to main content

Module target

Module target 

Source
Expand description

Supports additional targets discovery and allows to attach to them.

Types, command parameters and event payloads for the Target domain. The method-name constants for the same domain are in crate::methods.

Structs§

ActivateTargetParams
Activates (focuses) the target.
AttachToBrowserTargetParams
Attaches to the browser target, only uses flat sessionId mode.
AttachToBrowserTargetReturns
What Target.attachToBrowserTarget answers with.
AttachToTargetParams
Attaches to the target with given id.
AttachToTargetReturns
What Target.attachToTarget answers with.
AttachedToTargetEvent
Issued when attached to target because of auto-attach or attachToTarget command.
AutoAttachRelatedParams
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.
CloseTargetParams
Closes the target. If the target is a page that gets closed too.
CloseTargetReturns
What Target.closeTarget answers with.
CreateBrowserContextParams
Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.
CreateBrowserContextReturns
What Target.createBrowserContext answers with.
CreateTargetParams
Creates a new page.
CreateTargetReturns
What Target.createTarget answers with.
DetachFromTargetParams
Detaches session with given id.
DetachedFromTargetEvent
Issued when detached from target for any reason (including detachFromTarget command). Can be issued multiple times per target if multiple sessions have been attached to it.
DisposeBrowserContextParams
Deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.
ExposeDevToolsProtocolParams
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 following API: - binding.send(json) - a method to send messages over the remote debugging protocol - binding.onmessage = json =\> handleMessage(json) - a callback that will be called for the protocol notifications and command responses.
FilterEntry
A filter used by target query/discovery/auto-attach operations.
GetBrowserContextsParams
Returns all browser contexts created with Target.createBrowserContext method.
GetBrowserContextsReturns
What Target.getBrowserContexts answers with.
GetDevToolsTargetParams
Gets the targetId of the DevTools page target opened for the given target (if any).
GetDevToolsTargetReturns
What Target.getDevToolsTarget answers with.
GetTargetInfoParams
Returns information about a target.
GetTargetInfoReturns
What Target.getTargetInfo answers with.
GetTargetsParams
Retrieves a list of available targets.
GetTargetsReturns
What Target.getTargets answers with.
OpenDevToolsParams
Opens a DevTools window for the target.
OpenDevToolsReturns
What Target.openDevTools answers with.
ReceivedMessageFromTargetEvent
Notifies about a new protocol message received from the session (as reported in attachedToTarget event).
RemoteLocation
Experimental: may change without notice.
SendMessageToTargetParams
Sends protocol message over session with given id. Consider using flat mode instead; see commands attachToTarget, setAutoAttach, and crbug.com/991325.
SetAutoAttachParams
Controls whether to automatically attach to new targets which are considered to be directly related to this one (for example, iframes or workers). When turned on, attaches to all existing related targets as well. When turned off, automatically detaches from all currently attached targets. This also clears all targets added by autoAttachRelated from the list of targets to watch for creation of related targets. You might want to call this recursively for auto-attached targets to attach to all available targets.
SetDiscoverTargetsParams
Controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyed events.
SetRemoteLocationsParams
Enables target discovery for the specified locations, when setDiscoverTargets was set to true.
TargetCrashedEvent
Issued when a target has crashed.
TargetCreatedEvent
Issued when a possible inspection target is created.
TargetDestroyedEvent
Issued when a target is destroyed.
TargetInfo
TargetInfoChangedEvent
Issued when some information about a target has changed. This only happens between targetCreated and targetDestroyed.

Enums§

WindowState
The state of the target window.

Type Aliases§

SessionId
Unique identifier of attached debugging session.
TargetFilter
The entries in TargetFilter are matched sequentially against targets and the first entry that matches determines if the target is included or not, depending on the value of exclude field in the entry. If filter is not specified, the one assumed is [{type: “browser”, exclude: true}, {type: “tab”, exclude: true}, {}] (i.e. include everything but browser and tab).
TargetId