Skip to content

niinlabs/ClawClip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ClawClip

A lightweight browser extension that captures the current tab's context and POSTs it to a configurable webhook endpoint.

Designed as a browser-to-automation ingress tool for AI workflows β€” connect to n8n, Zapier, Make, Slack, or any service that accepts an HTTP POST.

Firefox Chrome Edge License No dependencies


Features

Feature Detail
πŸ”— Multiple endpoints Add, edit, and delete named webhook endpoints with custom headers and tags
⚑ Two-click send Open popup β†’ pick endpoint β†’ Send
πŸ–±οΈ Context menu with submenus Right-click β†’ Send page or Send selection β†’ choose endpoint directly
πŸ“ Optional note Add freeform context before sending
πŸŒ™ Dark / light mode Toggle in the popup or options page; preference is remembered across restarts
πŸ“¦ Structured payload Consistent JSON format ready for downstream automation
🌐 Cross-browser Single shared codebase for Firefox, Chrome, and Edge

Payload format

Every send delivers a JSON object with this shape:

{
  "source":    "clawclip",
  "url":       "https://example.com/article",
  "title":     "Article Title",
  "selection": "Highlighted text, if any",
  "note":      "User's optional note",
  "timestamp": "2025-06-01T14:30:00.000Z",
  "endpoint":  "My Zapier Hook",
  "tags":      ["ai", "research"]
}

Installation

1 β€” Clone the repo

git clone https://github.com/shifteverywhere/ClawClip.git
cd ClawClip

Firefox

manifest.json is pre-configured for Firefox.

  1. Open about:debugging
  2. Click This Firefox β†’ Load Temporary Add-on…
  3. Select manifest.json from the cloned directory

Minimum version: Firefox 109 (Manifest V3 with background.scripts)

Temporary add-ons are removed on browser restart. For a persistent install, the extension must be signed by Mozilla or loaded in Firefox Developer Edition / Nightly with xpinstall.signatures.required = false in about:config.


Chrome / Edge

manifest.json is the Firefox version. Swap in the Chrome manifest before loading:

cp manifest.chrome.json manifest.json
  1. Navigate to chrome://extensions/ (or edge://extensions/)
  2. Enable Developer mode (top-right toggle)
  3. Click Load unpacked and select the project directory

Restore the Firefox manifest at any time: git checkout manifest.json


First-time setup

  1. Click the ClawClip toolbar icon
  2. Click Manage endpoints in the popup footer
  3. Click + Add Endpoint and fill in:
    • Name β€” a label you'll recognise
    • Webhook URL β€” must be HTTPS
    • Static Headers β€” optional JSON, e.g. {"Authorization": "Bearer token"}
    • Default Tags β€” optional comma-separated tags sent with every payload
  4. Click Save Endpoint

The first endpoint is automatically set as the default.


Usage

Popup

  1. Click the ClawClip icon in the toolbar
  2. Choose an endpoint from the dropdown (or keep the default)
  3. Add an optional note
  4. Click Send

The context preview bar shows the URL and any selected text that will be included in the payload.

Context menu

Right-click anywhere on a page to access the send submenus:

Send page to ClawClip  β–Ά  My Webhook
                           n8n Local
                           ─────────────────
                           Manage endpoints

Send selection to ClawClip  β–Ά  My Webhook     (appears when text is selected)
                               n8n Local
                               ─────────────────
                               Manage endpoints

A badge flashes βœ“ (green) on success or βœ— (red) on failure. The submenu rebuilds automatically whenever endpoints are added or removed.

Dark mode

Click the moon / sun icon in the upper-right corner of the popup or options page. The preference is saved to browser.storage.local and restored on every page load.


Permissions

Permission Reason
activeTab Read the current tab's URL and title
scripting Extract selected text via executeScript
storage Persist endpoint configuration and theme preference locally
contextMenus Register the right-click menu items
host_permissions *://*/* Send POST requests to arbitrary user-configured HTTPS webhook URLs. Required to bypass CORS restrictions for self-hosted servers that don't emit Access-Control-Allow-Origin headers.

Project structure

ClawClip/
β”œβ”€β”€ manifest.json            ← Firefox (background.scripts)
β”œβ”€β”€ manifest.chrome.json     ← Chrome / Edge (background.service_worker)
β”œβ”€β”€ icons/
β”‚   β”œβ”€β”€ original.png         ← source artwork
β”‚   β”œβ”€β”€ icon16.png
β”‚   β”œβ”€β”€ icon32.png
β”‚   β”œβ”€β”€ icon48.png
β”‚   └── icon128.png
└── src/
    β”œβ”€β”€ core/                ← shared by all entry points
    β”‚   β”œβ”€β”€ compat.js        browser vs chrome namespace normalisation
    β”‚   β”œβ”€β”€ storage.js       endpoint CRUD + default tracking
    β”‚   β”œβ”€β”€ validate.js      URL validation, header/tag parsing
    β”‚   β”œβ”€β”€ payload.js       JSON payload construction
    β”‚   β”œβ”€β”€ sender.js        fetch POST logic
    β”‚   └── theme.js         dark/light mode state + toggle helper
    β”œβ”€β”€ background/
    β”‚   β”œβ”€β”€ service-worker.js     Chrome/Edge β€” ES module service worker
    β”‚   β”œβ”€β”€ background.firefox.js Firefox β€” self-contained event page script
    β”‚   └── background.html       Firefox background page wrapper
    β”œβ”€β”€ popup/
    β”‚   β”œβ”€β”€ popup.html
    β”‚   β”œβ”€β”€ popup.css
    β”‚   └── popup.js
    └── options/
        β”œβ”€β”€ options.html
        β”œβ”€β”€ options.css
        └── options.js

All business logic lives in src/core/. Browser-specific differences are limited to the two background entry points and compat.js.


Cross-browser compatibility

What works identically everywhere

  • All WebExtensions APIs used: storage, contextMenus, scripting, tabs, action, runtime
  • ES module scripts in popup and options (<script type="module">)
  • browser.* / chrome.* namespace normalised by compat.js

Known differences

Area Firefox Chrome / Edge
Minimum version 109 MV3 (Chrome 88+)
Manifest manifest.json manifest.chrome.json β†’ rename to manifest.json
Background Persistent event page (background.firefox.js) ES module service worker (service-worker.js)
Background lifetime Always alive May terminate when idle; wakes on events
Namespace browser.* (native) chrome.* β€” normalised by compat.js

Safari (future)

Key considerations for a future Safari port:

  • Wrapper app required. Convert with xcrun safari-web-extension-converter . --app-name ClawClip and ship inside a native macOS/iOS app.
  • browser.* namespace is supported natively β€” compat.js already handles this.
  • scripting.executeScript requires Safari 16+.
  • Service workers require Safari 15.4+ (lifetime may differ).
  • No build step needed. The converter works directly with plain ES modules.
  • host_permissions *://*/* is allowed but may require App Store review justification; consider optional_host_permissions to reduce the surface.

Testing webhooks

Use a free temporary HTTPS endpoint to inspect payloads:

Both services send Access-Control-Allow-Origin: * headers, so no extra browser configuration is needed.


Contributing

Issues and pull requests are welcome.

  • Keep the no-build, no-dependency contract β€” plain JS/HTML/CSS only
  • New features that require browser-specific code should be isolated in the relevant background entry point, not in src/core/
  • Test against both Firefox and Chrome before opening a PR

License

MIT

About

Browser-to-automation ingress extension. Captures tab context and POSTs to webhook endpoints for AI workflows.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages