Files
Brandon LiandClaude Opus 5 65a1103cda Derive capture scope from host_permissions, drop the target URL setting
The popup's target URL pattern was doing two jobs. As a fallback for locate
requests it is now dead — every step carries its firm's pattern. As the thing
deciding which tab gets scraped it was still load-bearing: without it, capture
falls back to whichever tab is active, which means scraping a banking or mail
tab and storing it in the dashboard's database.

So the setting goes, but the scoping moves to the manifest rather than
disappearing. host_permissions already lists exactly the hosts this extension is
allowed to read; capture now queries those (minus localhost, which is the
dashboard mirroring its own output back). The two cannot drift apart, and adding
a firm — which means adding its host to the manifest anyway — scopes capture
without a second place to remember.

With more than one firm open, capture prefers the active tab over the first
match, so it follows attention rather than tab order. That case could not arise
while a single pattern matched one site.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-30 13:26:07 -05:00

39 lines
1.8 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<style>
body { width: 300px; margin: 0; padding: 14px; font: 13px/1.4 system-ui, sans-serif; color: #1e293b; }
h1 { font-size: 14px; margin: 0 0 10px; }
label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; margin: 10px 0 3px; }
input { width: 100%; box-sizing: border-box; padding: 5px 7px; font: 12px ui-monospace, monospace;
border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; }
button { margin-top: 12px; padding: 6px 10px; font-size: 12px; font-weight: 500; border: 0;
border-radius: 6px; background: #3b82f6; color: #fff; cursor: pointer; }
button.ghost { background: #e2e8f0; color: #334155; margin-left: 6px; }
#status { margin-bottom: 10px; padding: 8px; border-radius: 6px; background: #f1f5f9; font-size: 12px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.muted { color: #64748b; font-size: 11px; }
.err { color: #dc2626; font-size: 11px; margin-top: 4px; word-break: break-word; }
</style>
</head>
<body>
<h1>AutoFirmer Capture</h1>
<div id="status"></div>
<label for="apiBase">Dashboard URL</label>
<input id="apiBase" placeholder="http://localhost:3000" />
<label for="pollSeconds">Poll interval (seconds)</label>
<input id="pollSeconds" type="number" min="1" max="120" />
<label for="elementSelector">Element selector (optional)</label>
<input id="elementSelector" placeholder="button.buy" />
<button id="save">Save</button>
<button id="now" class="ghost">Capture now</button>
<script src="popup.js"></script>
</body>
</html>