# mrcasiopea/g-raw-converter-extension architecture

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

- Interactive diagram: https://gitdiagram.com/mrcasiopea/g-raw-converter-extension
- Repository: https://github.com/mrcasiopea/g-raw-converter-extension

## Overview

GitHub Raw Link Copier is a small browser extension: the user clicks its toolbar icon on a GitHub file page, the background listener checks and converts the tab URL, then injects code to copy the raw URL and show a localized confirmation toast. Unsupported URLs show an error toast instead. The implementation is concentrated in background.js; the README documents supported formats and permissions, while the source excerpt shows the runtime calls.

Main entry points: [`background.js`](https://github.com/mrcasiopea/g-raw-converter-extension/blob/main/background.js) (Toolbar Click Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_user(("User"))
node_click_handler["Toolbar Click Handler<br/>[background.js]"]
node_url_converter["URL Detection and Conversion<br/>[background.js]"]
node_page_script["Copy and Toast Script<br/>[background.js]"]
node_clipboard["Browser Clipboard"]
node_page_dom["GitHub Page DOM"]

node_user -->|"clicks icon"| node_click_handler
node_click_handler -->|"checks URL"| node_url_converter
node_click_handler -->|"injects script"| node_page_script
node_page_script -->|"copies text"| node_clipboard
node_page_script -->|"renders toast"| node_page_dom

click node_click_handler "https://github.com/mrcasiopea/g-raw-converter-extension/blob/main/background.js"
click node_url_converter "https://github.com/mrcasiopea/g-raw-converter-extension/blob/main/background.js"
click node_page_script "https://github.com/mrcasiopea/g-raw-converter-extension/blob/main/background.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_clipboard toneBlue
class node_click_handler toneMint
class node_url_converter,node_page_script toneTeal
class node_page_dom toneIndigo
```

## Components

### Other components

- **User**
- [Toolbar Click Handler](https://github.com/mrcasiopea/g-raw-converter-extension/blob/main/background.js): `background.js`
- [URL Detection and Conversion](https://github.com/mrcasiopea/g-raw-converter-extension/blob/main/background.js): `background.js`
- [Copy and Toast Script](https://github.com/mrcasiopea/g-raw-converter-extension/blob/main/background.js): `background.js`
- **Browser Clipboard**
- **GitHub Page DOM**

## Connections

- User → Toolbar Click Handler: clicks icon (evidence: `README.md`)
- Toolbar Click Handler → URL Detection and Conversion: checks URL (evidence: `background.js`)
- Toolbar Click Handler → Copy and Toast Script: injects script (evidence: `background.js`)
- Copy and Toast Script → Browser Clipboard: copies text (evidence: `background.js`)
- Copy and Toast Script → GitHub Page DOM: renders toast (evidence: `background.js`)
