A demo browser extension for Lasso that watches ChatGPT requests for email addresses and lets you protect them before they are sent.
- Runs on
https://chatgpt.com/*and intercepts conversation POST requests. - Scans outgoing request bodies for email addresses.
- Shows a modal with detected emails and decision controls.
- "Protect Email" replaces detected addresses with
[EMAIL_ADDRESS]. - "Dismiss" hides an email for 24 hours and persists across sessions.
- Stores decision history and dismissed emails in extension storage.
src/extension/interceptor.tsinjects into the page and overridesfetch.src/extension/content.tsrenders the UI and bridges messages.src/extension/service-worker.tsperforms scanning and persistence.- Messages flow via window
postMessageand runtime messaging.
sequenceDiagram
participant Page as ChatGPT Page
participant Interceptor as Interceptor (page)
participant WindowBus as Window Messaging
participant Content as Content Script
participant Runtime as Runtime Messaging
participant Worker as Service Worker
participant UI as Protect Dialog
Page->>Interceptor: fetch(POST /conversation)
Interceptor->>WindowBus: EMAIL_SCAN_REQUEST
WindowBus->>Content: EMAIL_SCAN_REQUEST
Content->>Runtime: SCAN_EMAIL
Runtime->>Worker: SCAN_EMAIL
Worker-->>Runtime: emails + sanitizedBody
Runtime-->>Content: scan result
Content-->>WindowBus: EMAIL_SCAN_RESULT
WindowBus-->>Interceptor: EMAIL_SCAN_RESULT
alt no emails found
Interceptor->>Page: allow original fetch
else emails found
Interceptor->>WindowBus: REQUEST_DECISION
WindowBus->>Content: REQUEST_DECISION
Content->>UI: render dialog
UI-->>Content: Protect or Send Anyway
Content->>Runtime: DECISION_RESULT
Runtime->>Worker: DECISION_RESULT (persist history)
Content-->>WindowBus: DECISION_RESULT
WindowBus-->>Interceptor: DECISION_RESULT
alt protect
Interceptor->>WindowBus: EMAIL_SCAN_REQUEST (re-scan)
WindowBus->>Content: EMAIL_SCAN_REQUEST
Content->>Runtime: SCAN_EMAIL
Runtime->>Worker: SCAN_EMAIL
Worker-->>Runtime: sanitizedBody
Runtime-->>Content: scan result
Content-->>WindowBus: EMAIL_SCAN_RESULT
WindowBus-->>Interceptor: EMAIL_SCAN_RESULT
Interceptor->>Page: fetch with sanitizedBody
else send anyway
Interceptor->>Page: allow original fetch
end
end
Notes:
- Dismissed emails are stored for 24 hours and excluded from scans.
- Decision history is capped at 200 entries.
Requirements: Node.js and npm.
Install dependencies:
npm installStart a dev build:
npm run devFor Firefox:
npm run dev:firefoxLoad the extension:
- Chrome:
chrome://extensions-> Developer mode -> Load unpacked ->dist/chrome - Firefox:
about:debugging#/runtime/this-firefox-> Load Temporary Add-on ->dist/firefox/manifest.json
npm run buildPer-browser builds:
npm run build:chrome
npm run build:firefoxArtifacts:
dist/chromeanddist/firefoxcontain unpacked builds.release/contains zipped bundles likechrome-lasso-ext-1.0.0.zip.
src/extension/content script, interceptor, and service worker.src/components/UI for the protection dialog.src/lib/messaging, storage, and domain services.src/types/shared message types.
BROWSER=chrome|firefoxselects the target in scripts.src/manifest.chrome.tsandsrc/manifest.firefox.tsdefine permissions and matches.