Skip to main content
ejGames is a Tauri 2 app: a Rust core and a web interface in WebView2. The interface has two layers. The host (React) draws settings, editors and menus. The theme draws the library inside an isolated iframe.

Theme security

Each theme runs in an isolated iframe with a null origin, without allow-same-origin, and with a CSP that cuts off the network. WebView2 injects Tauri’s IPC into every frame, but Tauri rejects calls from null origins and the CSP blocks ipc.localhost. The theme only talks to the host through postMessage, and the host validates every call (src/host/bridge.ts). Map Genie maps are third-party iframes (sandbox without allow-top-navigation or allow-popups). They also receive Tauri’s IPC, but their calls arrive with origin https://mapgenie.io and Tauri rejects them: no command accepts remote origins. That is why Object.prototype is not frozen with freezePrototype (on Windows that would also enter those pages and break them) but with a script of our own that only acts on ejGames documents (lifecycle::FREEZE_OURS). If a theme hangs, a watchdog replaces it with the house theme, Moneda, served from another origin (ejg-safe), which means another process.

Data

%APPDATA%\ejGames\ holds library.db (SQLite), settings.json, logs\ejgames.log, cache\media (art, addressed by content), cache\trailers (LRU with a configurable size) and themes\ (user themes). With a portable.txt file next to the exe, everything goes to .\data.