openclaw/extensions/browser
holny e71ceb0c3d
fix(browser): keep tabs usable while Chrome Web Store is open (#156890)
Closes #156749

## What Problem This Solves

Fixes: a Chrome Web Store tab makes browser tabs, snapshot, and evaluate fail for every tab after the native-identity recovery in #139275.

## User Impact

Ordinary tabs remain usable while Chrome-protected pages are open. The Gateway logs the excluded tab ID and Chrome's refusal; browser tab output lists only usable targets. Transient failures still reject the complete inventory. This is a Gateway-side fix: the existing Store extension forwards Chrome's errors unchanged, so no new Store release is required. CDP response fields and configuration are unchanged.

## Why This Change Was Made

Classify exact Chrome attach refusals, not URL lists or arbitrary errors. The observed Web Store error is `The extensions gallery cannot be scripted.`; Chromium also defines exact restrictions for chrome:// and other extensions' pages. Classification happens for every newly visited tab, including arrivals during enumeration, and is not cached across requests. A changed URL cannot inherit an earlier exclusion. Diagnostics use the existing warning logger rather than adding a protocol field that tab-list consumers discard.

## Evidence

Real Chrome 153, unpacked extension 2.3.0, an isolated Gateway, and a fresh browser profile with https://example.com/ and https://chromewebstore.google.com/:

- Baseline main `932572acb2` relay: browser tabs fails with `Protocol error (Target.getTargets): Target identities are unavailable`.
- Candidate: tabs lists Example Domain with native target ID `<target-id>`. Snapshot returns the Example Domain heading and Learn more link; evaluate returns `"Example Domain"`. The Store tab remains open.
- Gateway warning: `Skipping tab 2017597585 during target enumeration: The extensions gallery cannot be scripted.`
- The first listing immediately after Gateway restart returned no tabs; the later connected listing and snapshot/evaluate succeeded. This does not claim startup behavior changed.
- CLI proof used the normal built `node openclaw.mjs browser --browser-profile chrome ...` entry after the supported wrapper built the runtime; the development wrapper attempts to rebuild a dirty tree and correctly refuses while a Gateway is running.
- Both new regressions fail on baseline with -32002; candidate enumeration passes 15/15. Existing controls still reject transient native acquisition/retirement failures and preserve fresh native identities. New cases cover late-arriving protected tabs and retry after a refusal clears. Initial focused invocation: 23.59 seconds wall including cold worker generation; the new cases took 3–4 ms each.
- Final focused enumeration, cleanup, and Fetch suites: 34/34 passed in 19.68 seconds wall. Extension production/test typechecks and scoped typed lint passed.

Chromium contracts: [debugger attach](https://github.com/chromium/chromium/blob/main/chrome/browser/extensions/api/debugger/debugger_api.cc), [Web Store restriction](https://github.com/chromium/chromium/blob/main/chrome/common/extensions/chrome_extensions_client.cc), [exact error constants](https://github.com/chromium/chromium/blob/main/extensions/common/manifest_constants.h).

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-09-26 12:29:43 +05:30
..
assets improve(plugins): give bundled logos consistent white icon tiles (#155259) 2026-09-23 19:09:26 -07:00
chrome-extension refactor(browser): deslop browser (#156742) 2026-09-23 15:47:30 -07:00
scripts feat(browser): verify Chromium headless shell across platforms (#154396) 2026-09-24 00:12:40 +08:00
skills/browser-automation feat(browser): expose page errors action (#131906) 2026-08-28 12:23:47 -07:00
src fix(browser): keep tabs usable while Chrome Web Store is open (#156890) 2026-09-26 12:29:43 +05:30
benchmark-api.ts feat(browser): add portable Lightpanda deployment and benchmarks (#154360) 2026-09-23 15:14:16 +00:00
bridge-api.ts perf(browser): reduce cold bridge startup and cleanup stalls (#138583) 2026-09-04 14:57:43 -07:00
browser-config.ts
browser-control-auth.ts
browser-doctor.ts
browser-maintenance.cold.test.ts refactor(browser): deslop browser (#156742) 2026-09-23 15:47:30 -07:00
browser-maintenance.test.ts fix(browser): preserve tab ownership during lazy cleanup (#137671) 2026-09-03 22:39:12 -07:00
browser-maintenance.transport.test.ts perf(browser): move dashboard event discovery to SQLite worker (#151952) 2026-09-18 15:43:09 -07:00
browser-maintenance.ts fix(browser): preserve tab ownership during lazy cleanup (#137671) 2026-09-03 22:39:12 -07:00
browser-profiles.ts fix(browser): native bootstrap stalls before replying (#132212) 2026-08-28 17:55:06 -07:00
cli-metadata.ts refactor(plugins): deslop browser and memory-core second pass (#158172) 2026-09-25 10:12:23 -07:00
cli-output-mode.ts feat(browser): unify local Chrome setup across desktop and terminal (#152057) 2026-09-22 06:28:29 -07:00
index.test.ts feat(browser): allow isolated dashboards for session writers (#156371) 2026-09-24 00:04:02 +08:00
index.ts
native-host-entry.ts feat(browser): unify local Chrome setup across desktop and terminal (#152057) 2026-09-22 06:28:29 -07:00
openclaw.plugin.json feat: show declared plugin capabilities and setup guides (#157956) 2026-09-25 16:43:53 -07:00
package.json chore(deps): refresh dependencies with a seven-day cutoff (#157238) 2026-09-25 02:38:45 +00:00
plugin-registration.dashboard-discovery.test.ts perf(browser): move dashboard event discovery to SQLite worker (#151952) 2026-09-18 15:43:09 -07:00
plugin-registration.node-host-laziness.test.ts feat: automatically update idle headless nodes (#151545) 2026-09-18 06:20:27 -07:00
plugin-registration.session-access.test.ts feat(browser): allow isolated dashboards for session writers (#156371) 2026-09-24 00:04:02 +08:00
plugin-registration.shutdown.test.ts feat: automatically update idle headless nodes (#151545) 2026-09-18 06:20:27 -07:00
plugin-registration.ts refactor(plugins): deslop browser and memory-core second pass (#158172) 2026-09-25 10:12:23 -07:00
register.runtime.ts feat(browser): allow isolated dashboards for session writers (#156371) 2026-09-24 00:04:02 +08:00
relay-daemon-entry.ts feat(browser): unify local Chrome setup across desktop and terminal (#152057) 2026-09-22 06:28:29 -07:00
runtime-api.ts
setup-api.ts
setup-entry.ts feat(browser): unify local Chrome setup across desktop and terminal (#152057) 2026-09-22 06:28:29 -07:00
test-fetch.ts
test-support.ts test(browser): consolidate proxy file rejection coverage (#135672) 2026-09-01 17:22:09 -07:00
tsconfig.json