BrowserRenderOptions
Shared render options for Cloudflare Browser Rendering quick actions. Mirrors the CF REST API; every field is optional and passed through as provided. See https://developers.cloudflare.com/browser-rendering/.
Definition
TypeScript
interface BrowserRenderOptions {
viewport?: { width: number; height: number } | undefined;
waitForSelector?:
| {
selector: string;
hidden?: boolean | undefined;
timeout?: number | undefined;
}
| undefined;
waitForTimeout?: number | undefined;
userAgent?: string | undefined;
authenticate?: { username: string; password: string } | undefined;
cookies?:
| Array<{
[x: string]: unknown;
name: string;
value: string;
url?: string | undefined;
domain?: string | undefined;
path?: string | undefined;
}>
| undefined;
extraHeaders?: Record<string, string> | undefined;
gotoOptions?:
| {
waitUntil?:
| "load"
| "domcontentloaded"
| "networkidle0"
| "networkidle2"
| undefined;
timeout?: number | undefined;
referer?: string | undefined;
}
| undefined;
bestAttempt?: boolean | undefined;
allowRequestPattern?: Array<string> | undefined;
rejectRequestPattern?: Array<string> | undefined;
allowResourceTypes?: Array<string> | undefined;
rejectResourceTypes?: Array<string> | undefined;
setJavaScriptEnabled?: boolean | undefined;
}Fields
| Field | Type | Notes |
|---|---|---|
viewport | { width: number; height: number; } | undefined | optional — Browser viewport in pixels. |
waitForSelector | { selector: string; hidden?: boolean | undefined; timeout?: number | undefined; } | undefined | optional — Wait for a CSS selector before capture. |
waitForTimeout | number | undefined | optional — Fixed delay in ms before capture. |
userAgent | string | undefined | optional — Custom User-Agent for the render request. |
authenticate | { username: string; password: string; } | undefined | optional — HTTP Basic auth credentials. |
cookies | Array<{ [x: string]: unknown; name: string; value: string; url?: string | undefined; domain?: string | undefined; path?: string | undefined; }> | undefined | optional — Cookies to set before navigation. |
extraHeaders | Record<string, string> | undefined | optional — Additional HTTP headers for the navigation. |
gotoOptions | { waitUntil?: "load" | "domcontentloaded" | "networkidle0" | "networkidle2" | undefined; timeout?: number | undefined; referer?: string | undefined; } | undefined | optional — Playwright-style goto options. |
bestAttempt | boolean | undefined | optional — If true, return whatever the browser has when timeouts fire instead of erroring. |
allowRequestPattern | Array<string> | undefined | optional — Regex allowlist of request URLs. |
rejectRequestPattern | Array<string> | undefined | optional — Regex blocklist of request URLs. |
allowResourceTypes | Array<string> | undefined | optional — Allowlist of Playwright resource types (e.g. document, image). |
rejectResourceTypes | Array<string> | undefined | optional — Blocklist of Playwright resource types. |
setJavaScriptEnabled | boolean | undefined | optional — Disable JS for the render. |