Skip to content

[integrations] Chrome extension for browser capture and search#41

Open
konepone wants to merge 1 commit intoNateBJones-Projects:mainfrom
konepone:integrations/chrome-extension
Open

[integrations] Chrome extension for browser capture and search#41
konepone wants to merge 1 commit intoNateBJones-Projects:mainfrom
konepone:integrations/chrome-extension

Conversation

@konepone
Copy link
Copy Markdown

Summary

  • Chrome Extension (Manifest V3) for saving and searching Open Brain thoughts directly from the browser
  • Includes a companion Supabase Edge Function (brain-api) as the REST backend
  • Fully self-contained: users deploy their own edge function and configure the extension with their API URL + key

Features

  • Save thoughts from any webpage with automatic source URL and page title tracking
  • Semantic search across all thoughts (browser, Telegram, Slack, Claude) with similarity scores
  • Auto-capture: select text on a page, open the extension, it is pre-filled
  • Right-click context menu: "Save to Brain" and "Search in Brain"
  • Omnibox: type brain <query> in the address bar for instant search suggestions
  • Related thoughts shown after saving
  • Source filter dropdown (Browser, Telegram, Slack, Claude)
  • Click to copy, delete thoughts, mark tasks as done
  • Keyboard shortcut: Ctrl+Shift+B to open
  • Stats bar: total thoughts, today, this week

Requirements

  • Working Open Brain setup (thoughts table + match_thoughts function)
  • OpenRouter API key (for embeddings + metadata extraction)
  • Chrome or Chromium-based browser

Testing

Tested on my own Open Brain instance with:

  • Saving thoughts from various webpages (source context correctly attached)
  • Semantic search returning ranked results with similarity scores
  • Context menu save and search on selected text
  • Omnibox search suggestions
  • Delete by ID and task status updates
  • Stats endpoint returning correct today/this_week counts

Add a Chrome extension that connects to Open Brain via a Supabase
Edge Function REST API. Features: save thoughts with page context,
semantic search, right-click context menu, omnibox integration,
keyboard shortcuts, task completion, and source filtering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@justfinethanku
Copy link
Copy Markdown
Collaborator

Nice work — this is a solid contribution with a useful feature set. The extension architecture is clean, manifest permissions are well-scoped, and the Edge Function uses parameterized queries properly. metadata.json passes schema validation, and the embedding model/dimensions match the canonical setup so there's full interop.

A few things to address before we can merge:

Blocking

  1. Extension UI is in German. The context menu items ("Im Brain speichern", "Im Brain suchen"), status messages ("Gedanke gespeichert!", "Suche laeuft..."), the save settings button ("Einstellungen speichern"), and the done button ("Erledigt") are all in German. This is an English-language repo — please localize these to English. The README references these German strings too (step 3, expected outcome, usage table, troubleshooting) so those will need updating at the same time.

  2. Missing tool audit link. Per CONTRIBUTING.md and the repo's review checks, integrations must link to the MCP Tool Audit & Optimization Guide in the README. See integrations/_template/README.md for the pattern — a one-liner at the bottom works fine.

  3. Deploy instructions won't work as written. The README says to cd supabase-function and run supabase functions deploy brain-api from there, but the Supabase CLI expects to run from the project root where the supabase/ directory lives. Users need to:

    • Create the function folder: supabase functions new brain-api
    • Copy index.ts and deno.json from this contribution into supabase/functions/brain-api/
    • Deploy from their project root

    The main setup guide (docs/01-getting-started.md, Step 6.6) shows this pattern — match that flow and it'll click for anyone who's already done the core setup.

Medium

  1. Shared logic with the MCP server. getEmbedding() and extractMetadata() are copy-pasted from server/index.ts. Not blocking for this PR, but worth thinking about extracting into a shared module down the road so changes to the embedding model or metadata prompt don't need to be updated in two places.

  2. CORS wildcard. Access-Control-Allow-Origin: * works but is wider than necessary. chrome-extension://* would be more precise. Minor point since the API key protects access regardless.

Everything else looks good — permissions, XSS handling, chrome.storage.sync for credentials, icon sizes, the omnibox integration, delete confirmation flow. Looking forward to the updated version.

