# 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. Runtime
 
  # Runtime

 

Runtime domain exposes JavaScript runtime by means of remote evaluation and mirror objects. Evaluation results are returned as mirror object that expose object type, string representation and unique identifier that can be used for further object reference. Original objects are maintained in memory unless they are either explicitly released or are released along with the other objects in their object group.

 - [Commands (23)](#commands)
- [Events (8)](#events)
- [Types (23)](#types)
 
   

No symbols match your filter.

## Commands

#### `Runtime.awaitPromise`

 

Add handler to promise with given promise object id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `promiseObjectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | Identifier of the promise. |
| `returnByValue`  (optional) | `boolean` | Whether the result is expected to be a JSON object that should be sent by value. |
| `generatePreview`  (optional) | `boolean` | Whether preview should be generated for the result. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `result` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | Promise result. Will contain rejected value if promise was rejected. |
| `exceptionDetails`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExceptionDetails">ExceptionDetails</a>` | Exception details if stack strace is available. |

 

 

 

#### `Runtime.callFunctionOn`

 

Calls function with given declaration on the given object. Object group of the result is
inherited from the target object.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `functionDeclaration` | `string` | Declaration of the function to call. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | Identifier of the object to call function on. Either objectId or executionContextId should be specified. |
| `arguments`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-CallArgument">CallArgument</a>>` | Call arguments. All call arguments must belong to the same JavaScript world as the target object. |
| `silent`  (optional) | `boolean` | In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state. |
| `returnByValue`  (optional) | `boolean` | Whether the result is expected to be a JSON object which should be sent by value. Can be overriden by `serializationOptions`. |
| `generatePreview`  (optional) Experimental | `boolean` | Whether preview should be generated for the result. |
| `userGesture`  (optional) | `boolean` | Whether execution should be treated as initiated by user in the UI. |
| `awaitPromise`  (optional) | `boolean` | Whether execution should `await` for resulting value and return once awaited promise is resolved. |
| `executionContextId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Specifies execution context which global object will be used to call function on. Either executionContextId or objectId should be specified. |
| `objectGroup`  (optional) | `string` | Symbolic group name that can be used to release multiple objects. If objectGroup is not specified and objectId is, objectGroup will be inherited from object. |
| `throwOnSideEffect`  (optional) Experimental | `boolean` | Whether to throw an exception if side effect cannot be ruled out during evaluation. |
| `uniqueContextId`  (optional) Experimental | `string` | An alternative way to specify the execution context to call function on. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental function call in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with `executionContextId`. |
| `serializationOptions`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-SerializationOptions">SerializationOptions</a>` | Specifies the result serialization. If provided, overrides `generatePreview` and `returnByValue`. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `result` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | Call result. |
| `exceptionDetails`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExceptionDetails">ExceptionDetails</a>` | Exception details. |

 

 

 

#### `Runtime.compileScript`

 

Compiles expression.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `expression` | `string` | Expression to compile. |
| `sourceURL` | `string` | Source url to be set for the script. |
| `persistScript` | `boolean` | Specifies whether the compiled script should be persisted. |
| `executionContextId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `scriptId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ScriptId">ScriptId</a>` | Id of the script. |
| `exceptionDetails`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExceptionDetails">ExceptionDetails</a>` | Exception details. |

 

 

 

#### `Runtime.disable`

 

Disables reporting of execution contexts creation.

 

 

#### `Runtime.discardConsoleEntries`

 

Discards collected exceptions and console API calls.

 

 

#### `Runtime.enable`

 

Enables reporting of execution contexts creation by means of `executionContextCreated` event.
When the reporting gets enabled the event will be sent immediately for each existing execution
context.

 

 

#### `Runtime.evaluate`

 

Evaluates expression on global object.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `expression` | `string` | Expression to evaluate. |
| `objectGroup`  (optional) | `string` | Symbolic group name that can be used to release multiple objects. |
| `includeCommandLineAPI`  (optional) | `boolean` | Determines whether Command Line API should be available during the evaluation. |
| `silent`  (optional) | `boolean` | In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state. |
| `contextId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Specifies in which execution context to perform evaluation. If the parameter is omitted the evaluation will be performed in the context of the inspected page. This is mutually exclusive with `uniqueContextId`, which offers an alternative way to identify the execution context that is more reliable in a multi-process environment. |
| `returnByValue`  (optional) | `boolean` | Whether the result is expected to be a JSON object that should be sent by value. |
| `generatePreview`  (optional) Experimental | `boolean` | Whether preview should be generated for the result. |
| `userGesture`  (optional) | `boolean` | Whether execution should be treated as initiated by user in the UI. |
| `awaitPromise`  (optional) | `boolean` | Whether execution should `await` for resulting value and return once awaited promise is resolved. |
| `throwOnSideEffect`  (optional) Experimental | `boolean` | Whether to throw an exception if side effect cannot be ruled out during evaluation. This implies `disableBreaks` below. |
| `timeout`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-TimeDelta">TimeDelta</a>` | Terminate execution after timing out (number of milliseconds). |
| `disableBreaks`  (optional) Experimental | `boolean` | Disable breakpoints during execution. |
| `replMode`  (optional) Experimental | `boolean` | Setting this flag to true enables `let` re-declaration and top-level `await`. Note that `let` variables can only be re-declared if they originate from `replMode` themselves. |
| `allowUnsafeEvalBlockedByCSP`  (optional) Experimental | `boolean` | The Content Security Policy (CSP) for the target might block 'unsafe-eval' which includes eval(), Function(), setTimeout() and setInterval() when called with non-callable arguments. This flag bypasses CSP for this evaluation and allows unsafe-eval. Defaults to true. |
| `uniqueContextId`  (optional) Experimental | `string` | An alternative way to specify the execution context to evaluate in. Compared to contextId that may be reused across processes, this is guaranteed to be system-unique, so it can be used to prevent accidental evaluation of the expression in context different than intended (e.g. as a result of navigation across process boundaries). This is mutually exclusive with `contextId`. |
| `serializationOptions`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-SerializationOptions">SerializationOptions</a>` | Specifies the result serialization. If provided, overrides `generatePreview` and `returnByValue`. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `result` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | Evaluation result. |
| `exceptionDetails`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExceptionDetails">ExceptionDetails</a>` | Exception details. |

 

 

 

#### `Runtime.getIsolateId`

 Experimental 

Returns the isolate id.

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `id` | `string` | The isolate id. |

 

 

 

#### `Runtime.getHeapUsage`

 Experimental 

Returns the JavaScript heap usage.
It is the total usage of the corresponding isolate not scoped to a particular Runtime.

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `usedSize` | `number` | Used JavaScript heap size in bytes. |
| `totalSize` | `number` | Allocated JavaScript heap size in bytes. |
| `embedderHeapUsedSize` | `number` | Used size in bytes in the embedder's garbage-collected heap. |
| `backingStorageSize` | `number` | Size in bytes of backing storage for array buffers and external strings. |

 

 

 

#### `Runtime.getProperties`

 

Returns properties of a given object. Object group of the result is inherited from the target
object.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `objectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | Identifier of the object to return properties for. |
| `ownProperties`  (optional) | `boolean` | If true, returns properties belonging only to the element itself, not to its prototype chain. |
| `accessorPropertiesOnly`  (optional) Experimental | `boolean` | If true, returns accessor properties (with getter/setter) only; internal properties are not returned either. |
| `generatePreview`  (optional) Experimental | `boolean` | Whether preview should be generated for the results. |
| `nonIndexedPropertiesOnly`  (optional) Experimental | `boolean` | If true, returns non-indexed properties only. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `result` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-PropertyDescriptor">PropertyDescriptor</a>>` | Object properties. |
| `internalProperties`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-InternalPropertyDescriptor">InternalPropertyDescriptor</a>>` | Internal object properties (only of the element itself). |
| `privateProperties`  (optional) Experimental | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-PrivatePropertyDescriptor">PrivatePropertyDescriptor</a>>` | Object private properties. |
| `exceptionDetails`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExceptionDetails">ExceptionDetails</a>` | Exception details. |

 

 

 

#### `Runtime.globalLexicalScopeNames`

 

Returns all let, const and class variables from global scope.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `executionContextId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Specifies in which execution context to lookup global scope variables. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `names` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-string">string</a>>` |  |

 

 

 

#### `Runtime.queryObjects`

 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `prototypeObjectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | Identifier of the prototype to return objects for. |
| `objectGroup`  (optional) | `string` | Symbolic group name that can be used to release the results. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `objects` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | Array with objects. |

 

 

 

#### `Runtime.releaseObject`

 

Releases remote object with given id.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `objectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | Identifier of the object to release. |

 

 

 

#### `Runtime.releaseObjectGroup`

 

Releases all remote objects that belong to a given group.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `objectGroup` | `string` | Symbolic object group name. |

 

 

 

#### `Runtime.runIfWaitingForDebugger`

 

Tells inspected instance to run if it was waiting for debugger to attach.

 

 

#### `Runtime.runScript`

 

Runs script with given id in a given context.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `scriptId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ScriptId">ScriptId</a>` | Id of the script to run. |
| `executionContextId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Specifies in which execution context to perform script run. If the parameter is omitted the evaluation will be performed in the context of the inspected page. |
| `objectGroup`  (optional) | `string` | Symbolic group name that can be used to release multiple objects. |
| `silent`  (optional) | `boolean` | In silent mode exceptions thrown during evaluation are not reported and do not pause execution. Overrides `setPauseOnException` state. |
| `includeCommandLineAPI`  (optional) | `boolean` | Determines whether Command Line API should be available during the evaluation. |
| `returnByValue`  (optional) | `boolean` | Whether the result is expected to be a JSON object which should be sent by value. |
| `generatePreview`  (optional) | `boolean` | Whether preview should be generated for the result. |
| `awaitPromise`  (optional) | `boolean` | Whether execution should `await` for resulting value and return once awaited promise is resolved. |

 

###### Return Object

 | Name | Type | Description |
|---|---|---|
| `result` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | Run result. |
| `exceptionDetails`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExceptionDetails">ExceptionDetails</a>` | Exception details. |

 

 

 

#### `Runtime.setAsyncCallStackDepth`

 

Enables or disables async call stacks tracking.

Redirects to: Debugger

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `maxDepth` | `integer` | Maximum depth of async call stacks. Setting to `0` will effectively disable collecting async call stacks (default). |

 

 

 

#### `Runtime.setCustomObjectFormatterEnabled`

 Experimental 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `enabled` | `boolean` |  |

 

 

 

#### `Runtime.setMaxCallStackSizeToCapture`

 Experimental 

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `size` | `integer` |  |

 

 

 

#### `Runtime.terminateExecution`

 Experimental 

Terminate current or next JavaScript execution.
Will cancel the termination when the outer-most script execution ends.

 

 

#### `Runtime.addBinding`

 

If executionContextId is empty, adds binding with the given name on the
global objects of all inspected contexts, including those created later,
bindings survive reloads.
Binding function takes exactly one argument, this argument should be string,
in case of any other input, function throws an exception.
Each binding function call produces Runtime.bindingCalled notification.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `name` | `string` |  |
| `executionContextId`  (optional) Experimental Deprecated | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | If specified, the binding would only be exposed to the specified execution context. If omitted and `executionContextName` is not set, the binding is exposed to all execution contexts of the target. This parameter is mutually exclusive with `executionContextName`. Deprecated in favor of `executionContextName` due to an unclear use case and bugs in implementation (crbug.com/1169639). `executionContextId` will be removed in the future. |
| `executionContextName`  (optional) | `string` | If specified, the binding is exposed to the executionContext with matching name, even for contexts created after the binding is added. See also `ExecutionContext.name` and `worldName` parameter to `Page.addScriptToEvaluateOnNewDocument`. This parameter is mutually exclusive with `executionContextId`. |

 

 

 

#### `Runtime.removeBinding`

 

This method does not remove binding function from global object but
unsubscribes current runtime agent from Runtime.bindingCalled notifications.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `name` | `string` |  |

 

 

 

#### `Runtime.getExceptionDetails`

 Experimental 

This method tries to lookup and populate exception details for a
JavaScript Error object.
Note that the stackTrace portion of the resulting exceptionDetails will
only be populated if the Runtime domain was enabled at the time when the
Error was thrown.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `errorObjectId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | The error object for which to resolve the exception details. |

 

###### Return Object

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

 

 

 

 

## Events

#### `Runtime.bindingCalled`

 Experimental 

Notification is issued every time when binding is called.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `name` | `string` |  |
| `payload` | `string` |  |
| `executionContextId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Identifier of the context where the call was made. |

 

 

 

#### `Runtime.consoleAPICalled`

 

Issued when console API was called.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `type` | `string` | Type of the call. |
| `args` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>>` | Call arguments. |
| `executionContextId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Identifier of the context where the call was made. |
| `timestamp` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-Timestamp">Timestamp</a>` | Call timestamp. |
| `stackTrace`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-StackTrace">StackTrace</a>` | Stack trace captured when the call was made. The async stack chain is automatically reported for the following call types: `assert`, `error`, `trace`, `warning`. For other types the async call chain can be retrieved using `Debugger.getStackTrace` and `stackTrace.parentId` field. |
| `context`  (optional) Experimental | `string` | Console context descriptor for calls on non-default console context (not console.\*): 'anonymous#unique-logger-id' for call on unnamed context, 'name#unique-logger-id' for call on named context. |

 

 

 

#### `Runtime.exceptionRevoked`

 

Issued when unhandled exception was revoked.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `reason` | `string` | Reason describing why exception was revoked. |
| `exceptionId` | `integer` | The id of revoked exception, as reported in `exceptionThrown`. |

 

 

 

#### `Runtime.exceptionThrown`

 

Issued when exception was thrown and unhandled.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `timestamp` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-Timestamp">Timestamp</a>` | Timestamp of the exception. |
| `exceptionDetails` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExceptionDetails">ExceptionDetails</a>` |  |

 

 

 

#### `Runtime.executionContextCreated`

 

Issued when new execution context is created.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `context` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextDescription">ExecutionContextDescription</a>` | A newly created execution context. |

 

 

 

#### `Runtime.executionContextDestroyed`

 

Issued when execution context is destroyed.

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `executionContextId` Deprecated | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Id of the destroyed context |
| `executionContextUniqueId` Experimental | `string` | Unique Id of the destroyed context |

 

 

 

#### `Runtime.executionContextsCleared`

 

Issued when all executionContexts were cleared in browser

 

 

#### `Runtime.inspectRequested`

 

Issued when object should be inspected (for example, as a result of inspect() command line API
call).

###### Parameters

 | Name | Type | Description |
|---|---|---|
| `object` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` |  |
| `hints` | `object` |  |
| `executionContextId`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Identifier of the context where the call was made. |

 

 

 

 

## Types

#### `ScriptId`

 (string) 

Unique script identifier.

 

 

#### `SerializationOptions`

 (object) 

Represents options for serialization. Overrides `generatePreview` and `returnByValue`.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `serialization` | `string` |  |
| `maxDepth`  (optional) | `integer` | Deep serialization depth. Default is full depth. Respected only in `deep` serialization mode. |
| `additionalParameters`  (optional) | `object` | Embedder-specific parameters. For example if connected to V8 in Chrome these control DOM serialization via `maxNodeDepth: integer` and `includeShadowTree: "none" \| "open" \| "all"`. Values can be only of type string or integer. |

 

 

 

#### `DeepSerializedValue`

 (object) 

Represents deep serialized value.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `type` | `string` |  |
| `value`  (optional) | `any` |  |
| `objectId`  (optional) | `string` |  |
| `weakLocalObjectReference`  (optional) | `integer` | Set if value reference met more then once during serialization. In such case, value is provided only to one of the serialized values. Unique per value in the scope of one CDP call. |

 

 

 

#### `RemoteObjectId`

 (string) 

Unique object identifier.

 

 

#### `UnserializableValue`

 (string) 

Primitive value which cannot be JSON-stringified. Includes values `-0`, `NaN`, `Infinity`,
`-Infinity`, and bigint literals.

 

 

#### `RemoteObject`

 (object) 

Mirror object referencing original JavaScript object.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `type` | `string` | Object type. |
| `subtype`  (optional) | `string` | Object subtype hint. Specified for `object` type values only. NOTE: If you change anything here, make sure to also update `subtype` in `ObjectPreview` and `PropertyPreview` below. |
| `className`  (optional) | `string` | Object class (constructor) name. Specified for `object` type values only. |
| `value`  (optional) | `any` | Remote object value in case of primitive values or JSON values (if it was requested). |
| `unserializableValue`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-UnserializableValue">UnserializableValue</a>` | Primitive value which can not be JSON-stringified does not have `value`, but gets this property. |
| `description`  (optional) | `string` | String representation of the object. |
| `deepSerializedValue`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-DeepSerializedValue">DeepSerializedValue</a>` | Deep serialized value. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | Unique object identifier (for non-primitive values). |
| `preview`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ObjectPreview">ObjectPreview</a>` | Preview containing abbreviated property values. Specified for `object` type values only. |
| `customPreview`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-CustomPreview">CustomPreview</a>` |  |

 

 

 

#### `CustomPreview`

 (object) Experimental 

###### Properties

 | Name | Type | Description |
|---|---|---|
| `header` | `string` | The JSON-stringified result of formatter.header(object, config) call. It contains json ML array that represents RemoteObject. |
| `bodyGetterId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | If formatter returns true as a result of formatter.hasBody call then bodyGetterId will contain RemoteObjectId for the function that returns result of formatter.body(object, config) call. The result value is json ML array. |

 

 

 

#### `ObjectPreview`

 (object) Experimental 

Object containing abbreviated remote object value.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `type` | `string` | Object type. |
| `subtype`  (optional) | `string` | Object subtype hint. Specified for `object` type values only. |
| `description`  (optional) | `string` | String representation of the object. |
| `overflow` | `boolean` | True iff some of the properties or entries of the original object did not fit. |
| `properties` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-PropertyPreview">PropertyPreview</a>>` | List of the properties. |
| `entries`  (optional) | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-EntryPreview">EntryPreview</a>>` | List of the entries. Specified for `map` and `set` subtype values only. |

 

 

 

#### `PropertyPreview`

 (object) Experimental 

###### Properties

 | Name | Type | Description |
|---|---|---|
| `name` | `string` | Property name. |
| `type` | `string` | Object type. Accessor means that the property itself is an accessor property. |
| `value`  (optional) | `string` | User-friendly property value string. |
| `valuePreview`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ObjectPreview">ObjectPreview</a>` | Nested value preview. |
| `subtype`  (optional) | `string` | Object subtype hint. Specified for `object` type values only. |

 

 

 

#### `EntryPreview`

 (object) Experimental 

###### Properties

 | Name | Type | Description |
|---|---|---|
| `key`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ObjectPreview">ObjectPreview</a>` | Preview of the key. Specified for map-like collection entries. |
| `value` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ObjectPreview">ObjectPreview</a>` | Preview of the value. |

 

 

 

#### `PropertyDescriptor`

 (object) 

Object property descriptor.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `name` | `string` | Property name or symbol description. |
| `value`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | The value associated with the property. |
| `writable`  (optional) | `boolean` | True if the value associated with the property may be changed (data descriptors only). |
| `get`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | A function which serves as a getter for the property, or `undefined` if there is no getter (accessor descriptors only). |
| `set`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | A function which serves as a setter for the property, or `undefined` if there is no setter (accessor descriptors only). |
| `configurable` | `boolean` | True if the type of this property descriptor may be changed and if the property may be deleted from the corresponding object. |
| `enumerable` | `boolean` | True if this property shows up during enumeration of the properties on the corresponding object. |
| `wasThrown`  (optional) | `boolean` | True if the result was thrown during the evaluation. |
| `isOwn`  (optional) | `boolean` | True if the property is owned for the object. |
| `symbol`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | Property symbol object, if the property is of the `symbol` type. |

 

 

 

#### `InternalPropertyDescriptor`

 (object) 

Object internal property descriptor. This property isn't normally visible in JavaScript code.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `name` | `string` | Conventional property name. |
| `value`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | The value associated with the property. |

 

 

 

#### `PrivatePropertyDescriptor`

 (object) Experimental 

Object private field descriptor.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `name` | `string` | Private property name. |
| `value`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | The value associated with the private property. |
| `get`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | A function which serves as a getter for the private property, or `undefined` if there is no getter (accessor descriptors only). |
| `set`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | A function which serves as a setter for the private property, or `undefined` if there is no setter (accessor descriptors only). |

 

 

 

#### `CallArgument`

 (object) 

Represents function call argument. Either remote object id `objectId`, primitive `value`,
unserializable primitive value or neither of (for undefined) them should be specified.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `value`  (optional) | `any` | Primitive value or serializable javascript object. |
| `unserializableValue`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-UnserializableValue">UnserializableValue</a>` | Primitive value which can not be JSON-stringified. |
| `objectId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObjectId">RemoteObjectId</a>` | Remote object handle. |

 

 

 

#### `ExecutionContextId`

 (integer) 

Id of an execution context.

 

 

#### `ExecutionContextDescription`

 (object) 

Description of an isolated world.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `id` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Unique id of the execution context. It can be used to specify in which execution context script evaluation should be performed. |
| `origin` | `string` | Execution context origin. |
| `name` | `string` | Human readable name describing given context. |
| `uniqueId` Experimental | `string` | A system-unique execution context identifier. Unlike the id, this is unique across multiple processes, so can be reliably used to identify specific context while backend performs a cross-process navigation. |
| `auxData`  (optional) | `object` | Embedder-specific auxiliary data likely matching {isDefault: boolean, type: 'default'\|'isolated'\|'worker', frameId: string} |

 

 

 

#### `ExceptionDetails`

 (object) 

Detailed information about exception (or error) that was thrown during script compilation or
execution.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `exceptionId` | `integer` | Exception id. |
| `text` | `string` | Exception text, which should be used together with exception object when available. |
| `lineNumber` | `integer` | Line number of the exception location (0-based). |
| `columnNumber` | `integer` | Column number of the exception location (0-based). |
| `scriptId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ScriptId">ScriptId</a>` | Script ID of the exception location. |
| `url`  (optional) | `string` | URL of the exception location, to be used when the script was not reported. |
| `stackTrace`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-StackTrace">StackTrace</a>` | JavaScript stack trace if available. |
| `exception`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-RemoteObject">RemoteObject</a>` | Exception object if available. |
| `executionContextId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ExecutionContextId">ExecutionContextId</a>` | Identifier of the context where exception happened. |
| `exceptionMetaData`  (optional) Experimental | `object` | Dictionary with entries of meta data that the client associated with this exception, such as information about associated network requests, etc. |

 

 

 

#### `Timestamp`

 (number) 

Number of milliseconds since epoch.

 

 

#### `TimeDelta`

 (number) 

Number of milliseconds.

 

 

#### `CallFrame`

 (object) 

Stack entry for runtime errors and assertions.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `functionName` | `string` | JavaScript function name. |
| `scriptId` | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-ScriptId">ScriptId</a>` | JavaScript script id. |
| `url` | `string` | JavaScript script name or url. |
| `lineNumber` | `integer` | JavaScript script line number (0-based). |
| `columnNumber` | `integer` | JavaScript script column number (0-based). |

 

 

 

#### `StackTrace`

 (object) 

Call frames for assertions or error messages.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `description`  (optional) | `string` | String label of this stack trace. For async traces this may be a name of the function that initiated the async call. |
| `callFrames` | `array<<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-CallFrame">CallFrame</a>>` | JavaScript function name. |
| `parent`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-StackTrace">StackTrace</a>` | Asynchronous JavaScript stack trace that preceded this stack, if available. |
| `parentId`  (optional) Experimental | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-StackTraceId">StackTraceId</a>` | Asynchronous JavaScript stack trace that preceded this stack, if available. |

 

 

 

#### `UniqueDebuggerId`

 (string) Experimental 

Unique identifier of current debugger.

 

 

#### `StackTraceId`

 (object) Experimental 

If `debuggerId` is set stack trace comes from another debugger and can be resolved there. This
allows to track cross-debugger calls. See `Runtime.StackTrace` and `Debugger.paused` for usages.

###### Properties

 | Name | Type | Description |
|---|---|---|
| `id` | `string` |  |
| `debuggerId`  (optional) | `<a href="/docs/cloud-browser-api/cdp-reference/Runtime#type-UniqueDebuggerId">UniqueDebuggerId</a>` |  |