*** title: Browser Extensions description: Upload and manage browser extensions that can be loaded into runtimes. ----------------------------------------------------------------------------------- Browser extensions can be loaded into runtimes to add capabilities — ad blockers, captcha solvers, or custom tools. Upload extension binaries or import from a URL, then reference them when launching runtimes. Access via `bctrl.browserExtensions`. ## list() List all uploaded extensions. ```ts const extensions = await bctrl.browserExtensions.list(); ``` **Returns** `ExtensionMetadata[]` *** ## upload(request) Upload an extension binary (.crx or .zip). ```ts import { readFileSync } from "fs"; const ext = await bctrl.browserExtensions.upload({ file: readFileSync("./captcha-solver.crx"), filename: "captcha-solver.crx", }); console.log(ext.id); ``` | Parameter | Type | Required | Description | | ---------- | ------------------------------ | -------- | ----------------------- | | `file` | `Buffer \| Uint8Array \| Blob` | Yes | Extension binary | | `filename` | `string` | Yes | Filename with extension | **Returns** `ExtensionMetadata` *** ## importFromUrl(request) Import an extension from a URL. ```ts const ext = await bctrl.browserExtensions.importFromUrl({ url: "https://example.com/extension.crx", }); ``` | Parameter | Type | Required | Description | | --------- | -------- | -------- | ---------------------------------- | | `url` | `string` | Yes | URL to download the extension from | **Returns** `ExtensionMetadata` *** ## get(id) Get a specific extension by ID. ```ts const ext = await bctrl.browserExtensions.get("ext_abc123"); ``` | Parameter | Type | Required | Description | | --------- | -------- | -------- | ------------ | | `id` | `string` | Yes | Extension ID | **Returns** `ExtensionMetadata` *** ## delete(id) Delete an extension. ```ts await bctrl.browserExtensions.delete("ext_abc123"); ``` | Parameter | Type | Required | Description | | --------- | -------- | -------- | ------------ | | `id` | `string` | Yes | Extension ID | *** ## Usage with runtimes Load extensions when launching an ephemeral runtime: ```ts const runtime = await workspace.runtimes.browser("main").playwright({ mode: "ephemeral", extensionIds: ["ext_abc123"], }); ```