cookie-sync

โดย browserbase

ซิงค์คุกกี้จาก Chrome ในเครื่องไปยังบริบทถาวรของ Browserbase เพื่อให้ CLI เบราว์เซอร์สามารถเข้าถึงไซต์ที่ต้องยืนยันตัวตนได้ ใช้เมื่อผู้ใช้ต้องการเรียกดูในฐานะ…

npx skills add https://github.com/browserbase/skills --skill cookie-sync

Cookie Sync — Local Chrome → Browserbase Context

Exports cookies from your local Chrome and saves them into a Browserbase persistent context. After syncing, use the browse CLI to open authenticated sessions with that context.

Supports domain filtering (only sync cookies you need) and context reuse (refresh cookies without creating a new context).

Prerequisites

  • Chrome (or Chromium, Brave, Edge) with remote debugging enabled
  • If your browser build exposes chrome://flags/#allow-remote-debugging, enable it and restart the browser
  • Otherwise, launch with --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug and set CDP_URL=ws://127.0.0.1:9222
  • At least one tab open in Chrome
  • Node.js 22+
  • Environment variable: BROWSERBASE_API_KEY

Setup

Install dependencies before first use:

cd .claude/skills/cookie-sync && npm install

Usage

Basic — sync all cookies

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs

Creates a persistent context with all your Chrome cookies. Outputs a context ID.

Filter by domain — only sync specific sites

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains google.com,github.com

Matches the domain and all subdomains (e.g. google.com matches accounts.google.com, mail.google.com, etc.)

Refresh cookies in an existing context

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --context ctx_abc123

Re-injects fresh cookies into a previously created context. Use this when cookies have expired.

Verified browser mode

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --verified

Enables Browserbase Identity with a Verified browser to improve access on protected sites. Recommended for sites like Google that fingerprint browsers.

Residential proxy with geolocation

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --proxy "San Francisco,CA,US"

Routes through a residential proxy in the specified location. Format: "City,ST,Country" (state is 2-letter code). Helps match your local IP's geolocation so auth cookies aren't rejected.

Combine flags

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains github.com,google.com --verified --proxy "San Francisco,CA,US"

Browsing Authenticated Sites

After syncing, use the browse CLI with the context ID:

SESSION_JSON="$(browse cloud sessions create --context-id <ctx-id> --persist --keep-alive)"
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"

browse open https://mail.google.com --cdp "$CONNECT_URL"

The --persist flag on browse cloud sessions create saves any new cookies or state changes back to the context when the cloud session is released, keeping the session fresh for next time.

Full workflow example:

# Step 1: Sync cookies for Twitter
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains x.com,twitter.com
# Output: Context ID: ctx_abc123

# Step 2: Browse authenticated Twitter
SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --persist --keep-alive)"
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"

browse open https://x.com/messages --cdp "$CONNECT_URL"
browse snapshot
browse screenshot
browse stop
browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE

Reusing Contexts for Scheduled Jobs

Contexts persist across sessions, making them ideal for scheduled/recurring tasks:

  1. Once (laptop open): Run cookie-sync → get a context ID
  2. Scheduled jobs: Create a Browserbase session with browse cloud sessions create --context-id <ctx-id> --persist --keep-alive, then attach with browse open <url> --cdp <connectUrl> — no local Chrome needed
  3. Re-sync as needed: When cookies expire, run cookie-sync again with --context <ctx-id> to refresh

Troubleshooting

  • "No DevToolsActivePort found" → Enable chrome://flags/#allow-remote-debugging if your browser build exposes it, or launch with --remote-debugging-port=9222 and set CDP_URL=ws://127.0.0.1:9222
  • "No open page targets found" → Open at least one tab in Chrome
  • "WebSocket error" → Chrome may be hung; force quit and reopen it
  • Cookies expired in context → Re-run cookie-sync with --context <id> to refresh
  • Auth rejected by site → Try adding --verified and/or --proxy with a location near you

Skills เพิ่มเติมจาก browserbase

browser-automation
browserbase
ใช้เครื่องมือ MCP เพื่อทำงานอัตโนมัติในการโต้ตอบกับเว็บเบราว์เซอร์ ใช้เมื่อผู้ใช้ขอให้เรียกดูเว็บไซต์ นำทางหน้าเว็บ ดึงข้อมูลจากเว็บไซต์ ถ่ายภาพหน้าจอ…
official
functions
browserbase
แนะนำการปรับใช้ระบบอัตโนมัติของเบราว์เซอร์แบบไร้เซิร์ฟเวอร์โดยใช้ CLI ของ Browserbase Functions อย่างเป็นทางการ ใช้เมื่อผู้ใช้ต้องการปรับใช้ระบบอัตโนมัติเพื่อทำงานบน...
official
autobrowse
browserbase
ระบบอัตโนมัติเบราว์เซอร์ที่ปรับปรุงตัวเองผ่านลูปการวิจัยอัตโนมัติ ดำเนินการงานท่องเว็บซ้ำ อ่านร่องรอย และปรับปรุงทักษะการนำทาง...
official
browser
browserbase
ระบบอัตโนมัติของเบราว์เซอร์ด้วย Chrome ในเครื่องหรือ Browserbase ระยะไกลสำหรับเว็บไซต์ที่มีการป้องกัน การตรวจจับบอท และ CAPTCHA สองโหมด: Chrome ในเครื่อง (ค่าเริ่มต้น ไม่ต้องตั้งค่า) หรือ Browserbase ระยะไกล (การซ่อนตัวจากบอท การแก้ CAPTCHA อัตโนมัติ พร็อกซีที่อยู่อาศัย การคงสถานะเซสชัน) คำสั่งหลักครอบคลุมการนำทาง การตรวจสอบหน้า การโต้ตอบ (คลิก พิมพ์ กรอก เลือก ลาก) และการจัดการเซสชันผ่าน CLI ใช้ browse snapshot เพื่ออ่านแผนผังการเข้าถึงและรับข้อมูลอ้างอิงองค์ประกอบสำหรับการโต้ตอบที่เชื่อถือได้ สงวน...
official
browser-trace
browserbase
บันทึกการติดตามโปรโตคอล DevTools แบบเต็มของการทำงานอัตโนมัติของเบราว์เซอร์ใดๆ — ข้อมูลจาก CDP, ภาพหน้าจอ และการถ่ายโอน DOM — จากนั้นแบ่งสตรีมออกเป็นหน้าที่สามารถค้นหาได้…
official
browserbase-cli
browserbase
Use the Browserbase CLI (`bb`) for Browserbase Functions and platform API workflows. Use when the user asks to run `bb`, deploy or invoke functions, manage…
official
company-research
browserbase
ค้นหาและวิจัยบริษัทอย่างละเอียดเพื่อใช้เป็นเป้าหมายในการขาย ใช้ Browserbase Search API ในการค้นหา และรูปแบบ Plan→Research→Synthesize สำหรับการเพิ่มข้อมูลเชิงลึก — สร้างรายงานวิจัยที่ให้คะแนนและไฟล์ CSV
official
event-prospecting
browserbase
นำ URL ของการประชุม → รับรายชื่อผู้ที่ควรติดต่อแบบจัดอันดับ พร้อมเหตุผล "ทำไมต้องติดต่อ" สำหรับแต่ละบุคคล
official