From 6cf74817d845015514258fd54288ff991de045b5 Mon Sep 17 00:00:00 2001 From: leeguooooo Date: Wed, 10 Jun 2026 13:44:32 +0900 Subject: [PATCH] feat(connect): allow the Web Store extension id in native-messaging origins Store upload strips manifest 'key', so the published build gets id knfcmbamhjmaonkfnjhldjedeobeafmk (not the local ciiljdlhd). Add a STORE_EXTENSION_ID const and list both origins in allowed_origins so either the local Load-unpacked build or the store build can reach the native host. --- cli/src/connect.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cli/src/connect.rs b/cli/src/connect.rs index 3466fb6..298ac62 100644 --- a/cli/src/connect.rs +++ b/cli/src/connect.rs @@ -24,6 +24,11 @@ pub const HOST_NAME: &str = "com.agent_browser.connect"; /// that extension talk to this host, and the force-install policy references it. pub const EXTENSION_ID: &str = "ciiljdlhdpfckdcfkphgmfalanpdejep"; +/// The Chrome Web Store assigns its own id (the manifest "key" is stripped from +/// store uploads), so the published build has a different origin than the local +/// Load-unpacked one. Allow both to talk to the native-messaging host. +pub const STORE_EXTENSION_ID: &str = "knfcmbamhjmaonkfnjhldjedeobeafmk"; + /// Update URL the force-install policy points at. MUST be the Chrome Web Store /// endpoint: Chrome 149 tags any **off-Web-Store** force-installed extension /// `[BLOCKED]` on an unmanaged browser (verified on macOS — chrome://policy shows @@ -182,7 +187,10 @@ fn install_native_host() -> Result, String> { "description": "agent-browser connect — native messaging host", "path": launcher.display().to_string(), "type": "stdio", - "allowed_origins": [format!("chrome-extension://{EXTENSION_ID}/")], + "allowed_origins": [ + format!("chrome-extension://{EXTENSION_ID}/"), + format!("chrome-extension://{STORE_EXTENSION_ID}/"), + ], }); let body = serde_json::to_string_pretty(&manifest).map_err(|e| e.to_string())?;