on master help sign in
Installer: register with every Brave channel in use and check the manifest

Brave Beta and Nightly read host manifests from their own folders, so the installer now also writes there when that channel has been run. After writing, it checks each manifest the way Brave will (name, absolute and executable host path, allowed origin) and names any problem instead of leaving it to surface as "host not found". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LdKDAYoqmGehyHsV42LhJW

commit4a5072573635b4f8bdd7af32409d1a5aa0629398 authorClaude <noreply@anthropic.com> dateWed 23 Sep 2026, 20:23 (2 weeks ago) parent762bcc6
1 file changed+28
scripts/install-manifest.sh+28
scripts/install-manifest.sh+28
@@ -26,6 +26,13 @@ for arg in "$@"; do
2626 *) echo "unknown option: $arg" >&2; exit 2 ;;
2727 esac
2828done
29+# Also register with every other Brave channel that has been run on this Mac (Beta, Nightly),
30+# since each one reads host manifests from its own folder.
31+for ch in Brave-Browser-Beta Brave-Browser-Nightly; do
32+ if [[ -d "$HOME/Library/Application Support/BraveSoftware/$ch" && " ${CHANNELS[*]} " != *" $ch "* ]]; then
33+ CHANNELS+=("$ch")
34+ fi
35+done
2936
3037ID=$(tr -d '[:space:]' < extension-id 2>/dev/null || true)
3138if [[ -z "$ID" ]]; then
@@ -73,6 +80,27 @@ for ch in "${CHANNELS[@]}"; do
7380 echo "manifest: $DIR/io.diagonal.host.json"
7481done
7582
83+# Check what Brave will check, so a problem is named here instead of as "host not found" later.
84+for ch in "${CHANNELS[@]}"; do
85+ "$PYTHON" - "$HOME/Library/Application Support/BraveSoftware/$ch/NativeMessagingHosts/io.diagonal.host.json" "$ID" <<'PY'
86+import json, os, sys
87+path, ext_id = sys.argv[1], sys.argv[2]
88+m = json.load(open(path))
89+problems = []
90+if m.get("name") != "io.diagonal.host":
91+ problems.append(f"name is {m.get('name')!r}")
92+host = m.get("path", "")
93+if not os.path.isabs(host):
94+ problems.append(f"path {host!r} is not absolute")
95+elif not os.access(host, os.X_OK):
96+ problems.append(f"host {host} is missing or not executable")
97+if m.get("allowed_origins") != [f"chrome-extension://{ext_id}/"]:
98+ problems.append(f"allowed_origins is {m.get('allowed_origins')}")
99+if problems:
100+ sys.exit("manifest check failed for " + path + ": " + "; ".join(problems))
101+PY
102+done
103+
76104FM="${DIAGONAL_FM:-/usr/bin/fm}"
77105
78106# fm refuses to run (exit 69) until someone accepts Apple's terms for it, once per Mac.