Embedded asset origin¶
ravet_web_create_assets (Rust: WebView::from_html_with_assets with
ravet_webview::Asset) loads the page as index.html from a local origin that
also serves the caller's assets from memory, so editors can ship images,
fonts, scripts and styles of any size without inlining them into the 1 MiB page
or chunking them through 64 KiB snapshots:
| Platform | Origin | Mechanism |
|---|---|---|
| macOS | ravet://editor/ |
WKURLSchemeHandler on the view's configuration |
| Linux | ravet-<id>://editor/ |
WebKitGTK URI scheme on the default context; one scheme per loaded binary, because schemes are process-wide; registered secure and CORS-enabled |
| Windows | https://editor.ravet.invalid/ |
WebResourceRequested filter on a reserved .invalid host, answered before any network request |
Pages use relative URLs, so the origin does not matter to them. Only GET is
answered; unknown paths get 404; navigation stays inside the origin. The view
copies paths and content types; asset data must stay valid until the view is
destroyed (normally static data in the binary) and is copied once per request.
Limits: 4,096 assets, 64 MiB each, 256 MiB in total, paths of at most 512 bytes
from ASCII letters, digits and ._-/ without ., .. or empty segments;
index.html is reserved. Snapshots and page messages keep their 64 KiB limit;
the origin is for static assets. ravet-web-assets loads a 1.5 MiB script, a
stylesheet and an SVG image, fetches an asset and a missing path, and checks
snapshot delivery, on each platform. Plug-in products declare assets with
EditorAsset (plug-in editors).