browser: return accurate stop status for remote WebSocket profiles
Check hasActivePlaywrightConnection before closing so repeated or
cold-start stop calls correctly return { stopped: false } instead of
always claiming a session was terminated.
This commit is contained in:
parent
a3fdb664d2
commit
74177d480e
@ -260,8 +260,9 @@ export function createProfileAvailability({
|
||||
// For remote WebSocket endpoints (e.g. Browser Use), there's no local Chrome process
|
||||
// to stop. Instead, close the cached Playwright connection to the cloud provider.
|
||||
if (capabilities.isRemote && isWebSocketUrl(profile.cdpUrl)) {
|
||||
const wasConnected = hasActivePlaywrightConnection(profile.cdpUrl);
|
||||
await closePlaywrightBrowserConnection({ cdpUrl: profile.cdpUrl });
|
||||
return { stopped: true };
|
||||
return { stopped: wasConnected };
|
||||
}
|
||||
if (capabilities.requiresRelay) {
|
||||
const stopped = await stopChromeExtensionRelayServer({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user