Copy link
Copy Markdown
Collaborator

@justfinethanku justfinethanku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: Chrome Extension for Browser Capture & Search

What's Good

Strong contribution. This is a well-executed browser extension that adds genuine value to Open Brain:

  • Clean architecture: Chrome extension + Supabase Edge Function REST API backend
  • Proper security: API key authentication, no hardcoded credentials, environment variables correctly used
  • Complete feature set: save, search, context menu, omnibox, keyboard shortcuts, stats, task completion
  • Excellent documentation: README has all required sections (Prerequisites, Step-by-Step Setup, Expected Outcome, Troubleshooting)
  • Metadata validation: All required fields present and valid
  • Follows remote MCP pattern: Uses Supabase Edge Functions as intended
  • Binary size compliance: Icon files are small (largest is 1107 bytes)
  • No SQL safety issues: All queries use Supabase client methods, no raw SQL

Required Changes

Language consistency issue: The extension UI contains German strings instead of English. This needs to be fixed for consistency with the rest of the Open Brain ecosystem.

Examples from the code:

  • "Einstellungen speichern" → "Save Settings"
  • "Gedanke gespeichert!" → "Thought saved!"
  • "Im Brain speichern" → "Save to Brain"
  • "Im Brain suchen" → "Search in Brain"
  • "Erledigt" → "Done"
  • "Suche laeuft..." → "Searching..."

These appear in:

  • popup.js (UI messages and notifications)
  • background.js (context menu items)
  • The README references them in Expected Outcome section (which is correct for documentation, but the code should be English)

Action needed: Replace all German UI strings with English equivalents in the extension code.

Nice-to-Haves (Optional)

  1. Edge Function naming: The function is called brain-api in deployment commands but the folder is supabase-function/. Consider renaming the folder to supabase-function-brain-api/ for clarity, or updating the README to note that users can name it whatever they want.

  2. Metadata field example: The Edge Function extracts type metadata (observation, task, idea, reference, person_note) but the README doesn't show users how this categorization works or how they could use it. A brief mention in Features or Tech Stack would help.

  3. Error handling clarity: The troubleshooting section is good, but could benefit from one more common case: "What if the extension can't reach my Edge Function?" (firewall, wrong URL, project paused, etc.)

Compliance Checklist

✅ Folder structure correct (integrations/chrome-extension/)
✅ Required files present (README.md, metadata.json)
✅ metadata.json valid and complete
✅ No credentials, API keys, or secrets
✅ No SQL safety violations
✅ No binary blobs over 1MB
✅ PR title format correct: [integrations] Chrome extension for browser capture and search
✅ README has Prerequisites, Steps, Expected Outcome, Troubleshooting
✅ Remote MCP pattern (Edge Function, not local server)
❌ UI language should be English, not German

Verdict: Minor fixes needed

This is a high-quality contribution that's 95% ready to merge. The only blocking issue is the German language strings in the UI. Once those are translated to English, this is good to go.

Great work @konepone!

@matthallett1
Copy link
Copy Markdown
Collaborator

@claude review this PR

@github-actions
Copy link
Copy Markdown

Claude Code is working…

I'll analyze this and get back to you.

View job run

Copy link
Copy Markdown
Collaborator

@matthallett1 matthallett1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Review — Chrome Extension

Building on Nate's review (which covered architecture, security, feature completeness, and the German language issue):

Nate's review is thorough. The only blocking issue is the German UI strings, which he already flagged with specific examples. I don't have additional code issues to add.

Scope check

12 files including a companion Edge Function (brain-api). This is on the edge of scope for OB1, but the extension directly interacts with the thoughts table via the Edge Function, uses the same auth pattern (x-brain-key), and follows OB1 conventions. It's not growing into its own project. Scope is fine.

Overlapping Edge Function

The brain-api Edge Function in this PR overlaps with #45 (REST API gateway) and #129 (open-brain-rest). All three implement similar CRUD+search REST endpoints for thoughts. Worth consolidating when these PRs are being finalized, so we don't end up with 3 slightly different REST APIs in the repo.

Requesting changes only because of Nate's German language blocker, which is still outstanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants