For the complete documentation index, see llms.txt. This page is also available as Markdown.

Use with Puppeteer

Setup

obscura serve --port 9222
npm install puppeteer-core

Connect

const puppeteer = require('puppeteer-core');

const browser = await puppeteer.connect({
  browserWSEndpoint: 'ws://127.0.0.1:9222',
});

Use puppeteer-core, not puppeteer. The puppeteer package bundles a Chrome download.

const page = await browser.newPage();
await page.goto('https://example.com');
await page.goto('https://example.com', { waitUntil: 'load' });
await page.goto('https://example.com', { waitUntil: 'networkidle0', timeout: 60000 });

Default waitUntil is domcontentloaded. Other values: load, networkidle2, networkidle0.

Evaluate

Interact

Cookies

For session persistence across runs see Persist cookies and storage.

Intercept requests

See Intercept and modify requests.

Expose a Node callback

Multiple pages

Pages share one V8 isolate. Concurrent JS execution serializes through a lock. CPU-bound JS on one page blocks the others.

Screenshots, scrolling, and PDF

A normal screenshot captures the live viewport and scroll position; fullPage: true captures document space. PDF output is raster-backed.

Screencasting

Attach a raw CDP session to the page, acknowledge every frame, and detach it when finished:

Frames are activity-driven page captures, not fixed-rate desktop video.

Disconnect

Current limits

  • Some device emulation, service-worker, native media, long-tail CSS, and compositor behavior remains incomplete relative to Chromium.

  • Pages share one V8 isolate; CPU-bound JavaScript serializes across pages.

  • PDF text is not selectable/searchable and tagged PDF is not yet available.

Last updated

Was this helpful?