The browser data moves from the roaming app data folder to the local app data folder before the engine starts. A failed rename falls back to a copy. The old folder stays when the copy fails or when the new folder exists.
65 lines
4.1 KiB
Markdown
65 lines
4.1 KiB
Markdown
# Browser architecture
|
|
|
|
The interface lives in `../../src/lib/browser/`. The native bridge lives in `../../src-tauri/src/browser.rs`.
|
|
This directory contains the runtime, bundled filter lists, licenses, and tests.
|
|
Electron runs in its own process, with a separate dependency lock.
|
|
|
|
Run `npm ci` in this directory to install the runtime dependencies.
|
|
Run `npm run package` and `npm run stage:host` to prepare the resource for a host installer.
|
|
No Browser plugin ZIP or sibling checkout is required.
|
|
|
|
## Page isolation
|
|
|
|
Each page has a sandboxed renderer without Node integration or a preload bridge.
|
|
Website scripts never execute inside the privileged RuneStone webview.
|
|
The native bridge accepts a fixed command list. It rejects executable paths, arbitrary JavaScript, and shell commands.
|
|
|
|
RuneStone authenticates the runtime through a temporary loopback listener and a random environment token.
|
|
The runtime removes that token before it creates pages. The listener closes after authentication.
|
|
The established connection carries commands, state, and frames. No external debugger or agent server is enabled.
|
|
The bridge checks the window session and tab ownership. It limits message sizes and routes events to the owner.
|
|
|
|
## Frames and input
|
|
|
|
Chromium paints at up to 60 FPS. JPEG frames reduce encoding and transport costs during motion.
|
|
A lossless PNG follows after the page stops changing. At most two frames await host acknowledgment.
|
|
Acknowledgments follow image decoding. Expired acknowledgments allow recovery after a view closes or moves.
|
|
Hidden tabs stop painting. The encoder skips work while the transport is busy.
|
|
|
|
The viewport uses the host pixel ratio. Device emulation keeps CSS dimensions while the offscreen window supplies physical pixels.
|
|
Pointer coordinates and wheel distances use the same scale. Native window rounding can add one or two image pixels.
|
|
The host coalesces pointer motion and wheel bursts. A reversed wheel direction replaces pending motion in the old direction.
|
|
Middle-button scrolling uses a dead zone and a speed based on distance.
|
|
Escape, another click, focus loss, and drag release stop it.
|
|
|
|
The host orders button and keyboard events. Text insertion accepts Unicode and composition text.
|
|
Clipboard shortcuts use native editing commands. Page menus use the shared RuneStone menu components.
|
|
Image and link downloads require a user menu action. Each menu has a token tied to its tab and document.
|
|
Downloads use the Chromium session and a native save dialog. Other downloads remain blocked.
|
|
|
|
## Profiles and tabs
|
|
|
|
A fresh store contains one User profile. New profiles start blank unless the user requests a copy.
|
|
Duplication stops the runtime before it copies the persistent partition. It then restores the tabs.
|
|
Cookies, site data, history, and bookmarks survive the copy. Later changes remain separate.
|
|
Profile names carry no special authority. Copies do not inherit agent grants.
|
|
|
|
The host keeps the profiles and settings in its local app data folder. Before the first start, it moves the data of releases up to 0.1.48 from the roaming folder.
|
|
Each tab belongs to one RuneStone window. A transfer token moves a live tab between windows.
|
|
Split panes open independent tabs with the same URL and profile. Find uses Chromium match counts and selection.
|
|
|
|
## Network and filters
|
|
|
|
Each profile uses an authenticated local proxy. The proxy resolves public destinations and pins the validated address.
|
|
It rejects private addresses. HTTPS retains certificate validation. A proxy failure has no direct network fallback.
|
|
QUIC is disabled. WebRTC disables non-proxied UDP. These controls do not constitute a VPN.
|
|
|
|
A bounded worker loads EasyList, EasyPrivacy, subscriptions, and personal rules through the Ghostery parser.
|
|
Missing filters block requests when ad blocking is enabled. Scriptlets and extended cosmetic selectors remain disabled.
|
|
Basic cosmetic filtering runs after the main frame loads. Dynamic-frame coverage still needs work.
|
|
|
|
## Remaining limits
|
|
|
|
Webpage screen-reader access, Linux execution, update delivery, and full media compatibility need separate acceptance checks.
|
|
Per-tab VPN tunnels remain unimplemented. Agent observation uses scoped grants, but external agent control is not connected.
|