React Renderer ↔ Electron WebContentsView Flow
Traditional Electron browsers force web pages into insecure and slow <iframe> tags or legacy webview elements that limit performance.
Vastra separates concerns perfectly:
The React Renderer keeps the absolute source of truth about browsing states inside global Zustand stores. The Electron Main Process maintains a dedicated, lightweight TabManager that creates native, isolated WebContentsView instances.
When resizing or rendering occurs, the React window host measures bounds via a ResizeObserver and pushes dimensions to Electron, matching coordinates perfectly.
System Thread Separation
Manages TabManager, creates OS windows, handles will-download hooks, hooks shortcuts, edits registries.
Renders dashboard UI, settings sheets, active workspaces, and monitors dimensions.
IPC bridge exposing limited hooks (window.vastra) to prevent raw Node access in the browser views.
Interactive Tab Navigation Loop
1. React Store Dispatch
User clicks tab/types URL. Zustand modifies active state.
2. Preload IPC Signal
Preload bridge passes tabID & payload over secure channel.
3. WebContentsView load
Main process maps view coordinates, mounts layout, and streams the URL.
Win11 Default Apps Registry Architecture
Windows 11 enforces strict policies on default browser takeovers to block silent browser hijacking. Apps failing to declare Capabilities are filtered out of OS prompts.
Vastra implements an advanced registry writing model on startup (running safely in User space without admin requests):
- Configures capability declarations in
HKCU\Software\Vastra\Capabilities. - Hooks protocol declarations (http/https/mailto) to
VastraHTMLpointers. - Checks active OS default precisely by executing
reg query UserChoice\ProgIdinstead of relying on Electron's false-positive hooks, checking defaults instantly on window refocus.
// HKCU Registry structure declared by Vastra:
Software\RegisteredApplications\Vastra
└─ Pointer: Software\Vastra\Capabilities
Software\Vastra\Capabilities
├─ URLAssociations: http, https → VastraHTML
└─ FileAssociations: .html, .svg → VastraHTML
Software\Classes\VastraHTML\shell\open\command
└─ Default: "path\to\Vastra.exe" "%1"
The Dynamic Favicon Discovery Matrix
To ensure beautiful visuals across your workspaces and widgets, Vastra utilizes a dynamic favicon discovery mechanism, completely bypassing hardcoded bookmarks.
When any site loads, Vastra routes lookup requests through a prioritized five-tier probe tree:
- Requests Google s2 128px domain database.
- Falls back to DuckDuckGo dynamic icon service.
- Checks site's host root
/favicon.icoaddress directly. - Inspects Apple iOS web app touch anchors.
- Builds a localized gradient letter-tile canvas render as a last resort.
All discovery results are stored inside an active in-memory cache and persisted locally!
App-wide Integration Points
Built on modern bricks
Vastra leverages optimized open-source web frameworks to achieve high reliability and speed.