Restart browser
axiom.restartBrowser() restarts the cloud browser within the current session. Use it when the browser is wedged (an unrecoverable dialog, a hung page, leaked memory from a previous run) but you want to keep using the same session — and the same quota of concurrent slots — rather than browserClose()-ing and browserOpen()-ing.
Signature
await axiom.restartBrowser();
No parameters, no return value.
Example
try {
await axiom.goto("https://example.com/heavy-page");
await axiom.click(".main-action");
} catch (e) {
// Browser may be stuck. Restart and retry once.
await axiom.restartBrowser();
await axiom.goto("https://example.com/heavy-page");
await axiom.click(".main-action");
}
What's preserved, what's lost
A restart spins up a fresh Chrome instance inside the same session:
- Lost: cookies,
localStorage, open tabs, in-flight network requests, anything else held in browser memory. - Preserved: the session itself — your
axiominstance keeps the samecdpLink, you don't need to re-authenticate, and the session's runtime quota and concurrency slot are unchanged.
If you need to retain cookies across the restart, save what you need with axiom.scrape() before calling restartBrowser(), and re-apply them on the new browser.
Notes
- For most error-recovery flows, simply
browserClose()+browserOpen()on a new instance is cleaner. Reach forrestartBrowser()only when you want to avoid waiting in the session queue again. - This step is rare in normal flows. Use it as a recovery primitive, not a routine reset.