A local-only Chrome (Manifest V3) side-panel extension for internal use that
batch-runs a list of prompts through Google Flow (labs.google/fx/tools/flow),
then auto-downloads and organizes the generated images/videos.
No accounts, no server, no limits — everything runs client-side in the browser.
- Spec: docs/superpowers/specs/2026-06-11-flow-batch-extension-design.md
- Plan: docs/superpowers/plans/2026-06-11-flow-batch-extension.md
Side Panel (React) → Background worker (BatchEngine state machine) → Content script (FlowPageAdapter)
│ │ drives
▼ ▼
chrome.downloads ◀── result URLs ── MAIN-world network listener ── Google Flow
All decision/queue logic lives in src/core behind injected ports and is unit-tested
(46 tests). Every Google-Flow-specific DOM selector lives in one file:
src/content/flow-page-adapter.ts (SELECTORS block).
npm install
npm run dev # WXT dev server with HMR
npm test # Vitest unit tests
npm run build # production build → .output/chrome-mv3/harness/ is a mock Flow page (decoy editables, pre-existing gallery, composer
emulating both input-syncing and strict revert-style editors) for testing
FlowPageAdapter in a real Chrome without a Google session:
npx vite harness --port 5610, then drive window.FlowHarness from DevTools.
npm run build- Open
chrome://extensions, enable Developer mode. - Load unpacked → select
.output/chrome-mv3/. - Open
labs.google/fx/tools/flow, click the extension icon to open the side panel.
The DOM selectors and applySettings setters in src/content/flow-page-adapter.ts
are best-effort placeholders that must be verified against the live Flow UI.
With Flow open and DevTools on the page:
- Inspect the prompt box, send button, reference file input, and result tiles;
update the
SELECTORSconstant to match. - Implement the
applySettingssetters (model / mode / aspect ratio / images-per-prompt) against Flow's live menus. - Verify result-URL capture (review note M1): the MAIN-world listener
(
entrypoints/flow-net.content.ts) assumes result media URLs appear in thefetch/XHR request URL and match\.(png|jpe?g|webp|mp4|webm). If Flow instead returns result URLs inside a JSON response body, feedResultBusfrom the response, or fall back to scrapingSELECTORS.resultMediafrom the results container insideFlowPageAdapter.waitForResults. - Verify the expected-count (review note M4):
waitForResultswaits forimagesPerPromptURLs. Confirm Flow actually emits that many separate media URLs per submit (e.g. "x4" might render one grid image → set expected accordingly, or it will hang until timeout).
- Side panel opens on the Flow tab.
- 3-prompt smoke batch: paste 3 prompts, folder
flow-batch-test, auto-download images on, Run → 3 files land inDownloads/flow-batch-test/as001.png,002.png,003.png; progress ends indone. - Pause mid-run → status
paused; Resume → finishes remaining prompts. - Start a batch, close the side panel mid-run, reopen → progress reflects persisted state (the run keeps going in the background).
- I2 (Stop latency): Stop is observed at item boundaries, so a click during a
long
waitForResults(up to the 120s item timeout) or the inter-item delay isn't acted on immediately. MakewaitForResultsabortable if prompt Stop matters. - v2 (deferred by design): Queue / Gallery / Library / Logs tabs; wiring the per-prompt "different-for-each" reference picker into the UI (the engine already supports it and it's unit-tested — the UI currently ships "same-for-all").