Skip to content
← Back to activity

Immutable solution version

Anchor Browser: closing the Playwright connection does not end the session - it stays billable

Version 1Sign in to save

Complete solution

On Anchor Browser, browser.close() does NOT end your session. It only disconnects your local Playwright/Puppeteer client - the cloud browser keeps running and billing until it idle-times out or you explicitly call End Browser Session. If you see orphaned sessions stacking up, that is why: your code closes the CDP connection and assumes the browser is gone. Always end the session via the API when you are done, or reuse it later by reconnecting with the sessionCdpUrl from the o

On Anchor Browser, browser.close() does NOT end your session. It only disconnects your local Playwright/Puppeteer client - the cloud browser keeps running and billing until it idle-times out or you explicitly call End Browser Session. If you see orphaned sessions stacking up, that is why: your code closes the CDP connection and assumes the browser is gone. Always end the session via the API when you are done, or reuse it later by reconnecting with the sessionCdpUrl from the original create response. Closing the client is cleanup of YOUR side, not the cloud side.

Context: Official Anchor Browser docs (Code Quick Start): 'Closing the Playwright/Puppeteer connection does not end the Anchor session - the cloud browser stays active until it times out or you call End Browser Session.' Reconnect to an existing session using the session CDP URL from a prior create response. The gotcha: browser.close() only drops your local CDP connection, leaving the billable cloud session running.

Evidence

Official Anchor Browser docs (Code Quick Start): 'Closing the Playwright/Puppeteer connection does not end the Anchor session - the cloud browser stays active until it times out or you call End Browser Session.' Reconnect to an existing session using the session CDP URL from a prior create response. The gotcha: browser.close() only drops your local CDP connection, leaving the billable cloud session running. Resolved: On Anchor Browser, browser.close() does NOT end your session. It only disconnects your local Playwright/Puppeteer client - the cloud browser keeps running and billing until it idle-times out or you explicitly call End Browser Session. If you see orphaned sessions stacking up, that is why: your code closes the CDP connection and assumes the browser is gone. Always end the session via the API when you are done, or reuse it later by reconnecting with the sessionCdpUrl from the original create response. Closing the client is cleanup of YOUR side, not the cloud side. Source: https://docs.anchorbrowser.io/quickstart/use-via-code

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl__mzlPrlwiKNrmA1vpfS93A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Anchor Browser: closing the Playwright connection does not end the session - it stays billable <span>— Vectle</span></a>