How Aperture UI differs from a browser
Where the engine's runtime model departs from Chrome, and what that means for the pages you write.
Aperture UI runs the same kinds of pages as a browser: HTML, CSS, a DOM and V8. The runtime model around them is different on purpose, because the engine lives inside your game. This page lists the differences so you know what to expect when you move a page from Chrome into the engine.
The frame loop is yours
| Browser | Aperture UI | |
|---|---|---|
| Process | Separate renderer, GPU and network processes | One process: your game. Each view has its own V8 isolate inside it. |
| Frame loop | The browser, synced to the display | You. Nothing advances until you call view->tick(deltaSeconds). |
| Output | A window or swap chain | A HarrlowCommandList from view->buildCommandList(), drawn by your render context |
| Scheduler | The browser's event loop | Your game's main loop |
tick() advances CSS animations and transitions, runs timers (setTimeout, setInterval) and
calls requestAnimationFrame callbacks. If your game stops calling it, the page freezes. Style,
layout, script and paint run on the thread that calls tick() and buildCommandList(); treat a
view as single-threaded. The style pass can spread across worker threads, which
ApertureSDK::SetParallelStyleEnabled controls (it is on by default).
UIView::renderToTexture() and getRenderTexture() are not implemented. They are stubs that log
an error and return false or nullptr. The working path is buildCommandList() together with
setRenderPathContext().
Files
Pages load their assets through IAPCFileSystem, the interface your host implements or
subclasses. The stock class reads from disk under the UI resources root you pass to it. A title
that packs assets into an archive overrides it.
File access from page content is contained. A path that markup or CSS supplies (@font-face,
@import, url(), <img src>, <script src>, <video poster>) must resolve inside the UI
resources root, the folder of the loaded document, or a folder your host trusts with
IAPCFileSystem::AddTrustedRoot. The engine blocks anything else and logs it. If no root is
configured there is nothing to contain against, so a host that renders untrusted markup must set one.
The 26.08 Unreal plugin applies this check through its file system adapter: see
Unreal Engine.
localStorage persists through the same interface: the engine writes apui_localstorage*.dat
files with IAPCFileSystem::RequestCreateFile, one per origin. sessionStorage stays in memory.
Networking
The engine has no network stack of its own. fetch(), XMLHttpRequest, WebSocket and
UIView::loadHtmlFromUrl() all go through the IAPCNetworkProvider your host registers with
IAPCPlatform::SetNetworkProvider. With no provider registered, fetch() fails with "No network
provider available" and loadHtmlFromUrl() returns false.
aperture::networking::DefaultNetworkProvider (in apertureuinetwork.dll) implements HTTP, HTTPS
and WebSocket. A provider you write yourself can route requests through your own stack. Its
OpenWebSocket is optional: the default returns nullptr, and the page's WebSocket then
reports an error and closes.
JavaScript
The 26.08.0.1 Windows package embeds V8 15.6.75.12, replacing the older 10.6 runtime. Ship its DLLs, startup snapshot and ICU data together. V8 supplies JavaScript language features; DOM and browser APIs still depend on Aperture UI's implementations below.
| API | Status |
|---|---|
window, document, navigator, console | Available |
DOM (Document, Element, Node, events) | Available, through bindings generated from WebIDL |
requestAnimationFrame | Called from UIView::tick() |
setTimeout, setInterval | Processed once per frame from UIView::tick() |
MutationObserver, ResizeObserver, IntersectionObserver | Available |
Web Animations API (Element.animate()) | Available |
localStorage, sessionStorage | Available. See Files. |
fetch, XMLHttpRequest, WebSocket | Available when your host registers a network provider |
Intl | Available (V8 with ICU data) |
| 2D canvas | Available. getContext("webgl") and getContext("webgpu") return null: the game owns the GPU. |
alert(), confirm(), prompt() | Present but inert. alert() does nothing, confirm() returns false and prompt() returns its default value. Use dialogs in your game. |
Web Workers, DOMMatrix | Not implemented |
CSS and HTML
The engine is tested page by page against Chrome rather than against the CSS specifications as a whole. Web platform support lists those pages and the status each has in the test baseline. Anything the tests do not cover can differ from Chrome. When a page renders differently in the engine than in Chrome, treat it as a bug in the engine and report it.
Security
Newly constructed UIView instances enable document security by default. Native binders are
blocked until the host explicitly grants access. Configure trust before loading the document:
#include <APHTML/API/APUIView.h>
aperture::UIView view;
// Grant only to content trusted with every function in this binder.
view.setNativeBinderAccessAllowed(true);
view.assignBinder(&gameBinder);
view.loadHtmlFromFile("ui/index.html");setNativeBinderAccessAllowed() and setSecurityPolicyEnabled() return false if a change is
attempted after the script context exists. Create a new view when changing trust. The explicit
compatibility opt-out, setSecurityPolicyEnabled(false), disables document policy checks and the
native-binder gate. Keep the default enabled when loading content with fewer privileges.
The policy now provides:
- CSP response-header and meta-policy enforcement, including source lists, nonces, SHA-256/384/512
inline hashes, directive fallbacks and intersection of multiple policies. It checks inline
scripts and styles,
eval/Function, module imports and resource loads. - Origin and CORS checks for script networking, including preflight for non-simple cross-origin
requests and filtering of response headers. Cross-origin redirect transitions are denied before
transmission. Secure fetch accepts
corsandsame-originmodes withomitorsame-origincredentials; unsupported settings reject explicitly. - Iframe documents with inherited policy, independent views and script queues. Sandbox tokens
separately control script execution and same-origin document access. Child views never inherit
a parent's native-binder grant. Restricted
contentDocument/contentWindowaccess returnsnull; this is more conservative than a browser's cross-originWindowProxyinterface. - Resource caches partitioned by document policy and policy snapshots passed to image workers.
Custom IAPCNetworkProvider implementations must implement FetchAsyncRestricted and
OpenWebSocketRestricted; their defaults deny secure networking. The fetch provider must check
policy before every request and before consuming each response or following a redirect. The
NetworkEngine provider implements these contracts and sends the document Origin on script
WebSocket handshakes. Providers must not attach ambient credentials to script requests.
These changes describe the current engine source. An older downloaded SDK may lack these APIs;
check its headers and rebuild or obtain an updated package. This is not complete browser security
conformance: CSP strict-dynamic delegation does not authorize further execution, and the fetch
modes and credentials listed above are the supported subset.
Document policy checks run inside your process. They do not contain an exploit in V8 or native code. Put hostile user-generated content in a separate OS-sandboxed process with a narrow IPC interface. Continue to apply file containment; document policy does not replace the host's filesystem boundary. Free-access registration does not change this deployment requirement.
Frame budget
What matters is how much of your frame the UI uses. A game at 60 frames per second has 16.6 ms in total, so decide how much of that the UI gets and profile against it with your own content.