# right-git/insty architecture

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

- Interactive diagram: https://gitdiagram.com/right-git/insty
- Repository: https://github.com/right-git/insty
- Video tour (about a minute): https://gitdiagram.com/right-git/insty/video

## Overview

Insty is a Firefox and Chromium extension for Instagram privacy controls and an on-demand comparison of accounts the user follows against their followers. The user configures message/story protections or starts a comparison in the popup; browser content and page scripts coordinate the work, and the popup displays locally stored progress and results. The graph shows both independent browser implementations. Source excerpts are partial, so uncertain internal calls are omitted; documented support information is represented as a popup capability.

Main entry points: [`firefox/src/popup/popup.js`](https://github.com/right-git/insty/blob/main/firefox/src/popup/popup.js) (Popup controls), [`firefox/src/page/bridge.js`](https://github.com/right-git/insty/blob/main/firefox/src/page/bridge.js) (Page bridge), [`chromium/src/popup/popup.js`](https://github.com/right-git/insty/blob/main/chromium/src/popup/popup.js) (Popup controls), [`chromium/src/page/bridge.js`](https://github.com/right-git/insty/blob/main/chromium/src/page/bridge.js) (Page bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_firefox["Firefox extension"]
  node_ff_popup["Popup controls<br/>[popup.js]"]
  node_ff_content["Content relay<br/>[content-script.js]"]
  node_ff_bridge["Page bridge<br/>[bridge.js]"]
  node_ff_api["Comparison API"]
  node_ff_support["Support links and addresses<br/>[popup.html]"]
end

subgraph group_chromium["Chromium extension"]
  node_ch_popup["Popup controls<br/>[popup.js]"]
  node_ch_content["Content relay<br/>[content-script.js]"]
  node_ch_bridge["Page bridge<br/>[bridge.js]"]
  node_ch_api["Comparison API"]
  node_ch_support["Support links and addresses<br/>[popup.html]"]
end

subgraph group_instagram["Instagram page runtime"]
end

subgraph group_state["Local settings and results"]
  node_ff_storage[("Browser local storage<br/>[content-script.js]")]
  node_ff_popup_storage["Popup storage access<br/>[popup.js]"]
  node_ch_storage[("Browser local storage<br/>[content-script.js]")]
  node_ch_popup_storage["Popup storage access<br/>[popup.js]"]
end

node_ff_ig{{"Instagram"}}
node_ff_user(("Extension user"))
node_ch_ig{{"Instagram"}}
node_ch_user(("Extension user"))

node_ff_user -->|"configures or starts"| node_ff_popup
node_ff_popup -->|"reads and writes"| node_ff_popup_storage
node_ff_popup -->|"sends start message"| node_ff_content
node_ff_content -->|"posts page events"| node_ff_bridge
node_ff_bridge -->|"runs comparison"| node_ff_api
node_ff_api -->|"requests profile and lists"| node_ff_ig
node_ff_bridge -->|"intercepts GraphQL requests"| node_ff_ig
node_ff_bridge -->|"posts progress and results"| node_ff_content
node_ff_content -->|"persists state and settings"| node_ff_storage
node_ff_popup_storage -->|"reads shared state"| node_ff_storage
node_ff_popup -->|"shows support panel"| node_ff_support
node_ch_user -->|"configures or starts"| node_ch_popup
node_ch_popup -->|"reads and writes"| node_ch_popup_storage
node_ch_popup -->|"sends start message"| node_ch_content
node_ch_content -->|"posts page events"| node_ch_bridge
node_ch_bridge -->|"runs comparison"| node_ch_api
node_ch_api -->|"requests profile and lists"| node_ch_ig
node_ch_bridge -->|"intercepts GraphQL requests"| node_ch_ig
node_ch_bridge -->|"posts progress and results"| node_ch_content
node_ch_content -->|"persists state and settings"| node_ch_storage
node_ch_popup_storage -->|"reads shared state"| node_ch_storage
node_ch_popup -->|"shows support panel"| node_ch_support

click node_ff_popup "https://github.com/right-git/insty/blob/main/firefox/src/popup/popup.js"
click node_ff_content "https://github.com/right-git/insty/blob/main/firefox/src/content/content-script.js"
click node_ff_bridge "https://github.com/right-git/insty/blob/main/firefox/src/page/bridge.js"
click node_ff_api "https://github.com/right-git/insty/blob/main/firefox/src/page/non-followers-api.js"
click node_ff_storage "https://github.com/right-git/insty/blob/main/firefox/src/content/content-script.js"
click node_ff_popup_storage "https://github.com/right-git/insty/blob/main/firefox/src/popup/popup.js"
click node_ff_support "https://github.com/right-git/insty/blob/main/firefox/src/popup/popup.html"
click node_ch_popup "https://github.com/right-git/insty/blob/main/chromium/src/popup/popup.js"
click node_ch_content "https://github.com/right-git/insty/blob/main/chromium/src/content/content-script.js"
click node_ch_bridge "https://github.com/right-git/insty/blob/main/chromium/src/page/bridge.js"
click node_ch_api "https://github.com/right-git/insty/blob/main/chromium/src/page/non-followers-api.js"
click node_ch_storage "https://github.com/right-git/insty/blob/main/chromium/src/content/content-script.js"
click node_ch_popup_storage "https://github.com/right-git/insty/blob/main/chromium/src/popup/popup.js"
click node_ch_support "https://github.com/right-git/insty/blob/main/chromium/src/popup/popup.html"

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_ff_popup,node_ff_content,node_ff_bridge,node_ff_api,node_ff_support,node_ff_user,node_ch_user toneBlue
class node_ch_popup,node_ch_content,node_ch_bridge,node_ch_api,node_ch_support toneAmber
class node_ff_storage,node_ff_popup_storage,node_ch_storage,node_ch_popup_storage toneRose
class node_ff_ig,node_ch_ig toneIndigo
```

## Components

### Firefox extension

- [Popup controls](https://github.com/right-git/insty/blob/main/firefox/src/popup/popup.js): `firefox/src/popup/popup.js`
- [Content relay](https://github.com/right-git/insty/blob/main/firefox/src/content/content-script.js): `firefox/src/content/content-script.js`
- [Page bridge](https://github.com/right-git/insty/blob/main/firefox/src/page/bridge.js): `firefox/src/page/bridge.js`
- [Comparison API](https://github.com/right-git/insty/blob/main/firefox/src/page/non-followers-api.js): `firefox/src/page/non-followers-api.js`
- [Support links and addresses](https://github.com/right-git/insty/blob/main/firefox/src/popup/popup.html): `firefox/src/popup/popup.html`

### Chromium extension

- [Popup controls](https://github.com/right-git/insty/blob/main/chromium/src/popup/popup.js): `chromium/src/popup/popup.js`
- [Content relay](https://github.com/right-git/insty/blob/main/chromium/src/content/content-script.js): `chromium/src/content/content-script.js`
- [Page bridge](https://github.com/right-git/insty/blob/main/chromium/src/page/bridge.js): `chromium/src/page/bridge.js`
- [Comparison API](https://github.com/right-git/insty/blob/main/chromium/src/page/non-followers-api.js): `chromium/src/page/non-followers-api.js`
- [Support links and addresses](https://github.com/right-git/insty/blob/main/chromium/src/popup/popup.html): `chromium/src/popup/popup.html`

### Local settings and results

- [Browser local storage](https://github.com/right-git/insty/blob/main/firefox/src/content/content-script.js): `firefox/src/content/content-script.js`
- [Popup storage access](https://github.com/right-git/insty/blob/main/firefox/src/popup/popup.js): `firefox/src/popup/popup.js`
- [Browser local storage](https://github.com/right-git/insty/blob/main/chromium/src/content/content-script.js): `chromium/src/content/content-script.js`
- [Popup storage access](https://github.com/right-git/insty/blob/main/chromium/src/popup/popup.js): `chromium/src/popup/popup.js`

### Other components

- **Instagram**
- **Extension user**
- **Instagram**
- **Extension user**

## Connections

- Extension user → Popup controls: configures or starts
- Popup controls → Popup storage access: reads and writes
- Popup controls → Content relay: sends start message
- Content relay → Page bridge: posts page events
- Page bridge → Comparison API: runs comparison
- Comparison API → Instagram: requests profile and lists
- Page bridge → Instagram: intercepts GraphQL requests
- Page bridge → Content relay: posts progress and results
- Content relay → Browser local storage: persists state and settings
- Popup storage access → Browser local storage: reads shared state
- Popup controls → Support links and addresses: shows support panel
- Extension user → Popup controls: configures or starts
- Popup controls → Popup storage access: reads and writes
- Popup controls → Content relay: sends start message
- Content relay → Page bridge: posts page events
- Page bridge → Comparison API: runs comparison
- Comparison API → Instagram: requests profile and lists
- Page bridge → Instagram: intercepts GraphQL requests
- Page bridge → Content relay: posts progress and results
- Content relay → Browser local storage: persists state and settings
- Popup storage access → Browser local storage: reads shared state
- Popup controls → Support links and addresses: shows support panel
