`mac-approve` only works for stock Google Chrome — Brave/Edge/Canary/Arc users get "setup-required" for a toggle they already enabled
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 "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: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.
Would be better if I don't take this up, won't be able to test locally, I don't have a mac.
Would appreciate a mac-user taking this up.
Another macOS data point: my primary browser is Chrome Dev, and I'm running into connection problems for the same reason described here. For now I've worked around it with a small wrapper script, but it would be great to see official support for browsers other than stock Google Chrome.
Worth noting for whoever picks this up: the Chrome release channels other than Canary aren't covered either. On my machine the profile roots are:
~/Library/Application Support/Google/Chrome
~/Library/Application Support/Google/Chrome Beta
~/Library/Application Support/Google/Chrome Canary
~/Library/Application Support/Google/Chrome Dev
daemon._MAC_PROFILES lists only Chrome and Chrome Canary, and the suggested _MAC_APP_FOR_PROFILE map has the same gap — so Chrome Beta/Dev users hit the problem one step earlier than Brave/Edge users do. If the mapping is reworked, please include Google Chrome Beta and Google Chrome Dev alongside Canary.