Skip to main content

targets

Creates, updates, deletes, gets or lists a targets resource.

Overview

Nametargets
TypeResource
Idcloudflare.browser_rendering.targets

Fields

The following fields are returned by SELECT queries:

List of targets.

NameDatatypeDescription
idstringTarget ID.
descriptionstringTarget description.
devtoolsFrontendUrlstringDevTools frontend URL.
titlestringTitle of the target.
typestringTarget type (page, background_page, worker, etc.).
urlstringURL of the target.
webSocketDebuggerUrlstringWebSocket URL for debugging this target.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectaccount_id, session_idReturns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.
createreplaceaccount_id, session_idurlOpens 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.

NameDatatypeDescription
account_idstringThe Cloudflare account ID.
session_idstringThe session ID.
urlstring (uri)

SELECT examples

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

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;