# anixi9/suomi-clipboard architecture

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

- Interactive diagram: https://gitdiagram.com/anixi9/suomi-clipboard
- Repository: https://github.com/anixi9/suomi-clipboard

## Overview

Suomi Clipboard is a Firefox/Zen Browser extension that intercepts file-attach flows and presents a local panel for clipboard screenshots, recent downloads, and dragged-file history. The main workflow runs from page attach controls or the hotkey through the content script’s panel and attachment strategies; the background script supplies stored items and browser downloads. Settings are edited separately and shared through extension storage. Edges reflect excerpted calls or README statements; unsampled panel and manifest wiring is omitted where not evidenced.

Main entry points: [`background.js`](https://github.com/anixi9/suomi-clipboard/blob/main/background.js) (Clipboard polling and messages), [`content.js`](https://github.com/anixi9/suomi-clipboard/blob/main/content.js) (Page panel and attachment), [`options.js`](https://github.com/anixi9/suomi-clipboard/blob/main/options.js) (Settings screen), [`_locales`](https://github.com/anixi9/suomi-clipboard/tree/main/_locales) (Translations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_page["Page interaction"]
  node_content["Page panel and attachment<br/>[content.js]"]
  node_paneldata["Panel item browsing<br/>[content.js]"]
end

subgraph group_background["Background services"]
  node_indexeddb[("Screenshot and file history<br/>[background.js]")]
  node_background["Clipboard polling and messages<br/>[background.js]"]
end

subgraph group_preferences["Preferences"]
  node_settingsui["Settings screen<br/>[options.js]"]
  node_localsettings[("Extension settings")]
end

node_user(("Browser user"))
node_attach(("Attach controls"))
node_pageattach["Site file input"]
node_clipboard["System clipboard"]
node_downloads["Browser downloads"]
node_locales["Translations"]

node_attach -->|"opens picker"| node_content
node_user -->|"uses hotkey"| node_content
node_content -->|"requests items"| node_background
node_background -->|"stores screenshots"| node_indexeddb
node_background -->|"stores file history"| node_indexeddb
node_background -->|"polls images"| node_clipboard
node_background -->|"lists downloads"| node_downloads
node_background -->|"fetches selected file"| node_downloads
node_content -->|"attaches files"| node_pageattach
node_content -->|"reads preferences"| node_localsettings
node_settingsui -->|"saves preferences"| node_localsettings
node_content -->|"requests translations"| node_background
node_background -->|"loads messages"| node_locales
node_settingsui -->|"loads messages"| node_locales
node_content -->|"renders panel"| node_paneldata
node_paneldata -.->|"refreshes items"| node_background

click node_content "https://github.com/anixi9/suomi-clipboard/blob/main/content.js"
click node_paneldata "https://github.com/anixi9/suomi-clipboard/blob/main/content.js"
click node_indexeddb "https://github.com/anixi9/suomi-clipboard/blob/main/background.js"
click node_background "https://github.com/anixi9/suomi-clipboard/blob/main/background.js"
click node_settingsui "https://github.com/anixi9/suomi-clipboard/blob/main/options.js"
click node_locales "https://github.com/anixi9/suomi-clipboard/tree/main/_locales"

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_content,node_paneldata,node_user,node_downloads toneBlue
class node_indexeddb,node_background toneAmber
class node_settingsui,node_localsettings toneMint
class node_attach,node_pageattach,node_clipboard toneIndigo
class node_locales toneTeal
```

## Components

### Page interaction

- [Page panel and attachment](https://github.com/anixi9/suomi-clipboard/blob/main/content.js): `content.js`
- [Panel item browsing](https://github.com/anixi9/suomi-clipboard/blob/main/content.js): `content.js`

### Background services

- [Screenshot and file history](https://github.com/anixi9/suomi-clipboard/blob/main/background.js): `background.js`
- [Clipboard polling and messages](https://github.com/anixi9/suomi-clipboard/blob/main/background.js): `background.js`

### Preferences

- [Settings screen](https://github.com/anixi9/suomi-clipboard/blob/main/options.js): `options.js`
- **Extension settings**

### Other components

- **Browser user**
- **Attach controls**
- **Site file input**
- **System clipboard**
- **Browser downloads**
- [Translations](https://github.com/anixi9/suomi-clipboard/tree/main/_locales): `_locales`

## Connections

- Attach controls → Page panel and attachment: opens picker (evidence: `README.md`)
- Browser user → Page panel and attachment: uses hotkey
- Page panel and attachment → Clipboard polling and messages: requests items (evidence: `background.js`)
- Clipboard polling and messages → Screenshot and file history: stores screenshots (evidence: `background.js`)
- Clipboard polling and messages → Screenshot and file history: stores file history (evidence: `background.js`)
- Clipboard polling and messages → System clipboard: polls images (evidence: `background.js`)
- Clipboard polling and messages → Browser downloads: lists downloads (evidence: `background.js`)
- Clipboard polling and messages → Browser downloads: fetches selected file (evidence: `background.js`)
- Page panel and attachment → Site file input: attaches files (evidence: `content.js`)
- Page panel and attachment → Extension settings: reads preferences (evidence: `content.js`)
- Settings screen → Extension settings: saves preferences (evidence: `options.js`)
- Page panel and attachment → Clipboard polling and messages: requests translations (evidence: `background.js`)
- Clipboard polling and messages → Translations: loads messages (evidence: `background.js`)
- Settings screen → Translations: loads messages (evidence: `options.js`)
- Page panel and attachment → Panel item browsing: renders panel (evidence: `content.js`)
- Panel item browsing → Clipboard polling and messages: refreshes items
