Skip to content

fix: check browser.isConnected() in isLaunched()#668

Open
juliobrasa wants to merge 1 commit intovercel-labs:mainfrom
juliobrasa:fix/is-launched-check-connected
Open

fix: check browser.isConnected() in isLaunched()#668
juliobrasa wants to merge 1 commit intovercel-labs:mainfrom
juliobrasa:fix/is-launched-check-connected

Conversation

@juliobrasa
Copy link

Summary

  • isLaunched() now checks browser.isConnected() in addition to the null check
  • When a browser is manually closed or crashes, isLaunched() correctly returns false

Problem

After a browser was manually closed or crashed, isLaunched() still returned true because the browser reference was non-null. This caused subsequent commands like goto to throw confusing errors instead of indicating the browser needs to be relaunched.

Test plan

  • TypeScript compiles cleanly
  • Existing stale-session recovery test still passes (closing pages doesn't disconnect the browser)

Fixes #212

🤖 Generated with Claude Code

When a browser is manually closed or crashes, isLaunched() previously
returned true because the browser reference was still non-null. This
caused subsequent commands (like goto) to throw confusing errors.

Now isLaunched() also checks browser.isConnected(), correctly returning
false when the browser process is gone.

Fixes vercel-labs#212

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Mar 6, 2026

Someone is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

isLaunched check fail if manualy close browser

1 participant