# mumer119131/simple-captcha-solver-extension architecture

> Architecture diagram of the GitHub repository mumer119131/simple-captcha-solver-extension, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mumer119131/simple-captcha-solver-extension
- Repository: https://github.com/mumer119131/simple-captcha-solver-extension

## Overview

Simple Captcha Solver is a Chrome extension that selects a captcha from a page, recognizes it locally, and helps the user copy or enter the result. The main workflow runs from toolbar activation through the content-script picker, screenshot capture, offscreen image preparation and OCR, then returns text to the result UI for editing, copying, or field insertion. Options configure recognition and entry behavior through shared settings. The README documents the broader OCR cleanup and voting capabilities; excerpts show the host but not every processing stage. Relationship edges are limited to calls or data paths visible in excerpts or README.

Main entry points: [`content/overlay.js`](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/content/overlay.js) (Page picker and result), [`background.js`](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/background.js) (Service worker), [`offscreen.js`](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/offscreen.js) (Image prep and OCR), [`lib/settings.js`](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/lib/settings.js) (Shared settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_page["Page interaction"]
  node_overlay["Page picker and result<br/>[overlay.js]"]
end

subgraph group_runtime["Extension runtime"]
  node_background["Service worker<br/>[background.js]"]
end

subgraph group_recognition["Local recognition"]
  node_offscreen["Image prep and OCR<br/>[offscreen.js]"]
  node_tesseract["Tesseract engine"]
end

subgraph group_configuration["Configuration"]
  node_settings["Shared settings<br/>[settings.js]"]
  node_options["Options UI<br/>[options.js]"]
end

node_user(("User"))
node_toolbar(("Toolbar action"))
node_page_fields["Page fields"]
node_clipboard["Clipboard"]

node_toolbar -->|"activates"| node_background
node_background -->|"injects"| node_overlay
node_user -->|"selects crop"| node_overlay
node_overlay -->|"requests capture"| node_background
node_background -->|"sends OCR job"| node_offscreen
node_offscreen -->|"recognizes text"| node_tesseract
node_offscreen -.->|"returns result"| node_background
node_background -->|"returns result"| node_overlay
node_overlay -->|"copies text"| node_clipboard
node_overlay -->|"fills field"| node_page_fields
node_user -->|"configures"| node_options
node_options -->|"saves settings"| node_settings
node_background -->|"loads settings"| node_settings
node_overlay -.->|"reads settings"| node_settings

click node_overlay "https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/content/overlay.js"
click node_background "https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/background.js"
click node_settings "https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/lib/settings.js"
click node_options "https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/options.js"
click node_offscreen "https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/offscreen.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_overlay,node_user toneBlue
class node_background toneAmber
class node_offscreen,node_tesseract toneMint
class node_settings,node_options toneRose
class node_toolbar,node_page_fields,node_clipboard toneIndigo
```

## Components

### Page interaction

- [Page picker and result](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/content/overlay.js): `content/overlay.js`

### Extension runtime

- [Service worker](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/background.js): `background.js`

### Local recognition

- [Image prep and OCR](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/offscreen.js): `offscreen.js`
- **Tesseract engine**

### Configuration

- [Shared settings](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/lib/settings.js): `lib/settings.js`
- [Options UI](https://github.com/mumer119131/simple-captcha-solver-extension/blob/main/options.js): `options.js`

### Other components

- **User**
- **Toolbar action**
- **Page fields**
- **Clipboard**

## Connections

- Toolbar action → Service worker: activates (evidence: `background.js`)
- Service worker → Page picker and result: injects (evidence: `background.js`)
- User → Page picker and result: selects crop (evidence: `README.md`)
- Page picker and result → Service worker: requests capture (evidence: `content/overlay.js`)
- Service worker → Image prep and OCR: sends OCR job (evidence: `background.js`)
- Image prep and OCR → Tesseract engine: recognizes text (evidence: `offscreen.js`)
- Image prep and OCR → Service worker: returns result
- Service worker → Page picker and result: returns result (evidence: `content/overlay.js`)
- Page picker and result → Clipboard: copies text (evidence: `README.md`)
- Page picker and result → Page fields: fills field (evidence: `README.md`)
- User → Options UI: configures (evidence: `README.md`)
- Options UI → Shared settings: saves settings (evidence: `options.js`)
- Service worker → Shared settings: loads settings (evidence: `background.js`)
- Page picker and result → Shared settings: reads settings
