aboutsummaryrefslogtreecommitdiff
path: root/src/setup.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/setup.ts')
-rw-r--r--src/setup.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/setup.ts b/src/setup.ts
index 395fff4..44dfc2c 100644
--- a/src/setup.ts
+++ b/src/setup.ts
@@ -22,9 +22,15 @@ export function registerSetupCommand(pi: ExtensionAPI, client: BrowserClient): v
export type SetupResult = { success: true; data: string } | { success: false; error: string };
export async function performSetup(client: BrowserClient, ctx?: ExtensionContext): Promise<SetupResult> {
- const chromeRunning = await isBrowserRunning();
- if (!chromeRunning) {
- return { success: false, error: "No browser instance running. Please open your browser and then run /browser-setup." };
+ // Step 1: Check Chrome is running
+ // LOCAL PATCH: isBrowserRunning() enumerates *local* processes, so it can
+ // never see a browser reached via BU_CDP_HTTP. Skip the precondition in that
+ // case — step 4 still fails loudly if the remote browser is unreachable.
+ if (!process.env["BU_CDP_HTTP"]?.trim()) {
+ const chromeRunning = await isBrowserRunning();
+ if (!chromeRunning) {
+ return { success: false, error: "No browser instance running. Please open your browser and then run /browser-setup." };
+ }
}
const daemonReady = await ensureDaemon();