Labels: bug, macos
Description
browser-harness mac-approve is the documented escape hatch for macOS's per-connection
"Allow remote debugging?" sheet. Both of its moving parts are hard-coded to stock
Google Chrome.
The gate:
# src/browser_harness/macos.py:60-66
def _google_chrome_root() -> Path:
return Path.home() / "Library/Application Support/Google/Chrome"
def _google_chrome_toggle_enabled() -> bool:
"""Only accept the toggle from the Google Chrome root used by the script."""
return _google_chrome_root() in remote_debugging_toggle_profiles()
The AppleScript:
if exists process "Google Chrome" then
tell process "Google Chrome"
daemon._MAC_PROFILES, meanwhile, supports eight browsers:
"Library/Application Support/Google/Chrome",
"Library/Application Support/Google/Chrome Canary",
"Library/Application Support/Comet",
"Library/Application Support/Arc/User Data",
"Library/Application Support/Dia/User Data",
"Library/Application Support/Microsoft Edge", # + Beta / Dev / Canary
"Library/Application Support/BraveSoftware/Brave-Browser",
Impact
A Brave (or Edge, Canary, Arc, Dia, Comet) user on macOS:
-
Runs browser-harness, hits the Allow sheet.
-
ensure_daemon() prints "run browser-harness mac-approve in another shell"
(admin.py:392-397 — this hint is not conditioned on which browser is in use).
-
Ticks "Allow remote debugging for this browser instance" in their browser.
-
Runs mac-approve and gets:
setup-required: first enable "Allow remote debugging for this browser instance" at
chrome://inspect/#remote-debugging, then run `browser-harness mac-approve` again
The message is wrong — they did enable it — and it is unactionable, because
remote_debugging_toggle_profiles() correctly reports their Brave profile while
_google_chrome_toggle_enabled() only ever looks at the Chrome path. Even if the gate
passed, the AppleScript would find no process "Google Chrome" and return not-found.
This is the only unattended path past the sheet, so these users have no way to run the
harness without a human clicking the button every time.
Suggested fix
Resolve the browser once and use it for both halves:
_MAC_APP_FOR_PROFILE = {
"Google/Chrome": "Google Chrome",
"Google/Chrome Canary": "Google Chrome Canary",
"Microsoft Edge": "Microsoft Edge",
"BraveSoftware/Brave-Browser": "Brave Browser",
"Arc/User Data": "Arc",
"Dia/User Data": "Dia",
"Comet": "Comet",
}
Pick the first entry in remote_debugging_toggle_profiles() that maps to a known app,
template its name into the AppleScript's process "..." lines, and only return
setup-required when no supported profile has the toggle on. admin._browser_launch_spec()
already does the profile-path → macOS-app-name mapping and could be reused rather than
duplicated.
If a browser genuinely can't be supported, the error should name it
("mac-approve does not support Arc") instead of claiming the user skipped a step.
Labels: bug, macos
Description
browser-harness mac-approveis the documented escape hatch for macOS's per-connection"Allow remote debugging?" sheet. Both of its moving parts are hard-coded to stock
Google Chrome.
The gate:
The AppleScript:
daemon._MAC_PROFILES, meanwhile, supports eight browsers:Impact
A Brave (or Edge, Canary, Arc, Dia, Comet) user on macOS:
Runs
browser-harness, hits the Allow sheet.ensure_daemon()prints "runbrowser-harness mac-approvein another shell"(
admin.py:392-397— this hint is not conditioned on which browser is in use).Ticks "Allow remote debugging for this browser instance" in their browser.
Runs
mac-approveand gets:The message is wrong — they did enable it — and it is unactionable, because
remote_debugging_toggle_profiles()correctly reports their Brave profile while_google_chrome_toggle_enabled()only ever looks at the Chrome path. Even if the gatepassed, the AppleScript would find no
process "Google Chrome"and returnnot-found.This is the only unattended path past the sheet, so these users have no way to run the
harness without a human clicking the button every time.
Suggested fix
Resolve the browser once and use it for both halves:
Pick the first entry in
remote_debugging_toggle_profiles()that maps to a known app,template its name into the AppleScript's
process "..."lines, and only returnsetup-requiredwhen no supported profile has the toggle on.admin._browser_launch_spec()already does the profile-path → macOS-app-name mapping and could be reused rather than
duplicated.
If a browser genuinely can't be supported, the error should name it
("mac-approve does not support Arc") instead of claiming the user skipped a step.