# Scrapfly Documentation

## Table of Contents

### Dashboard

- [Intro](https://scrapfly.io/docs)
- [Project](https://scrapfly.io/docs/project)
- [Account](https://scrapfly.io/docs/account)
- [Workspace & Team](https://scrapfly.io/docs/workspace-and-team)
- [Billing](https://scrapfly.io/docs/billing)

### Products

#### MCP Server

- [Getting Started](https://scrapfly.io/docs/mcp/getting-started)
- [Tools & API Spec](https://scrapfly.io/docs/mcp/tools)
- [Authentication](https://scrapfly.io/docs/mcp/authentication)
- [Examples & Use Cases](https://scrapfly.io/docs/mcp/examples)
- [FAQ](https://scrapfly.io/docs/mcp/faq)
##### Integrations

- [Overview](https://scrapfly.io/docs/mcp/integrations)
- [Claude Desktop](https://scrapfly.io/docs/mcp/integrations/claude-desktop)
- [Claude Code](https://scrapfly.io/docs/mcp/integrations/claude-code)
- [ChatGPT](https://scrapfly.io/docs/mcp/integrations/chatgpt)
- [Cursor](https://scrapfly.io/docs/mcp/integrations/cursor)
- [Cline](https://scrapfly.io/docs/mcp/integrations/cline)
- [Windsurf](https://scrapfly.io/docs/mcp/integrations/windsurf)
- [Zed](https://scrapfly.io/docs/mcp/integrations/zed)
- [Roo Code](https://scrapfly.io/docs/mcp/integrations/roo-code)
- [VS Code](https://scrapfly.io/docs/mcp/integrations/vscode)
- [LangChain](https://scrapfly.io/docs/mcp/integrations/langchain)
- [LlamaIndex](https://scrapfly.io/docs/mcp/integrations/llamaindex)
- [CrewAI](https://scrapfly.io/docs/mcp/integrations/crewai)
- [OpenAI](https://scrapfly.io/docs/mcp/integrations/openai)
- [n8n](https://scrapfly.io/docs/mcp/integrations/n8n)
- [Make](https://scrapfly.io/docs/mcp/integrations/make)
- [Zapier](https://scrapfly.io/docs/mcp/integrations/zapier)
- [Vapi AI](https://scrapfly.io/docs/mcp/integrations/vapi)
- [Agent Builder](https://scrapfly.io/docs/mcp/integrations/agent-builder)
- [Custom Client](https://scrapfly.io/docs/mcp/integrations/custom-client)


#### Web Scraping API

- [Getting Started](https://scrapfly.io/docs/scrape-api/getting-started)
- [API Specification]()
- [Monitoring](https://scrapfly.io/docs/monitoring)
- [Customize Request](https://scrapfly.io/docs/scrape-api/custom)
- [Debug](https://scrapfly.io/docs/scrape-api/debug)
- [Anti Scraping Protection](https://scrapfly.io/docs/scrape-api/anti-scraping-protection)
- [Proxy](https://scrapfly.io/docs/scrape-api/proxy)
- [Proxy Mode](https://scrapfly.io/docs/scrape-api/proxy-mode)
- [Proxy Mode - Screaming Frog](https://scrapfly.io/docs/scrape-api/proxy-mode/screaming-frog)
- [Proxy Mode - Apify](https://scrapfly.io/docs/scrape-api/proxy-mode/apify)
- [(Auto) Data Extraction](https://scrapfly.io/docs/scrape-api/extraction)
- [Javascript Rendering](https://scrapfly.io/docs/scrape-api/javascript-rendering)
- [Javascript Scenario](https://scrapfly.io/docs/scrape-api/javascript-scenario)
- [SSL](https://scrapfly.io/docs/scrape-api/ssl)
- [DNS](https://scrapfly.io/docs/scrape-api/dns)
- [Cache](https://scrapfly.io/docs/scrape-api/cache)
- [Session](https://scrapfly.io/docs/scrape-api/session)
- [Webhook](https://scrapfly.io/docs/scrape-api/webhook)
- [Screenshot](https://scrapfly.io/docs/scrape-api/screenshot)
- [Errors](https://scrapfly.io/docs/scrape-api/errors)
- [Timeout](https://scrapfly.io/docs/scrape-api/understand-timeout)
- [Throttling](https://scrapfly.io/docs/throttling)
- [Troubleshoot](https://scrapfly.io/docs/scrape-api/troubleshoot)
- [Billing](https://scrapfly.io/docs/scrape-api/billing)
- [FAQ](https://scrapfly.io/docs/scrape-api/faq)

#### Crawler API

- [Getting Started](https://scrapfly.io/docs/crawler-api/getting-started)
- [API Specification]()
- [Retrieving Results](https://scrapfly.io/docs/crawler-api/results)
- [WARC Format](https://scrapfly.io/docs/crawler-api/warc-format)
- [Data Extraction](https://scrapfly.io/docs/crawler-api/extraction-rules)
- [Webhook](https://scrapfly.io/docs/crawler-api/webhook)
- [Billing](https://scrapfly.io/docs/crawler-api/billing)
- [Errors](https://scrapfly.io/docs/crawler-api/errors)
- [Troubleshoot](https://scrapfly.io/docs/crawler-api/troubleshoot)
- [FAQ](https://scrapfly.io/docs/crawler-api/faq)

#### Screenshot API

- [Getting Started](https://scrapfly.io/docs/screenshot-api/getting-started)
- [API Specification]()
- [Accessibility Testing](https://scrapfly.io/docs/screenshot-api/accessibility)
- [Webhook](https://scrapfly.io/docs/screenshot-api/webhook)
- [Billing](https://scrapfly.io/docs/screenshot-api/billing)
- [Errors](https://scrapfly.io/docs/screenshot-api/errors)

#### Extraction API

- [Getting Started](https://scrapfly.io/docs/extraction-api/getting-started)
- [API Specification]()
- [Rules Template](https://scrapfly.io/docs/extraction-api/rules-and-template)
- [LLM Extraction](https://scrapfly.io/docs/extraction-api/llm-prompt)
- [AI Auto Extraction](https://scrapfly.io/docs/extraction-api/automatic-ai)
- [Webhook](https://scrapfly.io/docs/extraction-api/webhook)
- [Billing](https://scrapfly.io/docs/extraction-api/billing)
- [Errors](https://scrapfly.io/docs/extraction-api/errors)
- [FAQ](https://scrapfly.io/docs/extraction-api/faq)

#### Proxy Saver

- [Getting Started](https://scrapfly.io/docs/proxy-saver/getting-started)
- [Fingerprints](https://scrapfly.io/docs/proxy-saver/fingerprints)
- [Optimizations](https://scrapfly.io/docs/proxy-saver/optimizations)
- [SSL Certificates](https://scrapfly.io/docs/proxy-saver/certificates)
- [Protocols](https://scrapfly.io/docs/proxy-saver/protocols)
- [Pacfile](https://scrapfly.io/docs/proxy-saver/pacfile)
- [Secure Credentials](https://scrapfly.io/docs/proxy-saver/security)
- [Billing](https://scrapfly.io/docs/proxy-saver/billing)

#### Cloud Browser API

- [Getting Started](https://scrapfly.io/docs/cloud-browser-api/getting-started)
- [Proxy & Geo-Targeting](https://scrapfly.io/docs/cloud-browser-api/proxy)
- [Unblock API](https://scrapfly.io/docs/cloud-browser-api/unblock)
- [File Downloads](https://scrapfly.io/docs/cloud-browser-api/file-downloads)
- [Session Resume](https://scrapfly.io/docs/cloud-browser-api/session-resume)
- [Human-in-the-Loop](https://scrapfly.io/docs/cloud-browser-api/human-in-the-loop)
- [Debug Mode](https://scrapfly.io/docs/cloud-browser-api/debug-mode)
- [Bring Your Own Proxy](https://scrapfly.io/docs/cloud-browser-api/bring-your-own-proxy)
- [Browser Extensions](https://scrapfly.io/docs/cloud-browser-api/extensions)
- [Native Browser MCP](https://scrapfly.io/docs/cloud-browser-api/mcp)
- [DevTools Protocol](https://scrapfly.io/docs/cloud-browser-api/cdp-reference)
##### Integrations

- [Puppeteer](https://scrapfly.io/docs/cloud-browser-api/puppeteer)
- [Playwright](https://scrapfly.io/docs/cloud-browser-api/playwright)
- [Selenium](https://scrapfly.io/docs/cloud-browser-api/selenium)
- [Vercel Agent Browser](https://scrapfly.io/docs/cloud-browser-api/agent-browser)
- [Browser Use](https://scrapfly.io/docs/cloud-browser-api/browser-use)
- [Stagehand](https://scrapfly.io/docs/cloud-browser-api/stagehand)

- [Billing](https://scrapfly.io/docs/cloud-browser-api/billing)
- [Errors](https://scrapfly.io/docs/cloud-browser-api/errors)


### Tools

- [Antibot Detector](https://scrapfly.io/docs/tools/antibot-detector)

### SDK

- [Golang](https://scrapfly.io/docs/sdk/golang)
- [Python](https://scrapfly.io/docs/sdk/python)
- [Rust](https://scrapfly.io/docs/sdk/rust)
- [TypeScript](https://scrapfly.io/docs/sdk/typescript)
- [Scrapy](https://scrapfly.io/docs/sdk/scrapy)

### Integrations

- [Getting Started](https://scrapfly.io/docs/integration/getting-started)
- [LangChain](https://scrapfly.io/docs/integration/langchain)
- [LlamaIndex](https://scrapfly.io/docs/integration/llamaindex)
- [CrewAI](https://scrapfly.io/docs/integration/crewai)
- [Zapier](https://scrapfly.io/docs/integration/zapier)
- [Make](https://scrapfly.io/docs/integration/make)
- [n8n](https://scrapfly.io/docs/integration/n8n)

### Academy

- [Overview](https://scrapfly.io/academy)
- [Web Scraping Overview](https://scrapfly.io/academy/scraping-overview)
- [Tools](https://scrapfly.io/academy/tools-overview)
- [Reverse Engineering](https://scrapfly.io/academy/reverse-engineering)
- [Static Scraping](https://scrapfly.io/academy/static-scraping)
- [HTML Parsing](https://scrapfly.io/academy/html-parsing)
- [Dynamic Scraping](https://scrapfly.io/academy/dynamic-scraping)
- [Hidden API Scraping](https://scrapfly.io/academy/hidden-api-scraping)
- [Headless Browsers](https://scrapfly.io/academy/headless-browsers)
- [Hidden Web Data](https://scrapfly.io/academy/hidden-web-data)
- [JSON Parsing](https://scrapfly.io/academy/json-parsing)
- [Data Processing](https://scrapfly.io/academy/data-processing)
- [Scaling](https://scrapfly.io/academy/scaling)
- [Walkthrough Summary](https://scrapfly.io/academy/walkthrough-summary)
- [Scraper Blocking](https://scrapfly.io/academy/scraper-blocking)
- [Proxies](https://scrapfly.io/academy/proxies)

---

 1. [DevTools Protocol](https://scrapfly.io/docs/cloud-browser-api/cdp-reference)
2. Target
 
  # Target

 

Supports additional targets discovery and allows to attach to them.

 - [Commands (19)](#commands)
- [Events (7)](#events)
- [Types (7)](#types)
 
   

No symbols match your filter.

## Commands

#### `Target.activateTarget`

 

Activates (focuses) the target.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |

 

 

 

#### `Target.attachToTarget`

 

Attaches to the target with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |
| `flatten`  (optional) | `boolean` | Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `sessionId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-SessionID">SessionID</a>` | Id assigned to the session. |

 

 

 

#### `Target.attachToBrowserTarget`

 Experimental 

Attaches to the browser target, only uses flat sessionId mode.

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `sessionId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-SessionID">SessionID</a>` | Id assigned to the session. |

 

 

 

#### `Target.closeTarget`

 

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

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `success` Deprecated | `boolean` | Always set to true. If an error occurs, the response indicates protocol error. |

 

 

 

#### `Target.exposeDevToolsProtocol`

 Experimental 

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 =&gt; handleMessage(json)` - a callback that will be called for the protocol notifications and command responses.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |
| `bindingName`  (optional) | `string` | Binding name, 'cdp' if not specified. |
| `inheritPermissions`  (optional) | `boolean` | If true, inherits the current root session's permissions (default: false). |

 

 

 

#### `Target.createBrowserContext`

 

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

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `disposeOnDetach`  (optional) Experimental | `boolean` | If specified, disposes this context when debugging session disconnects. |
| `proxyServer`  (optional) Experimental | `string` | Proxy server, similar to the one passed to --proxy-server |
| `proxyBypassList`  (optional) Experimental | `string` | Proxy bypass list, similar to the one passed to --proxy-bypass-list |
| `originsWithUniversalNetworkAccess`  (optional) Experimental | `array<<a href="/docs/cloud-browser-api/cdp-reference/Target#type-string">string</a>>` | An optional list of origins to grant unlimited cross-origin access to. Parts of the URL other than those constituting origin are ignored. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `browserContextId` | `<a href="/docs/cloud-browser-api/cdp-reference/Browser#type-BrowserContextID">Browser.BrowserContextID</a>` | The id of the context created. |

 

 

 

#### `Target.getBrowserContexts`

 

Returns all browser contexts created with `Target.createBrowserContext` method.

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `browserContextIds` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Browser#type-BrowserContextID">Browser.BrowserContextID</a>>` | An array of browser context ids. |
| `defaultBrowserContextId`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Browser#type-BrowserContextID">Browser.BrowserContextID</a>` | The id of the default browser context if available. |

 

 

 

#### `Target.createTarget`

 

Creates a new page.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `url` | `string` | The initial URL the page will be navigated to. An empty string indicates about:blank. |
| `left`  (optional) Experimental | `integer` | Frame left origin in DIP (requires newWindow to be true or headless shell). |
| `top`  (optional) Experimental | `integer` | Frame top origin in DIP (requires newWindow to be true or headless shell). |
| `width`  (optional) | `integer` | Frame width in DIP (requires newWindow to be true or headless shell). |
| `height`  (optional) | `integer` | Frame height in DIP (requires newWindow to be true or headless shell). |
| `windowState`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-WindowState">WindowState</a>` | Frame window state (requires newWindow to be true or headless shell). Default is normal. |
| `browserContextId`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Browser#type-BrowserContextID">Browser.BrowserContextID</a>` | The browser context to create the page in. |
| `enableBeginFrameControl`  (optional) Experimental | `boolean` | Whether BeginFrames for this target will be controlled via DevTools (headless shell only, not supported on MacOS yet, false by default). |
| `newWindow`  (optional) | `boolean` | Whether to create a new Window or Tab (false by default, not supported by headless shell). |
| `background`  (optional) | `boolean` | Whether to create the target in background or foreground (false by default, not supported by headless shell). |
| `forTab`  (optional) Experimental | `boolean` | Whether to create the target of type "tab". |
| `hidden`  (optional) Experimental | `boolean` | Whether to create a hidden target. The hidden target is observable via protocol, but not present in the tab UI strip. Cannot be created with `forTab: true`, `newWindow: true` or `background: false`. The life-time of the tab is limited to the life-time of the session. |
| `focus`  (optional) Experimental | `boolean` | If specified, the option is used to determine if the new target should be focused or not. By default, the focus behavior depends on the value of the background field. For example, background=false and focus=false will result in the target tab being opened but the browser window remain unchanged (if it was in the background, it will remain in the background) and background=false with focus=undefined will result in the window being focused. Using background: true and focus: true is not supported and will result in an error. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | The id of the page opened. |

 

 

 

#### `Target.detachFromTarget`

 

Detaches session with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `sessionId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-SessionID">SessionID</a>` | Session to detach. |
| `targetId`  (optional) Deprecated | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | Deprecated. |

 

 

 

#### `Target.disposeBrowserContext`

 

Deletes a BrowserContext. All the belonging pages will be closed without calling their
beforeunload hooks.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `browserContextId` | `<a href="/docs/cloud-browser-api/cdp-reference/Browser#type-BrowserContextID">Browser.BrowserContextID</a>` |  |

 

 

 

#### `Target.getTargetInfo`

 Experimental 

Returns information about a target.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `targetInfo` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetInfo">TargetInfo</a>` |  |

 

 

 

#### `Target.getTargets`

 

Retrieves a list of available targets.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `filter`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetFilter">TargetFilter</a>` | Only targets matching filter will be reported. If filter is not specified and target discovery is currently enabled, a filter used for target discovery is used for consistency. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `targetInfos` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetInfo">TargetInfo</a>>` | The list of targets. |

 

 

 

#### `Target.sendMessageToTarget`

 Deprecated 

Sends protocol message over session with given id.
Consider using flat mode instead; see commands attachToTarget, setAutoAttach,
and crbug.com/991325.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `message` | `string` |  |
| `sessionId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-SessionID">SessionID</a>` | Identifier of the session. |
| `targetId`  (optional) Deprecated | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | Deprecated. |

 

 

 

#### `Target.setAutoAttach`

 

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.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `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. |
| `flatten`  (optional) Experimental | `boolean` | Enables "flat" access to the session via specifying sessionId attribute in the commands. We plan to make this the default, deprecate non-flattened mode, and eventually retire it. See crbug.com/991325. |
| `filter`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetFilter">TargetFilter</a>` | Only targets matching filter will be attached. |

 

 

 

#### `Target.autoAttachRelated`

 Experimental 

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.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |
| `waitForDebuggerOnStart` | `boolean` | Whether to pause new targets when attaching to them. Use `Runtime.runIfWaitingForDebugger` to run paused targets. |
| `filter`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetFilter">TargetFilter</a>` | Only targets matching filter will be attached. |

 

 

 

#### `Target.setDiscoverTargets`

 

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

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `discover` | `boolean` | Whether to discover available targets. |
| `filter`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetFilter">TargetFilter</a>` | Only targets matching filter will be attached. If `discover` is false, `filter` must be omitted or empty. |

 

 

 

#### `Target.setRemoteLocations`

 Experimental 

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

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `locations` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Target#type-RemoteLocation">RemoteLocation</a>>` | List of remote locations. |

 

 

 

#### `Target.getDevToolsTarget`

 Experimental 

Gets the targetId of the DevTools page target opened for the given target
(if any).

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | Page or tab target ID. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `targetId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | The targetId of DevTools page target if exists. |

 

 

 

#### `Target.openDevTools`

 Experimental 

Opens a DevTools window for the target.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | This can be the page or tab target ID. |
| `panelId`  (optional) | `string` | The id of the panel we want DevTools to open initially. Currently supported panels are elements, console, network, sources, resources and performance. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | The targetId of DevTools page target. |

 

 

 

 

## Events

#### `Target.attachedToTarget`

 Experimental 

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

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `sessionId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-SessionID">SessionID</a>` | Identifier assigned to the session used to send/receive messages. |
| `targetInfo` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetInfo">TargetInfo</a>` |  |
| `waitingForDebugger` | `boolean` |  |

 

 

 

#### `Target.detachedFromTarget`

 Experimental 

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

 | Name | Type | Description |
|---|---|---|
| `sessionId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-SessionID">SessionID</a>` | Detached session identifier. |
| `targetId`  (optional) Deprecated | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | Deprecated. |

 

 

 

#### `Target.receivedMessageFromTarget`

 

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

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `sessionId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-SessionID">SessionID</a>` | Identifier of a session which sends a message. |
| `message` | `string` |  |
| `targetId`  (optional) Deprecated | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | Deprecated. |

 

 

 

#### `Target.targetCreated`

 

Issued when a possible inspection target is created.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetInfo` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetInfo">TargetInfo</a>` |  |

 

 

 

#### `Target.targetDestroyed`

 

Issued when a target is destroyed.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |

 

 

 

#### `Target.targetCrashed`

 

Issued when a target has crashed.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |
| `status` | `string` | Termination status type. |
| `errorCode` | `integer` | Termination error code. |

 

 

 

#### `Target.targetInfoChanged`

 

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

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `targetInfo` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetInfo">TargetInfo</a>` |  |

 

 

 

 

## Types

#### `TargetID`

 (string) 

 

 

#### `SessionID`

 (string) 

Unique identifier of attached debugging session.

 

 

#### `TargetInfo`

 (object) 

###### Properties

 | Name | Type | Description |
|---|---|---|
| `targetId` | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` |  |
| `type` | `string` | List of types: https://source.chromium.org/chromium/chromium/src/+/main:content/browser/devtools/devtools\_agent\_host\_impl.cc?ss=chromium&amp;q=f:devtools%20-f:out%20%22::kTypeTab%5B%5D%22 |
| `title` | `string` |  |
| `url` | `string` |  |
| `attached` | `boolean` | Whether the target has an attached client. |
| `openerId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Target#type-TargetID">TargetID</a>` | Opener target Id |
| `canAccessOpener` Experimental | `boolean` | Whether the target has access to the originating window. |
| `openerFrameId`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Page#type-FrameId">Page.FrameId</a>` | Frame id of originating window (is only set if target has an opener). |
| `parentFrameId`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Page#type-FrameId">Page.FrameId</a>` | Id of the parent frame, only present for the "iframe" targets. |
| `browserContextId`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Browser#type-BrowserContextID">Browser.BrowserContextID</a>` |  |
| `subtype`  (optional) Experimental | `string` | Provides additional details for specific target types. For example, for the type of "page", this may be set to "prerender". |

 

 

 

#### `FilterEntry`

 (object) Experimental 

A filter used by target query/discovery/auto-attach operations.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `exclude`  (optional) | `boolean` | If set, causes exclusion of matching targets from the list. |
| `type`  (optional) | `string` | If not present, matches any type. |

 

 

 

#### `TargetFilter`

 (array) Experimental 

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`).

 

 

#### `RemoteLocation`

 (object) Experimental 

###### Properties

 | Name | Type | Description |
|---|---|---|
| `host` | `string` |  |
| `port` | `integer` |  |

 

 

 

#### `WindowState`

 (string) Experimental 

The state of the target window.

###### Allowed Values

- `normal`
- `minimized`
- `maximized`
- `fullscreen`