# wikidepia/rektcaptcha-extension architecture

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

- Interactive diagram: https://gitdiagram.com/wikidepia/rektcaptcha-extension
- Repository: https://github.com/wikidepia/rektcaptcha-extension

## Overview

rektCaptcha is a standalone browser extension that automatically opens and solves reCAPTCHA challenges using locally bundled ONNX models, without registration or login. Its workflow is: the page scripts detect visible reCAPTCHA frames, the content script reads settings and challenge images, runs model inference, selects tiles, and submits the response. The popup configures behavior, while the background script initializes defaults and relays frame-visibility state. Model and classification details are visible in the sampled solver excerpt; other subsystem links are omitted where source evidence is limited.

Main entry points: [`src/recaptcha.js`](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js) (reCAPTCHA solver), [`src/background.js`](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/background.js) (Background worker), [`src/recaptcha-visibility.js`](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha-visibility.js) (Frame visibility), [`src/utils.js`](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/utils.js) (Shared utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_settings["Settings and Setup"]
  node_popup["Settings popup<br/>[popup.js]"]
  node_setup["Permission setup<br/>[setup.js]"]
end

subgraph group_coordination["Extension Coordination"]
  node_background["Background worker<br/>[background.js]"]
  node_visibility["Frame visibility"]
  node_utils["Shared utilities<br/>[utils.js]"]
end

subgraph group_solving["Challenge Solving"]
  node_solver["reCAPTCHA solver<br/>[recaptcha.js]"]
  node_imageprep["Image preparation<br/>[recaptcha.js]"]
  node_inference["ONNX inference<br/>[recaptcha.js]"]
  node_tileactions["Tile selection<br/>[recaptcha.js]"]
end

subgraph group_assets["Local Models"]
  node_models["ONNX model files"]
end

node_user(("Extension user"))
node_webpage(("reCAPTCHA page"))
node_browser["Browser APIs"]
node_onnxruntime["ONNX Runtime"]

node_user -->|"changes settings"| node_popup
node_popup -->|"stores settings"| node_browser
node_user -->|"requests access"| node_setup
node_setup -->|"requests permissions"| node_browser
node_background -->|"initializes settings"| node_browser
node_background -.->|"opens setup page"| node_browser
node_visibility -->|"checks frames"| node_webpage
node_visibility -->|"sets visibility state"| node_utils
node_utils -->|"sends state messages"| node_background
node_background -->|"returns state"| node_visibility
node_solver -->|"reads challenge"| node_webpage
node_solver -->|"reads settings"| node_browser
node_solver -->|"uses click and timing helpers"| node_utils
node_solver -->|"prepares challenge images"| node_imageprep
node_imageprep -->|"provides image tensors"| node_inference
node_inference -->|"loads local models"| node_models
node_inference -->|"runs models"| node_onnxruntime
node_solver -->|"selects challenge tiles"| node_tileactions
node_tileactions -->|"clicks and submits"| node_webpage

click node_popup "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/popup.js"
click node_setup "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/setup.js"
click node_background "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/background.js"
click node_visibility "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha-visibility.js"
click node_utils "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/utils.js"
click node_solver "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js"
click node_imageprep "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js"
click node_inference "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js"
click node_tileactions "https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js"
click node_models "https://github.com/wikidepia/rektcaptcha-extension/tree/main/public/models"

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_popup,node_setup,node_user,node_browser toneBlue
class node_background,node_visibility,node_utils toneAmber
class node_solver,node_imageprep,node_inference,node_tileactions toneMint
class node_models toneRose
class node_webpage,node_onnxruntime toneIndigo
```

## Components

### Settings and Setup

- [Settings popup](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/popup.js): `src/popup.js`
- [Permission setup](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/setup.js): `src/setup.js`

### Extension Coordination

- [Background worker](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/background.js): `src/background.js`
- [Frame visibility](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha-visibility.js): `src/recaptcha-visibility.js`
- [Shared utilities](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/utils.js): `src/utils.js`

### Challenge Solving

- [reCAPTCHA solver](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js): `src/recaptcha.js`
- [Image preparation](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js): `src/recaptcha.js`
- [ONNX inference](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js): `src/recaptcha.js`
- [Tile selection](https://github.com/wikidepia/rektcaptcha-extension/blob/main/src/recaptcha.js): `src/recaptcha.js`

### Local Models

- [ONNX model files](https://github.com/wikidepia/rektcaptcha-extension/tree/main/public/models): `public/models`

### Other components

- **Extension user**
- **reCAPTCHA page**
- **Browser APIs**
- **ONNX Runtime**

## Connections

- Extension user → Settings popup: changes settings
- Settings popup → Browser APIs: stores settings
- Extension user → Permission setup: requests access
- Permission setup → Browser APIs: requests permissions
- Background worker → Browser APIs: initializes settings
- Background worker → Browser APIs: opens setup page
- Frame visibility → reCAPTCHA page: checks frames
- Frame visibility → Shared utilities: sets visibility state
- Shared utilities → Background worker: sends state messages
- Background worker → Frame visibility: returns state
- reCAPTCHA solver → reCAPTCHA page: reads challenge
- reCAPTCHA solver → Browser APIs: reads settings
- reCAPTCHA solver → Shared utilities: uses click and timing helpers
- reCAPTCHA solver → Image preparation: prepares challenge images
- Image preparation → ONNX inference: provides image tensors
- ONNX inference → ONNX model files: loads local models
- ONNX inference → ONNX Runtime: runs models
- reCAPTCHA solver → Tile selection: selects challenge tiles
- Tile selection → reCAPTCHA page: clicks and submits
