Skip to content

An agentic browser harness: an AI side panel & orb in your own logged-in Chrome, Edge, Arc, Brave or even Firefox run by the agent/subscription you already use (Claude Code, Codex, Antigravity). Free, open source, no API key. Also an MCP server.

fix(cli): on Windows the wake-up registers with the Beta, Dev and Canary channels of Chrome, Edge and Brave through the key each reads; uninstall takes away only the link to a linked folder, never what it points at, and a manifest it may not delete no longer stops it

Shahriar5ff21189635b
diff --git a/docs/guide/limits.md b/docs/guide/limits.md
index e2dd1cb..696520c 100644
--- a/docs/guide/limits.md
+++ b/docs/guide/limits.md
@@ -97,8 +97,9 @@ end to end yet, so the popup, the docs and the release notes mark them *beta*. I
The Bridge runs on Windows, and its tests run there on every change. So does every `browsentic`
command, as npm installs it and under a home folder whose name is not ASCII, along with the wake-up
the browser starts and an MCP client built on the official SDK starting `browsentic mcp`. On a
-Windows 11 desktop it has been set up, paired and driven from the side panel by Claude Code. A cancelled run, the other agents
-and the [Windows app](windows-app.md) have not been through that test yet. Until they have:
+Windows 11 desktop it has been set up, paired and driven from the side panel by Claude Code. A
+cancelled run, the other agents and the [Windows app](windows-app.md) have not been through that
+test yet. Until they have:
- **An agent installed with npm is started through the program its `.cmd` names**, never through
`cmd.exe`, which can pass neither a prompt's many lines nor page text intact. A batch file that is
diff --git a/src/daemon/native-host.test.ts b/src/daemon/native-host.test.ts
index 21ea450..f2152b4 100644
--- a/src/daemon/native-host.test.ts
+++ b/src/daemon/native-host.test.ts
@@ -1,6 +1,6 @@
-import { existsSync, mkdirSync, readFileSync, rmSync } from 'node:fs';
+import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync } from 'node:fs';
import { homedir } from 'node:os';
-import { join } from 'node:path';
+import { dirname, join } from 'node:path';
import { beforeEach, describe, expect, it, vi } from 'vitest';
import {
NATIVE_HOST_NAME,
@@ -194,6 +194,17 @@ describe('registering the host', () => {
expect(existsSync(nativeHostDir)).toBe(false);
expect(registeredBrowsers(linux)).toEqual([]);
});
+
+ // A read-only folder stands in for one an administrator locked; Windows folders have no such mode.
+ it.skipIf(process.platform === 'win32')('goes on past a manifest it may not delete, so the rest of an uninstall still runs', () => {
+ installNativeHost('/opt/browsentic/dist/cli.js', linux);
+ chmodSync(dirname(manifest), 0o555);
+ try {
+ expect(removeNativeHost(linux)).toEqual([nativeHostDir]);
+ } finally {
+ chmodSync(dirname(manifest), 0o755);
+ }
+ });
});
describe('registering the host on Windows', () => {
@@ -226,6 +237,16 @@ describe('registering the host on Windows', () => {
expect(registeredBrowsers(machine)).toEqual(['Edge', 'Brave']);
});
+ it('registers a Beta, Dev or Canary channel on its own, through the key its browser reads', () => {
+ const machine = windows([profile('Google\\Chrome SxS'), profile('Microsoft\\Edge Beta')]);
+
+ const installed = installNativeHost('C:\\b\\dist\\cli.js', machine);
+
+ expect(installed.browsers).toEqual(['Chrome Canary', 'Edge Beta']);
+ expect([...keys.keys()].sort()).toEqual([key('Google\\Chrome'), key('Microsoft\\Edge')]);
+ expect(registeredBrowsers(machine)).toEqual(['Chrome Canary', 'Edge Beta']);
+ });
+
it('says a browser installed since setup cannot start the daemon yet', () => {
installNativeHost('C:\\b\\dist\\cli.js', windows([profile('Microsoft\\Edge')]));
diff --git a/src/daemon/native-host.ts b/src/daemon/native-host.ts
index 3e2195c..34686c2 100644
--- a/src/daemon/native-host.ts
+++ b/src/daemon/native-host.ts
@@ -60,10 +60,18 @@ const LINUX_BROWSERS: [string, Family, string, string][] = [
*/
const WINDOWS_BROWSERS: [string, Family, string, 'LOCALAPPDATA' | 'APPDATA', string][] = [
['Chrome', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'Google\\Chrome\\User Data'],
+ ['Chrome Beta', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'Google\\Chrome Beta\\User Data'],
+ ['Chrome Dev', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'Google\\Chrome Dev\\User Data'],
+ ['Chrome Canary', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'Google\\Chrome SxS\\User Data'],
['Chrome for Testing', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'Google\\Chrome for Testing\\User Data'],
['Chromium', 'chromium', 'Chromium', 'LOCALAPPDATA', 'Chromium\\User Data'],
['Edge', 'chromium', 'Microsoft\\Edge', 'LOCALAPPDATA', 'Microsoft\\Edge\\User Data'],
+ ['Edge Beta', 'chromium', 'Microsoft\\Edge', 'LOCALAPPDATA', 'Microsoft\\Edge Beta\\User Data'],
+ ['Edge Dev', 'chromium', 'Microsoft\\Edge', 'LOCALAPPDATA', 'Microsoft\\Edge Dev\\User Data'],
+ ['Edge Canary', 'chromium', 'Microsoft\\Edge', 'LOCALAPPDATA', 'Microsoft\\Edge SxS\\User Data'],
['Brave', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'BraveSoftware\\Brave-Browser\\User Data'],
+ ['Brave Beta', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'BraveSoftware\\Brave-Browser-Beta\\User Data'],
+ ['Brave Nightly', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'BraveSoftware\\Brave-Browser-Nightly\\User Data'],
['Vivaldi', 'chromium', 'Google\\Chrome', 'LOCALAPPDATA', 'Vivaldi\\User Data'],
['Firefox', 'firefox', 'Mozilla', 'APPDATA', 'Mozilla\\Firefox'],
];
@@ -280,8 +288,12 @@ export function removeNativeHost(options: HostOptions = {}): string[] {
for (const target of targets.filter((candidate) => candidate.manifestDir)) {
const manifest = join(target.manifestDir!, `${NATIVE_HOST_NAME}.json`);
if (!existsSync(manifest)) continue;
- rmSync(manifest, { force: true });
- removed.push(manifest);
+ try {
+ rmSync(manifest, { force: true });
+ removed.push(manifest);
+ } catch {
+ continue;
+ }
}
if (existsSync(nativeHostDir)) {
rmSync(nativeHostDir, { recursive: true, force: true });
diff --git a/src/daemon/uninstall.test.ts b/src/daemon/uninstall.test.ts
index 45dbf0a..a7200f0 100644
--- a/src/daemon/uninstall.test.ts
+++ b/src/daemon/uninstall.test.ts
@@ -1,4 +1,4 @@
-import { chmodSync, existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
+import { chmodSync, existsSync, mkdirSync, readdirSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
import { homedir } from 'node:os';
import { join } from 'node:path';
import { afterEach, beforeEach, describe, expect, test, vi } from 'vitest';
@@ -109,6 +109,14 @@ describe('removing', () => {
expect(existsSync(stateDir)).toBe(false);
});
+ test('a folder reached through a link loses only the link, never what it points at', () => {
+ made(join(outside, 'build'));
+ writeFileSync(join(outside, 'build', 'manifest.json'), '{}');
+ symlinkSync(join(outside, 'build'), join(outside, 'extension'), 'junction');
+ const [extension] = removeAll([{ label: 'extension', path: join(outside, 'extension'), holds: '' }]);
+ expect([extension.removed, existsSync(join(outside, 'extension')), readdirSync(join(outside, 'build'))]).toEqual([true, false, ['manifest.json']]);
+ });
+
test('a removal that fails is reported, not thrown, and the rest still happen', () => {
made(outside);
writeFileSync(join(outside, 'not-a-folder'), '');
diff --git a/src/daemon/uninstall.ts b/src/daemon/uninstall.ts
index 220f018..89cdbaf 100644
--- a/src/daemon/uninstall.ts
+++ b/src/daemon/uninstall.ts
@@ -1,4 +1,4 @@
-import { existsSync, readdirSync, rmSync } from 'node:fs';
+import { existsSync, lstatSync, readdirSync, rmSync } from 'node:fs';
import { isAbsolute, join, relative, sep } from 'node:path';
import { readAgentConfig } from './agent/config';
import { uploadedSkillsDir } from './agent/skills';
@@ -93,9 +93,14 @@ export interface RemovalOutcome {
error?: string;
}
+/** A folder reached through a link is somewhere the user chose, so only the link goes. */
export function removeAll(removals: Removal[]): RemovalOutcome[] {
return removals.map((removal) => {
try {
+ if (lstatSync(removal.path).isSymbolicLink()) {
+ rmSync(removal.path, { force: true });
+ return { removal, removed: true, kept: [] };
+ }
const { kept, refused } = emptying(removal.path, [...(removal.keep ?? []), ...(removal.inUse ? [removal.inUse] : [])]);
if (refused.length) return { removal, removed: false, kept, error: refused.join('; ') };
if (!kept.length) rmSync(removal.path, { recursive: true, force: true, ...RETRY });