Trust the Chrome Web Store extension (pmhfoafjoogobhfadaicklhkldgnafmk)
The store build has its own id, so the native-messaging manifest refused it and the extension reported the app as not running. Chrome now allows the store id and the unpacked development id, in the NSIS hook and in both install scripts; --chrome-id / -ChromeId take a list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# Registers the Kestrove native-messaging host with the browsers of the current user (Linux, macOS).
|
||||
# Windows: install.ps1.
|
||||
#
|
||||
# install.sh [--nmh /path/to/kestrove-nmh] [--chrome-id ID] [--firefox-id ID]
|
||||
# install.sh [--nmh /path/to/kestrove-nmh] [--chrome-id ID[,ID…]] [--firefox-id ID]
|
||||
# [--browsers chrome,chromium,edge,brave,firefox] [--user-data-dir DIR] [--uninstall]
|
||||
#
|
||||
# With neither --browsers nor --user-data-dir it installs for every browser whose profile directory exists.
|
||||
@@ -14,8 +14,9 @@ set -eu
|
||||
HOST=app.kestrove.nmh
|
||||
HERE=$(cd "$(dirname "$0")" && pwd)
|
||||
NMH=""
|
||||
# Development ids: the unpacked Chrome build is pinned by the manifest key in kestrove-browser/scripts/build.mjs.
|
||||
CHROME_ID=kogapfibnnpeapfcjkkpgjddbhnjfein
|
||||
# Chrome: the Chrome Web Store build, then the unpacked development build (pinned by the manifest key in
|
||||
# kestrove-browser/scripts/build.mjs).
|
||||
CHROME_IDS="pmhfoafjoogobhfadaicklhkldgnafmk kogapfibnnpeapfcjkkpgjddbhnjfein"
|
||||
FIREFOX_ID=[email protected]
|
||||
BROWSERS=""
|
||||
USER_DATA_DIR=""
|
||||
@@ -26,7 +27,7 @@ die() { echo "install.sh: $*" >&2; exit 1; }
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
--nmh) NMH=$2; shift 2 ;;
|
||||
--chrome-id) CHROME_ID=$2; shift 2 ;;
|
||||
--chrome-id) CHROME_IDS=$(echo "$2" | tr ',' ' '); shift 2 ;;
|
||||
--firefox-id) FIREFOX_ID=$2; shift 2 ;;
|
||||
--browsers) BROWSERS=$(echo "$2" | tr ',' ' '); shift 2 ;;
|
||||
--user-data-dir) USER_DATA_DIR=$2; shift 2 ;;
|
||||
@@ -36,7 +37,9 @@ while [ $# -gt 0 ]; do
|
||||
esac
|
||||
done
|
||||
|
||||
echo "$CHROME_ID" | grep -Eq '^[a-p]{32}$' || die "--chrome-id must be 32 letters a-p"
|
||||
for id in $CHROME_IDS; do echo "$id" | grep -Eq '^[a-p]{32}$' || die "--chrome-id must be 32 letters a-p"; done
|
||||
# "chrome-extension://a/", "chrome-extension://b/" (the template supplies the outer quotes).
|
||||
CHROME_ORIGINS=$(for id in $CHROME_IDS; do printf '%s' "${sep-}chrome-extension://$id/"; sep='", "'; done)
|
||||
echo "$FIREFOX_ID" | grep -Eq '^[A-Za-z0-9._@{}-]+$' || die "bad --firefox-id"
|
||||
|
||||
if [ "$UNINSTALL" = 0 ]; then
|
||||
@@ -83,7 +86,7 @@ esac
|
||||
done
|
||||
|
||||
render() { # template → stdout
|
||||
sed -e "s|__NMH_PATH__|$NMH|" -e "s|__CHROME_EXTENSION_ID__|$CHROME_ID|" -e "s|__FIREFOX_EXTENSION_ID__|$FIREFOX_ID|" "$HERE/$HOST.$1.json"
|
||||
sed -e "s|__NMH_PATH__|$NMH|" -e "s|chrome-extension://__CHROME_EXTENSION_ID__/|$CHROME_ORIGINS|" -e "s|__FIREFOX_EXTENSION_ID__|$FIREFOX_ID|" "$HERE/$HOST.$1.json"
|
||||
}
|
||||
|
||||
place() { # flavor dir
|
||||
|
||||
Reference in New Issue
Block a user