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,13 +2,14 @@
|
||||
# Linux/macOS: install.sh.
|
||||
#
|
||||
# powershell -ExecutionPolicy Bypass -File install.ps1 [-Nmh C:\path\kestrove-nmh.exe]
|
||||
# [-ChromeId ID] [-FirefoxId ID] [-Browsers chrome,chromium,edge,firefox] [-Uninstall]
|
||||
# [-ChromeId ID[,ID…]] [-FirefoxId ID] [-Browsers chrome,chromium,edge,firefox] [-Uninstall]
|
||||
#
|
||||
# Chrome and Brave share the Google\Chrome key. The manifests go to %LOCALAPPDATA%\Kestrove\NativeMessagingHosts.
|
||||
# allowed_origins / allowed_extensions pin the host to our extension ids (docs/04 A8).
|
||||
param(
|
||||
[string]$Nmh = "",
|
||||
[string]$ChromeId = "kogapfibnnpeapfcjkkpgjddbhnjfein",
|
||||
# The Chrome Web Store build, then the unpacked development build.
|
||||
[string[]]$ChromeId = @("pmhfoafjoogobhfadaicklhkldgnafmk", "kogapfibnnpeapfcjkkpgjddbhnjfein"),
|
||||
[string]$FirefoxId = "[email protected]",
|
||||
[string[]]$Browsers = @("chrome", "chromium", "edge", "firefox"),
|
||||
[switch]$Uninstall
|
||||
@@ -17,7 +18,7 @@ $ErrorActionPreference = "Stop"
|
||||
$HostName = "app.kestrove.nmh"
|
||||
$Here = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
|
||||
if ($ChromeId -notmatch '^[a-p]{32}$') { throw "-ChromeId must be 32 letters a-p" }
|
||||
foreach ($id in $ChromeId) { if ($id -notmatch '^[a-p]{32}$') { throw "-ChromeId must be 32 letters a-p" } }
|
||||
if ($FirefoxId -notmatch '^[A-Za-z0-9._@{}-]+$') { throw "bad -FirefoxId" }
|
||||
|
||||
$Keys = @{
|
||||
@@ -48,7 +49,7 @@ New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
|
||||
foreach ($flavor in @("chrome", "firefox")) {
|
||||
$m = Get-Content -Raw (Join-Path $Here "$HostName.$flavor.json") | ConvertFrom-Json
|
||||
$m.path = $Nmh
|
||||
if ($flavor -eq "chrome") { $m.allowed_origins = @("chrome-extension://$ChromeId/") } else { $m.allowed_extensions = @($FirefoxId) }
|
||||
if ($flavor -eq "chrome") { $m.allowed_origins = @($ChromeId | ForEach-Object { "chrome-extension://$_/" }) } else { $m.allowed_extensions = @($FirefoxId) }
|
||||
$m | ConvertTo-Json -Depth 4 | Set-Content -Encoding UTF8 (Join-Path $OutDir "$HostName.$flavor.json")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user