Skip to content

CFGPeter/local-proofreader

Repository files navigation

Local Proofreader

A free, fully-offline Chrome extension that gives you Grammarly-style inline grammar and spelling suggestions in any text field on the web. It runs entirely on your machine using Chrome's built-in Gemini Nano model via the experimental Proofreader API. No accounts, no API keys, no data sent anywhere.

Why

  • Free forever. Uses an LLM that ships with Chrome itself. No subscriptions, no usage limits.
  • Private. Text never leaves your computer. The model runs locally.
  • Works everywhere. Any contenteditable, textarea, or text input on any site — Gmail, Reddit, Slack, GitHub, you name it.
  • Lightweight. ~14 KB of extension code. The model is downloaded once by Chrome and shared with all extensions that use it.

Features

  • Inline red wavy underlines under misspelled or grammatically incorrect words.
  • Hover an underline to see the suggestion plus Apply / Ignore.
  • Fix all button when there are multiple corrections.
  • Persistent ignore — Ignore a word once and it won't get flagged again on the same site.
  • Pulsing dot near the active field while the model is checking.
  • Long fields are split by paragraph and checked piece by piece.
  • Works in modern rich-text editors (Lexical, Draft.js, ProseMirror) in addition to plain <textarea> and <input> fields.
  • Dark-mode aware.
  • Toggle on/off globally or per-site from the toolbar popup.

Screenshots

Drop PNGs into screenshots/ and reference them here, e.g.:

![Inline underline](screenshots/marker.png)
![Hover popup](screenshots/popup.png)

Requirements

  • Google Chrome 141 or newer.
  • About 3 GB of free disk space (one-time model download).
  • A reasonably modern desktop or laptop.

Installation

1. Enable Chrome's built-in AI APIs (one-time)

Open these URLs in Chrome and set each flag as shown, then click Relaunch at the bottom of the page.

Flag Setting
chrome://flags/#proofreader-api-for-gemini-nano Enabled
chrome://flags/#optimization-guide-on-device-model Enabled BypassPerfRequirement

2. Download the on-device model

Open chrome://components, find Optimization Guide On Device Model, and click Check for update. Wait until the version changes from 0.0.0.0 to a real version (~2 GB download).

3. Install the extension

  1. Download the latest release (or git clone this repo).
  2. Open chrome://extensions.
  3. Toggle Developer mode ON in the top-right corner.
  4. Click Load unpacked and select the local-proofreader folder.
  5. Pin the extension from the puzzle-piece menu so it shows in your toolbar.

Usage

Type in any text field. After a brief pause, words with grammar or spelling issues get a red wavy underline. Click the underline to see the suggestion and apply or ignore it. Click the toolbar icon to toggle the extension globally or for the current site only.

How it works

  • A content script in Chrome's MAIN world has direct access to the Proofreader global (the experimental on-device API).
  • A second content script in the ISOLATED world reads the user's preferences from chrome.storage.sync and forwards them to the MAIN-world script via window.postMessage (since chrome.* APIs aren't available in MAIN).
  • On input, the MAIN-world script debounces ~700 ms, calls Proofreader.proofread(text), and renders absolute-positioned underlines over the field using:
    • Range.getClientRects() for contenteditable elements
    • A hidden mirror <div> with synced styles for <textarea> and <input> elements
  • Clicking an underline opens a small popup near the word.
  • Apply uses document.execCommand('insertText') against a Selection set to the misspelled range — this is the only reliable way to mutate text inside framework-managed editors like Lexical (the editor Reddit and Facebook use).

Limitations

  • English only. The Proofreader API in current Chrome only supports English. Polish and other languages are planned upstream.
  • Some custom editors won't work. Anything that mounts text outside the DOM (e.g. canvas-based editors like Google Docs) is out of reach for now.
  • First check is slow. The model spins up on first use of the session. Subsequent checks are fast (typically <300 ms).
  • Origin-trial API. The Proofreader API is still experimental in Chrome. Behavior may change between Chrome versions.

Roadmap

  • Tone and clarity rewrites via the Rewriter API.
  • Per-user "ignore word" dictionary.
  • Long-document chunking so the whole field isn't re-checked on every keystroke.
  • Optional Ollama backend for languages Gemini Nano doesn't support.
  • Chrome Web Store distribution.

Development

git clone https://github.com/CFGPeter/local-proofreader
cd local-proofreader
# Edit files in place. To regenerate icons after changing make_icons.py:
python3 icons/make_icons.py

Then in Chrome: chrome://extensions → reload the extension card.

Contributing

Issues and PRs welcome. Please keep changes focused and avoid adding dependencies — the extension intentionally has zero npm packages.

License

MIT. See LICENSE.