targets
Creates, updates, deletes, gets or lists a targets resource.
Overview
| Name | targets |
| Type | Resource |
| Id | cloudflare.browser_rendering.targets |
Fields
The following fields are returned by SELECT queries:
- list
List of targets.
| Name | Datatype | Description |
|---|---|---|
id | string | Target ID. |
description | string | Target description. |
devtoolsFrontendUrl | string | DevTools frontend URL. |
title | string | Title of the target. |
type | string | Target type (page, background_page, worker, etc.). |
url | string | URL of the target. |
webSocketDebuggerUrl | string | WebSocket URL for debugging this target. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | account_id, session_id | Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts. | |
create | replace | account_id, session_id | url | Opens a new tab in the browser. Optionally specify a URL to navigate to. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
account_id | string | The Cloudflare account ID. |
session_id | string | The session ID. |
url | string (uri) |
SELECT examples
- list
Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.
SELECT
id,
description,
devtoolsFrontendUrl,
title,
type,
url,
webSocketDebuggerUrl
FROM cloudflare.browser_rendering.targets
WHERE account_id = '{{ account_id }}' -- required
AND session_id = '{{ session_id }}' -- required
;
REPLACE examples
- create
Opens a new tab in the browser. Optionally specify a URL to navigate to.
REPLACE cloudflare.browser_rendering.targets
SET
-- No updatable properties
WHERE
account_id = '{{ account_id }}' --required
AND session_id = '{{ session_id }}' --required
AND url = '{{ url}}'
RETURNING
id,
description,
devtoolsFrontendUrl,
title,
type,
url,
webSocketDebuggerUrl;