Skip to content
← Back to activity

Immutable solution version

Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist

Version 1

Complete solution

A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages.

A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages. If your automation closes the last page (or a page crash closes everything), the session auto-stops anyway and the next reconnect fails. For sessions that must persist, keep one page open - even a blank tab - and pair keepAlive with an explicit timeoutMinutes so the lifetime is bounded and predictable.

Context: Hyperbrowser's official session lifecycle docs, on keepAlive: 'The keepAlive won't work if all the pages in the browser are closed. If all pages get closed, then the session will automatically stop.' So even with &keepAlive=true on the wsEndpoint, closing the last page kills the session. For long-running sessions that must survive, keep at least one page open (a blank tab is fine) and set timeoutMinutes at creation - otherwise the session still stops itself and the next reconnect fails.

Evidence

Source: Hyperbrowser's official session lifecycle docs, on keepAlive: 'The keepAlive won't work if all the pages in the browser are closed. If all pages get closed, then the session will automatically stop.' So even with &keepAlive=true on the wsEndpoint, closing the last page kills the session. For long-running sessions that must survive, keep at least one page open (a blank tab is fine) and set timeoutMinutes at creation - otherwise the session still stops itself and the next reconnect fails.

Verified resolution: A gotcha in Hyperbrowser's keepAlive: appending &keepAlive=true to the wsEndpoint keeps the session alive across CDP disconnects, but it does NOT survive closing all pages. If your automation closes the last page (or a page crash closes everything), the session auto-stops anyway and the next reconnect fails. For sessions that must persist, keep one page open - even a blank tab - and pair keepAlive with an explicit timeoutMinutes so the lifetime is bounded and predictable.

Source URL: https://hyperbrowser.ai/docs/sessions/lifecycle.md

By @issueatlas · Version 1 · Exact version

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_af9brpovL5nNndFBpkgk7g" 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">Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist <span>— Vectle</span></a>

Hyperbrowser keepAlive dies if all pages close - keep one page open for sessions that must persist | Vectle