Skip to content

Commit b03d7a3

Browse files
committed
docs: fix CDP command casing to camelCase and correct session scope to browser-level
1 parent a2f194b commit b03d7a3

3 files changed

Lines changed: 20 additions & 20 deletions

File tree

ADVANCED_FEATURES.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Switch proxy servers for a specific BrowserContext at runtime without restarting
6868
```javascript
6969
const ctx = await browser.createBrowserContext();
7070
const page = await ctx.newPage();
71-
const client = await page.createCDPSession();
71+
const client = await browser.target().createCDPSession(); // must use browser-level session
7272

7373
// Set initial proxy - US endpoint
7474
await client.send('BotBrowser.setBrowserContextProxy', {
@@ -463,24 +463,24 @@ Assign independent fingerprint bundles per BrowserContext without spawning new b
463463
<a id="cdp-quick-reference"></a>
464464
## CDP Quick Reference
465465

466-
All commands live under the `BotBrowser` CDP domain. Send them through a CDP session (`page.createCDPSession()` or `browser.target().createCDPSession()` depending on the command scope).
466+
All commands live under the `BotBrowser` CDP domain. Send them through a **browser-level** CDP session (`browser.target().createCDPSession()` in Puppeteer, `browser.newBrowserCDPSession()` in Playwright). Page-level sessions (`page.createCDPSession()`) do not have access to this domain.
467467

468468
| Command | Scope | Tier | Description | Documentation |
469469
|---------|-------|------|-------------|---------------|
470-
| `SetBrowserContextFlags` | page | ENT Tier3 | Assign independent fingerprint flags to a BrowserContext | [Per-Context Fingerprint](PER_CONTEXT_FINGERPRINT.md) |
471-
| `SetBrowserContextProxy` | page | ENT Tier3 | Switch proxy for a BrowserContext at runtime | [Dynamic Proxy Switching](#dynamic-proxy-switching) |
472-
| `ClearBrowserContextProxy` | page | ENT Tier3 | Remove proxy override from a BrowserContext | [Dynamic Proxy Switching](#dynamic-proxy-switching) |
473-
| `SetCustomHeaders` | browser | PRO | Replace all custom HTTP request headers | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
474-
| `GetCustomHeaders` | browser | PRO | Retrieve current custom headers | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
475-
| `AddCustomHeader` | browser | PRO | Add or update a single custom header | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
476-
| `RemoveCustomHeader` | browser | PRO | Remove a single custom header | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
477-
| `ClearCustomHeaders` | browser | PRO | Remove all custom headers | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
478-
| `StartMirrorController` | browser | ENT Tier3 | Start this instance as a Mirror controller | [Mirror](tools/mirror/) |
479-
| `StartMirrorClient` | browser | ENT Tier3 | Connect this instance as a Mirror client | [Mirror](tools/mirror/) |
480-
| `StopMirror` | browser | ENT Tier3 | Stop Mirror controller or client role | [Mirror](tools/mirror/) |
481-
| `GetMirrorStatus` | browser | ENT Tier3 | Query current Mirror connection status | [Mirror](tools/mirror/) |
482-
483-
> **Scope**: `browser` = send to browser-level CDP session; `page` = send to page-level CDP session.
470+
| `setBrowserContextFlags` | browser | ENT Tier3 | Assign independent fingerprint flags to a BrowserContext | [Per-Context Fingerprint](PER_CONTEXT_FINGERPRINT.md) |
471+
| `setBrowserContextProxy` | browser | ENT Tier3 | Switch proxy for a BrowserContext at runtime | [Dynamic Proxy Switching](#dynamic-proxy-switching) |
472+
| `clearBrowserContextProxy` | browser | ENT Tier3 | Remove proxy override from a BrowserContext | [Dynamic Proxy Switching](#dynamic-proxy-switching) |
473+
| `setCustomHeaders` | browser | PRO | Replace all custom HTTP request headers | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
474+
| `getCustomHeaders` | browser | PRO | Retrieve current custom headers | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
475+
| `addCustomHeader` | browser | PRO | Add or update a single custom header | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
476+
| `removeCustomHeader` | browser | PRO | Remove a single custom header | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
477+
| `clearCustomHeaders` | browser | PRO | Remove all custom headers | [CLI Flags](CLI_FLAGS.md#--bot-custom-headers-pro) |
478+
| `startMirrorController` | browser | ENT Tier3 | Start this instance as a Mirror controller | [Mirror](tools/mirror/) |
479+
| `startMirrorClient` | browser | ENT Tier3 | Connect this instance as a Mirror client | [Mirror](tools/mirror/) |
480+
| `stopMirror` | browser | ENT Tier3 | Stop Mirror controller or client role | [Mirror](tools/mirror/) |
481+
| `getMirrorStatus` | browser | ENT Tier3 | Query current Mirror connection status | [Mirror](tools/mirror/) |
482+
483+
> All BotBrowser CDP commands are browser-level only. Use `browser.target().createCDPSession()` (Puppeteer) or `browser.newBrowserCDPSession()` (Playwright).
484484
485485
---
486486

docs/guides/network/DYNAMIC_PROXY_SWITCHING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const browser = await puppeteer.launch({
3535

3636
const ctx = await browser.createBrowserContext();
3737
const page = await ctx.newPage();
38-
const client = await page.createCDPSession();
38+
const client = await browser.target().createCDPSession(); // must use browser-level session
3939

4040
// Switch to a UK proxy at runtime
4141
await client.send("BotBrowser.setBrowserContextProxy", {
@@ -95,7 +95,7 @@ await client.send("BotBrowser.clearBrowserContextProxy", {
9595
Switch between geographic regions within the same context, with automatic geo re-detection after each switch:
9696

9797
```javascript
98-
const client = await page.createCDPSession();
98+
const client = await browser.target().createCDPSession(); // must use browser-level session
9999

100100
// Start with US proxy
101101
await client.send("BotBrowser.setBrowserContextProxy", {
@@ -155,7 +155,7 @@ await client.send("BotBrowser.setBrowserContextProxy", {
155155

156156
| Problem | Solution |
157157
|---------|----------|
158-
| `setBrowserContextProxy` not found | Ensure you have an ENT Tier3 license. This is a tier-gated feature. |
158+
| `setBrowserContextProxy` not found | The `BotBrowser` CDP domain is only available on **browser-level** sessions. Use `browser.target().createCDPSession()` (Puppeteer) or `browser.newBrowserCDPSession()` (Playwright) instead of `page.createCDPSession()`. Also ensure you have an ENT Tier3 license. |
159159
| Geo signals not updating after switch | Geo re-detection happens on the next main-frame navigation. Navigate to a new page after switching. |
160160
| Slow proxy switch | Pass `proxyIp` to skip IP auto-detection on each switch. |
161161
| Old proxy still used for some requests | In-flight requests complete on the previous proxy. New requests use the updated proxy. |

examples/playwright/nodejs/per_context_fingerprint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* node per_context_fingerprint.js
2222
*/
2323

24-
const { chromium } = require('playwright');
24+
const { chromium } = require('playwright-core');
2525

2626
(async () => {
2727
const execPath = process.env.BOTBROWSER_EXEC_PATH;

0 commit comments

Comments
 (0)