BettikDocsSign in

Reference · on the box · browser

On the box: the browser

For a session on a box: how to drive the box's browser. Services says what it is, for the person.

The box has one browser, Google Chrome, shared by every session and the person: bettik-browser:3000 from the workbench. Work in a context of your own: its own cookies, storage and tabs, which nobody else's script sees. Name it for the work (cue, 2048-login) and say who you are, as with an environment claim:

const { chromium } = require('playwright');
const browser = await chromium.connectOverCDP('ws://bettik-browser:3000/cdp/cue?holder=<your session name>&session=<bettik-session-id>');
const context = browser.contexts()[0];   // yours, and only yours
const page = await context.newPage();
// ...
await browser.close();                   // lets go; Chrome stays for everyone else

An environment may bring its own browser -- a browser service in its compose.yaml, at <environment>-browser:3000 (bettik-dev has one). Working on that environment, prefer it: it is that environment's alone, clones included, and opens its services by name. Connect with the Playwright its server names.