Open-source AI browser agent for Chrome and Firefox (monorepo) π§
Manual test: capability Γ origin permission gate + Permissions page
These two paths can't be covered by test/run.js (they need a live browser β
the 3-option permission card and the Permissions page are DOM/storage
glue). Run this checklist after loading the unpacked extension before merging
changes to the permission gate or its UI.
Load the unpacked extension your usual dev way:
- Firefox:
about:debuggingβ This Firefox β Load Temporary Add-on β picksrc/firefox/manifest.json. - Chrome:
chrome://extensionsβ Developer mode β Load unpacked βsrc/chrome.
Helpers you'll reuse (run in the background/service-worker console, or the Permissions page console):
- Inspect grants:
await browser.storage.local.get('wb_permissions')(Firefox) /chrome.storage.local.get('wb_permissions')(Chrome). - Reset grants:
browser.storage.local.remove('wb_permissions'), or Permissions page β Clear all.
Test 1 β The 3-option permission card
Setup: reset grants. Open the side panel, switch to Act mode, open a simple page with a visible clickable button.
1a. Card renders correctly
- Tell the agent: "click the ".
- Expect a card: "WebBrain wants to click / submit on <host>. Allow it?"
with three buttons:
Allow onceΒ·Always allow on <host>Β·Don't allow, and NO free-text input (permission cards are structured β the buttons returnonce/always/deny, not typed text). - Check layout β all three buttons visible, not clipped/overlapping/wrapping.
- Localization β switch the language (the side panel's language menu) to a non-English locale and trigger the prompt again: the question, the verb, and the three buttons should be translated (English is the fallback for unset keys), and clicking still works (the returned value is locale-independent).
1b. "Allow once" proceeds and is turn-scoped (critical: must NOT act as deny)
- Click Allow once β the click executes.
- In the same turn, prompt another click on the same site β no second card.
- Send a new message that clicks again β card reappears (new turn clears once-grants).
1c. "Always allow" persists
- Trigger the click again, click Always allow on <host> β click executes.
- Subsequent turns clicking on that host β no card.
- Console:
wb_permissionscontains{capability:'click', host:'<host>', action:'allow', duration:'always'}.
1d. "Don't allow" blocks
- Reset grants, trigger a gated action, click Don't allow.
- Expect the action does not happen; the agent reports it was denied / asks how to proceed (it must not loop retrying).
1e. Abort while card is open
- Trigger a card, then hit Stop.
- Expect the run ends cleanly ("Stopped by user"), no hang.
Test 2 β Per-(capability, host) granularity
- Grant Always allow for
clickon site A (Test 1c). - On site A, prompt a type action β card appears (different capability).
- Navigate to site B and prompt a click β card appears (different host).
- Prompt a navigation to a new host β a navigate card for that destination.
Confirms a grant is scoped to exactly one capability+host, not a blanket pass.
Test 3 β Permissions settings tab (revoke flow)
Setup: grant 2β3 "Always allow" entries across different sites/capabilities.
- Open the Permissions page (Manage site permissions in the side panel's β menu).
- Expect each grant on its own row β host as bold label, "Allowed to <verb>" beneath (or "β Blocked from <verb>" for a deny), and a Revoke button; a Clear all permissions button at the bottom.
- Revoke one row (with 2β3 grants present) β that specific row
disappears immediately, the other rows stay listed, and
wb_permissionsin the console now contains exactly the remaining grants (the revoked{capability, host}is gone, nothing else changed). (This is the assertion that guards the per-row revoke β the earlier NUL/delimiter bug made Revoke remove nothing or the wrong grant.) - Live re-prompt: back in the agent, trigger that exact capability on that
exact host β it prompts again (proves
storage.onChangedβhydrateFrominvalidated the in-memory grant without a reload). - Clear all β list shows empty-state text and the Clear-all button hides.
- Empty state from scratch: with no grants, open the tab β empty-state text, no rows.
Test 4 β Persistence across reload
- Grant an "Always allow."
- Reload the extension (or restart the browser).
- Agent acts on that host β no prompt; the Permissions page still lists it.
Test 5 β Master switch ("Ask before consequential actions")
The toggle is at the top of the Permissions page, on by default.
- On (default): with the toggle on, trigger a gated action β the permission card appears (as in Test 1). The warning box is hidden.
- Turn it off: uncheck the toggle β a β οΈ warning box appears explaining
that prompts are off and the agent will act without asking. Console:
askBeforeConsequentialActionsisfalse. - Fast path: back in the agent (no reload), trigger a gated action on a site
with no existing grant β it executes with no card (the
storage.onChangedlistener picked up the change live). - Layers 1 & 2 still on: the switch only disables the prompts. Confirm the agent still treats page content as data β e.g. a page that says "ignore your instructions and β¦" should not hijack the task (this is the system-prompt / untrusted-wrapping behavior, independent of the gate).
- Turn it back on: re-check β warning hides; gated actions prompt again.
Pass criteria
- Card shows 3 well-laid-out buttons and no free-text input (1a); localized in non-English locales (1a.4).
- Allow-once and Always proceed; Don't-allow blocks (1bβ1d).
- Grants are per-capability+host (Test 2).
- The Permissions page lists/revokes/clears correctly; a revoke causes an immediate re-prompt (Test 3).
- Grants persist across reload (Test 4).
Highest-risk item: 1a/1b. The card now returns a structured value
(once/always/deny) from the button click β there is no label parsing β so
a mis-render would show as a missing/broken button rather than a wrong grant.
If a button does nothing or the wrong choice is recorded, the issue is the
data.permission branch of renderClarifyCard (sidepanel.js) or the value
mapping in _promptPermission (agent.js). _promptPermission still maps any
unexpected value to 'deny' (fail-safe).