# muhammad9985/responsive-studio-extension architecture

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

- Interactive diagram: https://gitdiagram.com/muhammad9985/responsive-studio-extension
- Repository: https://github.com/muhammad9985/responsive-studio-extension

## Overview

Responsive Studio is a Chrome extension for previewing a web page at device-sized viewports. Users can launch the studio from the toolbar popup or a context menu, select device profiles, and inspect one viewport or a multi-device matrix; the studio also offers fitting, zoom, reload, and visual debugging controls. The device catalog supplies viewport and mockup metadata, while content scripts support scroll synchronization and scrollbar styling. Relationships not directly visible in the sampled source are included only where the README documents them; manifest wiring and some viewer internals were not sampled.

Main entry points: [`viewer.js`](https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js) (Studio engine), [`background.js`](https://github.com/muhammad9985/responsive-studio-extension/blob/main/background.js) (Extension worker), [`popup.js`](https://github.com/muhammad9985/responsive-studio-extension/blob/main/popup.js) (Toolbar popup), [`viewer.html`](https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.html) (Studio interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and control"]
  node_popup["Toolbar popup<br/>[popup.js]"]
  node_background["Extension worker<br/>[background.js]"]
end

subgraph group_studio["Viewport studio"]
  node_studio_ui["Studio interface<br/>[viewer.html]"]
  node_studio_engine["Studio engine<br/>[viewer.js]"]
  node_viewport_matrix["Viewport matrix<br/>[viewer.js]"]
  node_fit_zoom["Fit and zoom<br/>[viewer.js]"]
  node_debug_tools["Studio dev tools<br/>[viewer.js]"]
end

subgraph group_profiles["Device profiles"]
  node_device_catalog[("Device profiles<br/>[devices.js]")]
end

subgraph group_integration["Browser integration"]
  node_scroll_sync["Scroll sync<br/>[content-sync.js]"]
  node_frame_bypass["Local frame bypass<br/>[dnr_rules.json]"]
end

node_user(("Developer"))
node_chrome["Chrome APIs"]
node_target_page(("Target web page"))

node_user -->|"opens"| node_popup
node_user -->|"opens"| node_studio_ui
node_popup -->|"queries tab"| node_chrome
node_popup -->|"sends actions"| node_background
node_background -->|"opens tab"| node_studio_ui
node_background -->|"resizes window"| node_chrome
node_studio_ui -.->|"runs"| node_studio_engine
node_studio_engine -.->|"uses profiles"| node_device_catalog
node_studio_engine -->|"renders"| node_viewport_matrix
node_studio_engine -->|"calculates fit"| node_fit_zoom
node_studio_engine -->|"controls"| node_debug_tools
node_studio_engine -->|"previews"| node_target_page
node_target_page -->|"reports scroll"| node_scroll_sync
node_scroll_sync -->|"sends scroll"| node_studio_engine
node_studio_engine -->|"broadcasts scroll"| node_scroll_sync
node_frame_bypass -->|"removes frame headers"| node_target_page
node_chrome -->|"dispatches events"| node_background

click node_popup "https://github.com/muhammad9985/responsive-studio-extension/blob/main/popup.js"
click node_background "https://github.com/muhammad9985/responsive-studio-extension/blob/main/background.js"
click node_studio_ui "https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.html"
click node_studio_engine "https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js"
click node_viewport_matrix "https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js"
click node_fit_zoom "https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js"
click node_debug_tools "https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js"
click node_device_catalog "https://github.com/muhammad9985/responsive-studio-extension/blob/main/devices.js"
click node_scroll_sync "https://github.com/muhammad9985/responsive-studio-extension/blob/main/content-sync.js"
click node_frame_bypass "https://github.com/muhammad9985/responsive-studio-extension/blob/main/dnr_rules.json"

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_background toneBlue
class node_studio_ui,node_studio_engine,node_viewport_matrix,node_fit_zoom,node_debug_tools toneAmber
class node_device_catalog,node_chrome toneMint
class node_scroll_sync,node_frame_bypass toneRose
class node_user,node_target_page toneIndigo
```

## Components

### Launch and control

- [Toolbar popup](https://github.com/muhammad9985/responsive-studio-extension/blob/main/popup.js): `popup.js`
- [Extension worker](https://github.com/muhammad9985/responsive-studio-extension/blob/main/background.js): `background.js`

### Viewport studio

- [Studio interface](https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.html): `viewer.html`
- [Studio engine](https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js): `viewer.js`
- [Viewport matrix](https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js): `viewer.js`
- [Fit and zoom](https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js): `viewer.js`
- [Studio dev tools](https://github.com/muhammad9985/responsive-studio-extension/blob/main/viewer.js): `viewer.js`

### Device profiles

- [Device profiles](https://github.com/muhammad9985/responsive-studio-extension/blob/main/devices.js): `devices.js`

### Browser integration

- [Scroll sync](https://github.com/muhammad9985/responsive-studio-extension/blob/main/content-sync.js): `content-sync.js`
- [Local frame bypass](https://github.com/muhammad9985/responsive-studio-extension/blob/main/dnr_rules.json): `dnr_rules.json`

### Other components

- **Developer**
- **Chrome APIs**
- **Target web page**

## Connections

- Developer → Toolbar popup: opens (evidence: `README.md`)
- Developer → Studio interface: opens (evidence: `README.md`)
- Toolbar popup → Chrome APIs: queries tab (evidence: `popup.js`)
- Toolbar popup → Extension worker: sends actions (evidence: `popup.js`)
- Extension worker → Studio interface: opens tab (evidence: `background.js`)
- Extension worker → Chrome APIs: resizes window (evidence: `background.js`)
- Studio interface → Studio engine: runs
- Studio engine → Device profiles: uses profiles
- Studio engine → Viewport matrix: renders (evidence: `viewer.js`)
- Studio engine → Fit and zoom: calculates fit (evidence: `viewer.js`)
- Studio engine → Studio dev tools: controls (evidence: `README.md`)
- Studio engine → Target web page: previews (evidence: `README.md`)
- Target web page → Scroll sync: reports scroll (evidence: `content-sync.js`)
- Scroll sync → Studio engine: sends scroll (evidence: `README.md`)
- Studio engine → Scroll sync: broadcasts scroll (evidence: `viewer.js`)
- Local frame bypass → Target web page: removes frame headers (evidence: `README.md`)
- Chrome APIs → Extension worker: dispatches events (evidence: `background.js`)
