# AI Writing Highlighter

AI Writing Highlighter is a Chrome extension that highlights writing patterns commonly associated with AI-generated text. Its guide updates daily from human-maintained Wikipedia signals.

It highlights Wikipedia-sourced AI-writing signals without using a model. It does not send page text anywhere. It is a local pattern matcher powered by the public Wikipedia page [Signs of AI writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing).

The important idea is simple: Wikipedia editors are already doing the hard work of noticing repeatable AI-writing habits in the wild. Human editors maintain the source in public, not chatbots.

This extension turns that living editorial work into a local browser tool that stays current without sending page text anywhere.

## What This Is

AI Writing Highlighter scans article-like text and social feed posts, then flags passages that match Wikipedia-sourced signs of AI writing.

The extension refreshes its guide once per day. You install it once; the pattern list keeps following Wikipedia's human-edited source.

It looks for locally visible signs from the guide, including:

- Overpolished promotional language
- Stock transition words
- Vague attribution
- Editorial filler
- Formulaic caveats
- Repeated structural patterns
- Markdown and chatbot citation artifacts
- List, heading, punctuation, and formatting patterns when present in the guide
- Phrases called out by Wikipedia editors

When it finds a match, it underlines exact text when the browser supports layout-safe highlights and lightly tints the paragraph. The popup shows a page score from `0` to `100`, match count, paragraph count, guide update time, tell count, and most common category names.

Higher score means more Wikipedia-sourced guide patterns matched. It is not an authorship verdict.

## Why It Exists

AI writing is not always wrong, bad, or deceptive. The problem is undisclosed machine-written filler spreading into places where readers expect human judgment.

Wikipedia editors have been tracking this problem publicly. Their guide is practical because it is based on editing real pages, not guessing from a lab benchmark.

This extension makes that guide visible while browsing. It helps you spot patterns, not pass judgment.

## How Matching Works

Matching is pattern-based, not model-based.

1. The content script finds article-like text using Mozilla Readability.
2. On social feeds and dynamic pages, it scans visible post/comment text blocks directly because they are not articles.
3. It compares paragraph text against phrase and regex patterns from the guide.
4. Match patterns come only from the guide; local code may skip or downweight broad guide entries so weak signals do not overstate the result.
5. It scores each paragraph by match density and guide-provided pattern weight.
6. It combines paragraph scores into one page score.
7. It shows the strongest categories and Wikipedia revision metadata in the popup.

There are no LLM calls. There is no account system. There is no server-side analysis.

## Why Wikipedia Matters

The extension gets its pattern guide from Wikipedia's [Signs of AI writing](https://en.wikipedia.org/wiki/Wikipedia:Signs_of_AI_writing) page.

That source matters because it is maintained by human editors watching real-world writing patterns change. As new AI cliches appear, editors can add them. As weak signals become noisy, editors can revise them.

The extension fetches a small JSON version of that guide once per day from:

`https://aiwritingguide.misterburton.com/api/guide.json`

That JSON is data only. It is not remote code.

The extension rejects guide payloads that do not declare Wikipedia's Signs of AI writing page as their source.

## Privacy

The extension runs locally in your browser.

It does not collect:

- Page text
- URLs visited
- Matches found
- Clicks
- Analytics
- Telemetry
- Personal identifiers

The only network request is the guide update request. Page text never leaves your device.

See [`PRIVACY.md`](./PRIVACY.md) for the full policy.

## Permissions

The extension uses the smallest permission set needed:

- `storage`: cache the guide and save the on/off setting
- `alarms`: refresh the guide once per day
- `activeTab`: communicate with the active tab when the popup opens
- `https://aiwritingguide.misterburton.com/*`: fetch the public guide JSON

The content script runs on webpages so it can scan visible article text locally.

## Daily Guide Updates

Daily updates are core to the extension. AI-writing tells change quickly, and Wikipedia's human editors revise the source page as those tells change.

On install, the background service worker fetches the latest guide.

After that, `chrome.alarms` schedules one refresh every 24 hours. The extension uses `ETag` and `If-Modified-Since` headers, so unchanged guides can return `304 Not Modified`.

The guide is cached in `chrome.storage.local`. If the network request fails, the cached guide still works. A small bundled fallback guide is included so the extension can run before the first successful fetch.

## Highlighting Approach

Inline evidence uses the CSS Custom Highlight API.

The extension does not inject `<mark>` elements into page text. It does not rewrite article content. It does not mutate list items. Paragraph tinting is done with CSS classes that avoid margin, padding, positioning, and layout changes.

This keeps the page readable and reduces the chance of breaking site layout.

## Limitations

AI Writing Highlighter highlights Wikipedia-sourced AI-writing signals. It does not prove authorship.

It can miss AI-written text that avoids known patterns. It can flag human-written text that happens to use common AI-like phrasing. Scores depend on page structure, available article text, and current guide quality.

Use it as a reading aid. Do not use it as proof.

## Install Locally

1. Clone or download this repo.
2. Open `chrome://extensions`.
3. Enable `Developer mode`.
4. Click `Load unpacked`.
5. Select the `extension/` folder.
6. Pin `AI Writing Highlighter`.
7. Open an article page and click the extension icon.

There is no build step.

## Test Pages

These pages should usually score high:

- `https://misterburton.com/markdown-mirror/`
- `https://misterburton.com/design-system`

Normal reference or human-written pages should usually score lower, though some technical or encyclopedic pages may still contain overlapping patterns.

## Repo Layout

```text
README.md
PRIVACY.md
extension/
├── manifest.json
├── data/
│   └── fallback-guide.json
├── icons/
│   ├── icon.svg
│   └── icon-16.png / icon-48.png / icon-128.png
└── src/
    ├── background/
    │   └── service-worker.js
    ├── content/
    │   ├── analyzer.js
    │   ├── content.js
    │   ├── highlighter.js
    │   └── styles.css
    ├── fonts/
    ├── lib/
    │   └── readability.js
    ├── popup/
    │   ├── popup.css
    │   ├── popup.html
    │   └── popup.js
    └── shared/
        └── constants.js
```

## Technical Notes

- Manifest V3 Chrome extension
- Plain JavaScript
- No bundler
- No build tooling
- No remote JavaScript
- No telemetry
- No LLM calls
- No accounts
- Local-only page analysis
- Daily guide refresh

## License

Code: MIT. Bundled `Readability.js` is (c) Mozilla, Apache 2.0. Bundled IBM Plex fonts are (c) IBM, SIL Open Font License 1.1.
