A Chrome extension that checks whether images and text on a web page were likely generated by AI.
Image detection is handled by the Sightengine genai model. Text detection runs a local heuristic algorithm, no external API required.
npm install
npm run build # production build
npm run watch # dev mode, rebuilds on saveThen load the extension in Chrome:
- Go to
chrome://extensions - Turn on Developer mode (top-right)
- Click Load unpacked and select the
dist/folder
After loading the extension, click its icon and open Settings from the popup footer. Enter your Sightengine API User and API Secret, then save.
Keys are stored in chrome.storage.sync and only the extension can read them.
Note: Storing API secrets in a browser extension is fine for local development but not suitable for production. In production you should route requests through a backend proxy that holds the credentials server-side.
- Set up a backend proxy (Node server, Cloudflare Worker, Lambda, etc.) that attaches the Sightengine credentials and forwards requests.
- Update
src/config.tsto point at your proxy URL and remove the client-side credential logic fromimageDetector.ts. - Add authentication so the proxy only serves requests from your extension.
popup (UI)
| chrome.runtime messages
background (service worker) <-> Sightengine API / text detector
| chrome.tabs messages
content script (DOM access, highlighting)
| Module | What it does |
|---|---|
| popup/ | Extension popup UI. Triggers scans and displays results. |
| background.ts | Service worker. Coordinates detection and relays messages. |
| content.ts | Injected into pages. Collects content and highlights flagged elements. |
| services/imageDetector.ts | Calls the Sightengine API for image analysis. |
| services/textDetector.ts | TextDetector interface, contract for text detection providers. |
| services/heuristicTextDetector.ts | Built-in heuristic detector using sentence-level statistical signals. |
| config.ts | API credential helpers and endpoint URL. |
| utils/score.ts | Maps raw scores to labels and formats them for display. |
| utils/dom.ts | DOM traversal, text collection, and highlight injection. |
- Create a new file under
src/services/that implements theTextDetectorinterface. - Import it in
src/background.tsinstead ofHeuristicTextDetector.
MIT

