Popup and Options are separate documents from the background page and can't reach its live VeloxTransport directly, so background/bridge.ts relays it over one browser.runtime.connect port per document (call/subscribe/getStatus/reconnect/pair/unpair/setOverride in; result/event/status/pairError out). shared/panel-client.ts is the client side both surfaces use. Popup (src/popup/): status dot + text, active-downloads list driven by event.task.progress/added/state/removed (repaints ride the event's own <=4 Hz cap rather than adding a second timer), pause/resume buttons, "Start it" wired to a reconnect request. State lives in a DOM-free store.ts for unit testing; rendering uses createElement, not innerHTML (web-ext lint flags the latter). Options (src/options/): transport override select, pairing (code entry + pair/unpair, backed by two new WebSocketTransport methods, pairWithCode/unpair), and the daemon's capture policy mirrored via capture.getRules. The capture-policy form is editable only when the active transport is native messaging (uds) -- settings.set and rules.upsert are privileged, uds-only methods per shared/protocol METHODS, so WebSocket can't write them no matter what the page shows; CLAUDE.md section 2 rules out working around that locally. The bridge's status payload adds a kind field (which transport is live) for this to key off. Default category is the one piece of state that's genuinely the extension's own, not the daemon's, and lives in browser.storage.local via options/prefs.ts. Pure decisions (statusLine, pairingAvailable, captureRulesEditable) are split into view.ts for unit testing without a DOM. manifest.json registers the popup action and options_ui page (and, in the same edit, the content_scripts entry the next commit's media detection needs -- split by file, not by manifest line). build.mjs gains popup/options as further esbuild entry points, plus copying their static HTML/CSS into dist/. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ed8KEmAW48v4YHdxLtqsMB
61 lines
1.2 KiB
JSON
61 lines
1.2 KiB
JSON
{
|
|
"manifest_version": 3,
|
|
"name": "Velox",
|
|
"version": "0.1.0",
|
|
"description": "Hands Firefox downloads to the Velox download manager. Collects the URL, headers and cookies; the daemon does the rest.",
|
|
|
|
"browser_specific_settings": {
|
|
"gecko": {
|
|
"id": "[email protected]",
|
|
"strict_min_version": "128.0",
|
|
"data_collection_permissions": {
|
|
"required": ["none"]
|
|
}
|
|
}
|
|
},
|
|
|
|
"background": {
|
|
"scripts": ["dist/background.js"],
|
|
"type": "module"
|
|
},
|
|
|
|
"action": {
|
|
"default_popup": "dist/popup.html",
|
|
"default_title": "Velox"
|
|
},
|
|
|
|
"options_ui": {
|
|
"page": "dist/options.html",
|
|
"open_in_tab": true
|
|
},
|
|
|
|
"content_scripts": [
|
|
{
|
|
"matches": ["<all_urls>"],
|
|
"js": ["dist/content.js"],
|
|
"run_at": "document_idle",
|
|
"all_frames": true
|
|
}
|
|
],
|
|
|
|
"permissions": [
|
|
"webRequest",
|
|
"webRequestBlocking",
|
|
"downloads",
|
|
"cookies",
|
|
"contextMenus",
|
|
"storage",
|
|
"notifications",
|
|
"nativeMessaging"
|
|
],
|
|
|
|
"host_permissions": ["<all_urls>"],
|
|
|
|
"commands": {
|
|
"velox-grab-current-tab": {
|
|
"suggested_key": { "default": "Ctrl+Shift+U" },
|
|
"description": "Send the current tab's URL to Velox"
|
|
}
|
|
}
|
|
}
|