stable (1.2) latest (tip-of-tree) v8-inspector (node) Home Domains Accessibility Animation ApplicationCache Browser CSS CacheStorage Console DOM DOMDebugger DOMSnapshot DOMStorage Database Debugger DeviceOrientation Emulation HeapProfiler IO IndexedDB Input Inspector LayerTree Log Memory Network Overlay Page 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/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 to the target with given id.

Parameters
targetId
TargetID
message
string

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
success
boolean Whether attach succeeded.

Target.detachFromTarget

Detaches from the target with given id.

Parameters
targetId
TargetID

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. 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
targetInfo
TargetInfo
waitingForDebugger
boolean

Target. detachedFromTarget

Issued when detached from target for any reason (including detachFromTarget command).

Parameters
targetId
TargetID

Target. receivedMessageFromTarget

Notifies about new protocol message from attached target.

Parameters
targetId
TargetID
message
string

Types

TargetID

Type: string

BrowserContextID

Type: string

TargetInfo

Type: object

Properties
targetId
TargetID
type
string
title
string
url
string

RemoteLocation

Type: object

Properties
host
string
port
integer