← Commit history

ext 0.0.23 / bridge 0.0.41: open_tab echoes the opened url (was empty -> looked like 'returned nothing'); enforceBackground no longer minimizes an already-foreground window on open_tab

John Lauer ·c5d0080d47 ·4mo ago ·parent d9bd038
6 files changed +18−11
bridge/BRIDGE_VERSION+1−1
@@ -1 +1 @@-0.0.40+0.0.41
bridge/bridge.json+2−2
@@ -2,8 +2,8 @@   "manifest_version": 1,   "name": "native-browser",   "displayName": "Adom Native Browser (Chrome + Edge)",-  "version": "0.0.40",-  "expectedExtensionVersion": "0.0.22",+  "version": "0.0.41",+  "expectedExtensionVersion": "0.0.23",   "description": "Drives the user's REAL signed-in Chrome/Edge via an installed extension (native-messaging transport). Mirrors the puppeteer bridge's verb surface as nbrowser_* but runs inside the actual logged-in profile, so cookies/SSO/saved-logins/captcha human-trust all work. The bridge binds an ephemeral loopback port (PORTS.md compliant) and writes a discovery file; the native-messaging host pumps stdio <-> this bridge; the extension never touches a TCP port.",   "homepage": "https://wiki.adom.inc/adom/adom-browser-extension",   "author": "Adom Inc.",
bridge/package.json+1−1
@@ -1,6 +1,6 @@ {   "name": "adom-native-browser-bridge",-  "version": "0.0.40",+  "version": "0.0.41",   "private": true,   "description": "adom-desktop bridge for the Adom native-browser extension (Chrome + Edge)",   "main": "server.js",
extension/manifest.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 3,   "name": "Adom for Chrome & Edge",   "short_name": "Adom",-  "version": "0.0.22",+  "version": "0.0.23",   "description": "Drive your real, logged-in Chrome/Edge from the Adom ecosystem \u2014 the native-browser counterpart to pup.",   "minimum_chrome_version": "116",   "background": {
extension/src/native.js+8−1
@@ -193,6 +193,10 @@ async function currentForeground() { async function enforceBackground(winId, args, verb, prevFocusedId) {   if (userWantsForeground(args)) return null; // the user asked to see it - allowed   if (winId == null) return null;+  // If the window was ALREADY the foreground before this verb ran, the verb did NOT steal focus - it was+  // already there (e.g. the user raised it to watch, or it's the only window). Leave it alone; otherwise+  // we'd wrongly minimize/demote a window every time we, say, open a background tab into it.+  if (prevFocusedId != null && prevFocusedId === winId) return null;   let w;   try { w = await chrome.windows.get(winId); } catch { return null; }   if (!w || !w.focused) return null; // not topmost → nothing to correct@@ -437,7 +441,10 @@ export async function openTab(args = {}) {   const base = { url: args.url, active: fg };   const tab = await chrome.tabs.create(windowId != null ? { windowId, ...base } : base);   const warn = await enforceBackground(windowId, args, 'nbrowser_open_tab', prev); // backstop: opening a tab must not raise the window-  const res = { ok: true, sessionId: args.sessionId, tabId: String(tab.id), url: tab.url, title: tab.title, _hint: 'Opened in the BACKGROUND (active:false) — drive it by tabId. ' + POLITE_HINT };+  // Echo args.url (chrome.tabs.create returns the tab BEFORE it navigates, so tab.url/title are empty at+  // this instant - returning them raw made callers think the open "returned nothing"). The tab IS open+  // (tabId proves it); it may still be loading, so drive it by tabId / wait with nbrowser_wait_for.+  const res = { ok: true, sessionId: args.sessionId, tabId: String(tab.id), url: tab.url || args.url, title: tab.title || undefined, _hint: 'Tab opened in the BACKGROUND (active:false) at ' + (tab.url || args.url) + ' — it may still be loading (drive it by this tabId; nbrowser_wait_for to await a selector/URL). ' + POLITE_HINT };   return withWarn(res, warn); } 
native-browser-bridge-manifest.json+5−5
@@ -1,8 +1,8 @@ {   "manifest_version": 1,-  "version": "0.0.40",-  "url": "https://wiki.adom.inc/download/adom/adom-browser-extension/0.0.40/native-browser-bridge-v0.0.40.bin",-  "sha256": "e6e1103824a024513d7ca48219625b1858171dbd597927f96b318174423c4e73",-  "size": 45506,+  "version": "0.0.41",+  "url": "https://wiki.adom.inc/download/adom/adom-browser-extension/0.0.41/native-browser-bridge-v0.0.41.bin",+  "sha256": "b16240ba924d648ef73466ae7ae56497db9fe65feaa5bf9b90f824d2b774e1bd",+  "size": 45507,   "released_at": "2026-07-08T00:00:00Z"-}+}\ No newline at end of file