# micodell/factorfake-chrome-extension architecture

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

- Interactive diagram: https://gitdiagram.com/micodell/factorfake-chrome-extension
- Repository: https://github.com/micodell/factorfake-chrome-extension

## Overview

This small browser extension lets a user request a fact check for the active page. Its script routes YouTube links, other supported video links, and ordinary webpages to different API endpoints; webpage text is extracted in-page first. The returned percentages and analysis are shown in the extension UI. The sampled source establishes the browser-action injection and request flow; the backend internals and HTML/manifest details are not available here.

Main entry points: [`script.js`](https://github.com/micodell/factorfake-chrome-extension/blob/master/script.js) (Fact-check script), [`index.html`](https://github.com/micodell/factorfake-chrome-extension/blob/master/index.html) (Extension UI), [`background.js`](https://github.com/micodell/factorfake-chrome-extension/blob/master/background.js) (Action handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_background["Action handler<br/>[background.js]"]
node_script["Fact-check script<br/>[script.js]"]
node_ui["Extension UI<br/>[index.html]"]
node_scraper["Page text scraper<br/>[script.js]"]
node_youtube_api["YouTube check endpoint"]
node_video_api["Video check endpoint"]
node_text_api["Text check endpoint"]

node_user -->|"clicks browser action"| node_background
node_background -->|"injects script"| node_script
node_user -->|"clicks check"| node_ui
node_ui -->|"triggers handler"| node_script
node_script -->|"injects scraper"| node_scraper
node_scraper -->|"returns page text"| node_script
node_script -->|"POST video ID"| node_youtube_api
node_script -->|"POST video URL"| node_video_api
node_script -->|"POST page text"| node_text_api
node_youtube_api -->|"returns analysis"| node_script
node_video_api -->|"returns analysis"| node_script
node_text_api -->|"returns analysis"| node_script
node_script -->|"displays results"| node_ui

click node_background "https://github.com/micodell/factorfake-chrome-extension/blob/master/background.js"
click node_script "https://github.com/micodell/factorfake-chrome-extension/blob/master/script.js"
click node_ui "https://github.com/micodell/factorfake-chrome-extension/blob/master/index.html"
click node_scraper "https://github.com/micodell/factorfake-chrome-extension/blob/master/script.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_user,node_ui toneBlue
class node_background toneMint
class node_script,node_scraper toneTeal
class node_youtube_api,node_video_api,node_text_api toneIndigo
```

## Components

### Other components

- **User**
- [Action handler](https://github.com/micodell/factorfake-chrome-extension/blob/master/background.js): `background.js`
- [Fact-check script](https://github.com/micodell/factorfake-chrome-extension/blob/master/script.js): `script.js`
- [Extension UI](https://github.com/micodell/factorfake-chrome-extension/blob/master/index.html): `index.html`
- [Page text scraper](https://github.com/micodell/factorfake-chrome-extension/blob/master/script.js): `script.js`
- **YouTube check endpoint**
- **Video check endpoint**
- **Text check endpoint**

## Connections

- User → Action handler: clicks browser action
- Action handler → Fact-check script: injects script
- User → Extension UI: clicks check
- Extension UI → Fact-check script: triggers handler
- Fact-check script → Page text scraper: injects scraper
- Page text scraper → Fact-check script: returns page text
- Fact-check script → YouTube check endpoint: POST video ID
- Fact-check script → Video check endpoint: POST video URL
- Fact-check script → Text check endpoint: POST page text
- YouTube check endpoint → Fact-check script: returns analysis
- Video check endpoint → Fact-check script: returns analysis
- Text check endpoint → Fact-check script: returns analysis
- Fact-check script → Extension UI: displays results
