Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Second Brain

Browser Extension

Capture any page or highlighted text to your Second Brain with one click or a keyboard shortcut, without leaving the tab.


Requirements

This extension requires a deployed Second Brain Cloudflare Worker. If you haven't set that up yet, start there first:

github.com/rahilp/second-brain-cloudflare

The Worker is free to deploy (Cloudflare free tier), takes about 2 minutes via the one-click deploy button, and gives you a Worker URL + auth token you'll need to connect the extension.


What it does

  • Capture the current page — saves the title and URL to your second brain
  • Capture highlighted text — select any text on a page before clicking capture; the excerpt is saved alongside the title and URL
  • Add a note — type context or #hashtags in the popup before saving; hashtags are automatically extracted as tags
  • Quick capture — keyboard shortcut saves the page instantly without opening any popup, with a toast confirmation

Installation

No app store required. The extension is built with WXT, which produces builds for Chrome (Manifest V3) and Firefox (Manifest V2) from the same codebase.

Build it once from source (requires Node.js 20+):

git clone https://github.com/rahilp/second-brain-browser-extension.git
cd second-brain-browser-extension
pnpm install          # or: npm install
pnpm build            # Chrome/Brave/Edge → .output/chrome-mv3
pnpm build:firefox    # Firefox           → .output/firefox-mv2

Chrome / Brave

  1. Go to chrome://extensions
  2. Enable Developer mode (toggle in the top-right corner)
  3. Click Load unpacked and select the .output/chrome-mv3 folder
  4. The Second Brain icon appears in your toolbar — pin it for easy access

Microsoft Edge

Same steps, but go to edge://extensions in step 2 and enable Developer mode from the left sidebar.

Firefox

  1. Go to about:debugging#/runtime/this-firefox
  2. Click Load Temporary Add-on…
  3. Select .output/firefox-mv2/manifest.json

Temporary add-ons are removed when Firefox restarts. For a permanent install, run pnpm zip:firefox and either sign the zip via addons.mozilla.org or install it as-is in Firefox Developer Edition / ESR (with xpinstall.signatures.required set to false in about:config).

Development

pnpm dev              # live-reloading dev build in Chrome
pnpm dev:firefox      # live-reloading dev build in Firefox

Staying up to date

When a new version is released, pull the latest changes and rebuild:

git pull
pnpm install && pnpm build   # or build:firefox

Then go to chrome://extensions and click the reload icon on the Second Brain card (Firefox temporary add-ons: click Reload in about:debugging).


Setup

On first install, the extension opens a setup page automatically.

  1. Enter your Worker URL (e.g. https://your-worker.workers.dev)
  2. Enter your Auth Token (the AUTH_TOKEN secret you set when deploying)
  3. Click Connect — the extension verifies the connection and saves your credentials

To update your settings later, click the gear icon in the popup.


Usage

Popup

Click the Second Brain icon in your toolbar (or press Alt+Shift+B).

Element What it does
Page info Shows the title and URL that will be captured
Selection badge Appears when text is highlighted — the excerpt will be included
Note field Optional context to save with the capture. Use #hashtags to tag
Capture button Sends to your Second Brain

Keyboard shortcuts

Shortcut Action
Alt+Shift+B (Mac: ⌥ Shift B) Open the popup
Alt+Shift+S (Mac: ⌥ Shift S) Quick capture — saves instantly, no popup

Quick capture shows a toast notification in the top-right corner of the page confirming the result. You can customise both shortcuts at chrome://extensions/shortcuts (Firefox: about:addons → gear icon → Manage Extension Shortcuts).

Capture results

Result Meaning
Captured Saved successfully
Already in your brain Near-duplicate detected — not saved again
Merged / Updated Similar existing memory was updated instead

How content is stored

The extension builds the content string sent to /capture:

Page title
https://page-url.com

Highlighted: "selected text if any"

Your note with #hashtags

Hashtags in the note are extracted as tags by the Worker. The source field is set to "extension" so you can filter by it in your second brain.


Permissions

Permission Why
activeTab Read the current tab's title and URL
scripting Get selected text from the page; inject toast notifications
storage Save your Worker URL and auth token locally
host_permissions: <all_urls> Make requests to your self-hosted Worker URL (which can be any domain)

Credentials are stored in storage.sync — they never leave your browser except in requests to your own Worker.


File structure

wxt.config.ts             — WXT config: manifest, permissions, per-browser tweaks
entrypoints/
  background.js           — Background: handles quick-capture command + toast injection
  popup/                  — Capture popup UI (index.html, main.js, style.css)
  setup/                  — First-run setup and settings page
public/
  icon/                   — Extension icons (16/48/128)
  icons/                  — Brand SVGs used inside the UI pages (lockup + mark)
icons/
  sb-mark-square.svg      — Source for the extension icons (see icons/README.md)
.output/                  — Built extensions (chrome-mv3, firefox-mv2) — generated

Related


License

MIT

About

No description, website, or topics provided.

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages