{"key":"lens_browser_extension_concept_2026_04_20","title":"Lens Browser Extension — Zen/Firefox WebExtension Concept","content":"## Lens Browser Extension\nCreated: 2026-04-20\nStatus: Planning only — no code written yet\n\n### What It Is\nA browser extension for Zen Browser (Firefox-based, supports standard WebExtensions) that brings Fabric pattern processing directly into the browser. Click a button while on any webpage or YouTube video and run it through any Fabric pattern without leaving the page.\n\n### The Core Use Case\n- You're on a YouTube video\n- Click the Lens icon in the toolbar\n- Popup shows plain English options: \"What are the key ideas?\", \"Summarize this\", etc.\n- It grabs the URL, sends it to Fabric at http://192.168.4.123:8767\n- Streams the result back into the popup or a sidebar\n- No tab switching, no copy-pasting URLs, no CLI\n\n### Browser Compatibility\n- Zen Browser — Firefox-based, supports WebExtensions API\n- Also works in Firefox natively\n- Chrome/Chromium would need minor manifest adjustments (manifest v3)\n\n### Technical Architecture\n\n**The CORS problem and solution:**\nBrowser extensions can't directly call a local network API from a webpage context due to CORS restrictions. Two clean solutions:\n\nOption 1 — Add CORS headers to Fabric container (one line of config)\nOption 2 — Background service worker makes the API call instead of page script (sidesteps CORS entirely — this is the standard approach)\n\nRecommended: Option 2 — background service worker\n\n**Extension components:**\n- manifest.json — extension config, permissions\n- popup.html/js — the UI shown when toolbar button clicked\n- background.js — service worker that makes API calls to Fabric\n- content.js — optional, for reading page content or injecting sidebar\n- icons — Lens branding\n\n**Permissions needed:**\n- activeTab — to read current page URL\n- http://192.168.4.123/* — to call local Fabric API\n- storage — to save user preferences (default pattern, etc.)\n\n### UI Design\nMatches Lens aesthetic — lighter, warmer, not dark terminal style.\n\nPopup flow:\n1. Shows current page title and URL\n2. Dropdown or button grid of plain English actions\n3. \"Run\" button\n4. Output streams in — beautifully rendered markdown\n5. Option to save to Library (calls Lens app or saves locally)\n\nFor YouTube specifically:\n- Detects YouTube URLs automatically\n- Shows \"Extract wisdom from this video\" as the primary action\n- Uses Fabric's native YouTube transcript endpoint\n\n### Actions Available in Extension\n| Button label | Fabric pattern |\n|---|---|\n| What are the key ideas? | extract_wisdom |\n| Summarize this | summarize |\n| What should I take away? | extract_insights |\n| Pull out the best quotes | extract_quotes |\n| What are the action items? | extract_recommendations |\n\n### What It Does NOT Need to Start\n- Authentication\n- Sync across devices\n- Cloud storage\n- Account system\n\n### Relationship to Lens App\nThe extension is a companion to the Lens web app — not a replacement. The extension is for in-context processing while browsing. The Lens app is for deeper work, TELOS management, library browsing, and conversation.\n\nEventually: extension could open results in the Lens app sidebar for saving and organizing.\n\n### Build Complexity\nLow — one of the simpler things on the project list. A basic working version could be done in an afternoon once Lens app core is stable.\n\n### Build Order\nBuild after:\n1. Lens web app core is working\n2. Fabric API is stable\n3. CORS or service worker approach is validated\n\n### File Structure\n```\nlens-extension/\n├── manifest.json\n├── popup.html\n├── popup.js\n├── background.js\n├── content.js (optional)\n├── styles.css\n└── icons/\n    ├── icon16.png\n    ├── icon32.png\n    ├── icon48.png\n    └── icon128.png\n```\n","summary":"Planning document for a Lens browser extension for Zen Browser (Firefox-based). Allows running Fabric patterns on any webpage or YouTube video directly from the browser without leaving the page.","status":"active","namespace":"projects","namespace_name":"projects","namespace_tier":"shared","tags":["lens","browser-extension","zen-browser","firefox","webextension","fabric","planning"]}