stable (1.2) latest (tip-of-tree) v8-inspector (node) Home Domains Accessibility Animation ApplicationCache Audits Browser CSS CacheStorage Console DOM DOMDebugger DOMSnapshot DOMStorage Database Debugger DeviceOrientation Emulation HeapProfiler IO IndexedDB Input Inspector LayerTree Log Memory Network Overlay Page Performance Profiler Runtime Schema Security ServiceWorker Storage SystemInfo Target Tethering Tracing
Chrome DevTools Protocol Viewer - latest (tip-of-tree)

Target Domain

Supports additional targets discovery and allows to attach to them.

Experimental

Methods

Target.setDiscoverTargets

Controls whether to discover available targets and notify via targetCreated/targetInfoChanged/targetDestroyed events.

Parameters
discover
boolean Whether to discover available targets.

Target.setAutoAttach

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.

Parameters
autoAttach
boolean Whether to auto-attach to related targets.
waitForDebuggerOnStart
boolean Whether to pause new targets when attaching to them. Use Runtime.runIfWaitingForDebugger to run paused targets.

Target.setAttachToFrames

Parameters
value
boolean Whether to attach to frames.

Target.setRemoteLocations

Enables target discovery for the specified locations, when setDiscoverTargets was set to true.

Parameters
locations
array [ RemoteLocation ] List of remote locations.

Target.sendMessageToTarget

Sends protocol message over session with given id.

Parameters
message
string
sessionId
SessionID Identifier of the session.
targetId
TargetID Deprecated. Deprecated

Target.getTargetInfo

Returns information about a target.

Parameters
targetId
TargetID
Return object
targetInfo
TargetInfo

Target.activateTarget

Activates (focuses) the target.

Parameters
targetId
TargetID

Target.closeTarget

Closes the target. If the target is a page that gets closed too.

Parameters
targetId
TargetID
Return object
success
boolean

Target.attachToTarget

Attaches to the target with given id.

Parameters
targetId
TargetID
Return object
sessionId
SessionID Id assigned to the session.

Target.detachFromTarget

Detaches session with given id.

Parameters
sessionId
SessionID Session to detach.
targetId
TargetID Deprecated. Deprecated

Target.createBrowserContext

Creates a new empty BrowserContext. Similar to an incognito profile but you can have more than one.

Return object
browserContextId
BrowserContextID The id of the context created.

Target.disposeBrowserContext

Deletes a BrowserContext, will fail of any open page uses it.

Parameters
browserContextId
BrowserContextID
Return object
success
boolean

Target.createTarget

Creates a new page.

Parameters
url
string The initial URL the page will be navigated to.
width
integer Frame width in DIP (headless chrome only).
height
integer Frame height in DIP (headless chrome only).
browserContextId
BrowserContextID The browser context to create the page in (headless chrome only).
Return object
targetId
TargetID The id of the page opened.

Target.getTargets

Retrieves a list of available targets.

Return object
targetInfos
array [ TargetInfo ] The list of targets.

Events

Target.targetCreated

Issued when a possible inspection target is created.

Parameters
targetInfo
TargetInfo

Target.targetInfoChanged

Issued when some information about a target has changed. This only happens between targetCreated and targetDestroyed.

Parameters
targetInfo
TargetInfo

Target.targetDestroyed

Issued when a target is destroyed.

Parameters
targetId
TargetID

Target.attachedToTarget

Issued when attached to target because of auto-attach or attachToTarget command.

Parameters
sessionId
SessionID Identifier assigned to the session used to send/receive messages.
targetInfo
TargetInfo
waitingForDebugger
boolean

Target.detachedFromTarget

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.

Parameters
sessionId
SessionID Detached session identifier.
targetId
TargetID Deprecated. Deprecated

Target.receivedMessageFromTarget

Notifies about a new protocol message received from the session (as reported in attachedToTarget event).

Parameters
sessionId
SessionID Identifier of a session which sends a message.
message
string
targetId
TargetID Deprecated. Deprecated

Types

TargetID

Type: string

SessionID

Unique identifier of attached debugging session.

Type: string

BrowserContextID

Type: string

TargetInfo

Type: object

Properties
targetId
TargetID
type
string
title
string
url
string
attached
boolean Whether the target has an attached client.

RemoteLocation

Type: object

Properties
host
string
port
integer