Overview
Jarvis uses the wry crate to embed web content into tiling panes. Every pane displaying web content gets its own WebView instance, served through a customjarvis:// protocol.
Custom Protocol
Assets served via
jarvis://localhost/ URLsBidirectional IPC
Type-safe JSON messages between Rust and JavaScript
Child Windows
WebViews positioned by tiling layout engine
Theme Bridge
CSS variables injected from config
Custom Protocol
URL Format
All bundled panel assets are loaded via thejarvis:// scheme:
Panel Mapping
Each pane type maps to a specific URL:| Pane Type | URL |
|---|---|
| Terminal | jarvis://localhost/terminal/index.html |
| Assistant | jarvis://localhost/assistant/index.html |
| Chat | jarvis://localhost/chat/index.html |
| Settings | jarvis://localhost/settings/index.html |
| Presence | jarvis://localhost/presence/index.html |
| Games | jarvis://localhost/games/{game}.html |
| Plugin | jarvis://localhost/plugins/{id}/index.html |
Every response includes
Access-Control-Allow-Origin: * to enable CORS for dynamic content loading.JavaScript IPC API
Sending Messages to Rust
Thewindow.ipc global object provides message-passing APIs:
Example: Panel Focus
Example: PTY Input
Rust to JavaScript Messages
Rust sends messages by callingwebview.evaluate_script() with a JavaScript snippet:
Event Handler Setup
JavaScript panels register an event handler:IPC Message Reference
JavaScript → Rust
panel_focus
panel_focus
Notifies Rust that this panel wants focus.
keybind
keybind
Triggers a keybind action by name.
clipboard_copy / clipboard_paste
clipboard_copy / clipboard_paste
Clipboard operations.
pty_input
pty_input
Sends input to the terminal PTY.
palette_click / palette_hover / palette_dismiss
palette_click / palette_hover / palette_dismiss
Command palette interaction.
debug_event
debug_event
Logs a debug event for troubleshooting.
Rust → JavaScript
palette_show / palette_update / palette_hide
palette_show / palette_update / palette_hide
Command palette lifecycle.
config_updated
config_updated
Theme or config changed.
terminal_output
terminal_output
PTY output for xterm.js.
assistant_message
assistant_message
AI assistant response chunk.
presence_update
presence_update
Online users changed.
Theme Bridge
Rust injects CSS custom properties into every WebView based on the current theme:config_updated message and panels re-inject the theme.
Navigation Security
Navigation is restricted by an allowlist:Keyboard Interception
WebViews can prevent Rust from processing keyboard shortcuts by setting:true, Rust does not interpret keybinds for that WebView—useful for terminals and text editors.
Source References
jarvis-rs/crates/jarvis-webview/src/ipc.rs- IPC message typesjarvis-rs/crates/jarvis-webview/src/manager.rs- WebView lifecyclejarvis-rs/crates/jarvis-webview/src/theme_bridge/mod.rs- CSS injectionjarvis-rs/crates/jarvis-app/src/app_state/webview_bridge/- IPC dispatchdocs/manual/06-webview-ipc.md- Complete reference