# eliasvdv/omarchy-webapp-links architecture

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

- Interactive diagram: https://gitdiagram.com/eliasvdv/omarchy-webapp-links
- Repository: https://github.com/eliasvdv/omarchy-webapp-links

## Overview

Omarchy Web App Links redirects links opened from an Omarchy Chromium app window into their own app window. The extension identifies eligible tabs opened in a normal browser window, waits for an HTTP(S) URL, and sends it to a native messaging host. The host launches Omarchy’s web-app command; if the host is unavailable, the extension turns the tab into a popup. The extension logic is excerpted; host behavior and several connections are documented in the README, but the host source itself was not sampled.

Main entry points: [`extension/background.js`](https://github.com/eliasvdv/omarchy-webapp-links/blob/main/extension/background.js) (Tab detection and routing), [`webapp-links-host`](https://github.com/eliasvdv/omarchy-webapp-links/blob/main/webapp-links-host) (Native messaging host)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extension["Browser extension"]
  node_tab_handler["Tab detection and routing<br/>[background.js]"]
  node_popup_fallback["Popup fallback<br/>[background.js]"]
end

subgraph group_native["Native launching"]
  node_native_host["Native messaging host"]
end

node_app_window(("Omarchy app window"))
node_browser["Chromium browser"]
node_launcher["omarchy-launch-webapp"]
node_app_result["Dedicated app window"]

node_app_window -->|"opens link"| node_browser
node_browser -->|"reports new tabs"| node_tab_handler
node_tab_handler -->|"sends URL"| node_native_host
node_native_host -->|"runs command"| node_launcher
node_launcher -->|"opens URL"| node_app_result
node_tab_handler -->|"creates on failure"| node_popup_fallback
node_popup_fallback -->|"opens popup"| node_browser

click node_tab_handler "https://github.com/eliasvdv/omarchy-webapp-links/blob/main/extension/background.js"
click node_popup_fallback "https://github.com/eliasvdv/omarchy-webapp-links/blob/main/extension/background.js"
click node_native_host "https://github.com/eliasvdv/omarchy-webapp-links/blob/main/webapp-links-host"

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_tab_handler,node_popup_fallback,node_browser toneBlue
class node_native_host toneAmber
class node_app_window,node_launcher,node_app_result toneIndigo
```

## Components

### Browser extension

- [Tab detection and routing](https://github.com/eliasvdv/omarchy-webapp-links/blob/main/extension/background.js): `extension/background.js`
- [Popup fallback](https://github.com/eliasvdv/omarchy-webapp-links/blob/main/extension/background.js): `extension/background.js`

### Native launching

- [Native messaging host](https://github.com/eliasvdv/omarchy-webapp-links/blob/main/webapp-links-host): `webapp-links-host`

### Other components

- **Omarchy app window**
- **Chromium browser**
- **omarchy-launch-webapp**
- **Dedicated app window**

## Connections

- Omarchy app window → Chromium browser: opens link (evidence: `README.md`)
- Chromium browser → Tab detection and routing: reports new tabs (evidence: `README.md`)
- Tab detection and routing → Native messaging host: sends URL (evidence: `README.md`)
- Native messaging host → omarchy-launch-webapp: runs command (evidence: `README.md`)
- omarchy-launch-webapp → Dedicated app window: opens URL (evidence: `README.md`)
- Tab detection and routing → Popup fallback: creates on failure (evidence: `README.md`)
- Popup fallback → Chromium browser: opens popup (evidence: `README.md`)
