Target
Types
Issued when attached to target because of auto-attach or attachToTarget
command.
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.
A filter used by target query/discovery/auto-attach operations.
Notifies about a new protocol message received from the session (as reported in attachedToTarget
event).
Issued when a target has crashed.
Issued when a possible inspection target is created.
Issued when a target is destroyed.
Issued when some information about a target has changed. This only happens between targetCreated
and targetDestroyed
.
The state of the target window.
Properties
Issued when attached to target because of auto-attach or attachToTarget
command.
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.
Notifies about a new protocol message received from the session (as reported in attachedToTarget
event).
Issued when a target has crashed.
Issued when a possible inspection target is created.
Issued when a target is destroyed.
Issued when some information about a target has changed. This only happens between targetCreated
and targetDestroyed
.
Functions
Activates (focuses) the target.
Attaches to the browser target, only uses flat sessionId mode.
Attaches to the target with given id.
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.
Closes the target. If the target is a page that gets closed too.
Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.
Creates a new page.
Detaches session with given id.
Deletes a BrowserContext. All the belonging pages will be closed without calling their beforeunload hooks.
Inject object to the target's main frame that provides a communication channel with browser target.
Returns all browser contexts created with Target.createBrowserContext
method.
Returns information about a target.
Retrieves a list of available targets.
Sends protocol message over session with given id. Consider using flat mode instead; see commands attachToTarget, setAutoAttach, and crbug.com/991325.
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.
Controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyed
events.
Enables target discovery for the specified locations, when setDiscoverTargets
was set to true
.