The programmable, format-agnostic browser runtime powered by WebAssembly.
Stop rebuilding document viewers from scratch. Omnishell treats network protocols, compression algorithms, archive structures, and file formats as simple, hot-swappable Wasm plugins.
Omnishell includes a robust baseline layer, allowing developers to immediately build on top of standard web protocols:
- Network Schemes:
file://(builtin) |http://|https:// - Compression:
zstd|gzip|deflate|raw-deflate - Archives:
zip - Transforms:
markdown➔html - Views:
html|svg|png|jpg|wasm(builtin)
Planned features include cross format debugging and search capabilities by using the accessibility tree exported by view plugins and source maps exported by transform plugins, Omnishell delivers a built-in debug server and multimodal search natively across any file type.
Omnishell was built to host next-generation computing formats. It serves as the official runtime and testing environment for:
- UMC (Universal Multimedia Codec): An ultra-efficient image/audio/video
compression format reaching
0.1bpp @30+dB PSNRon video with symmetric500MPsencoding/decoding throughput. - LDP (Lean Document Package): A modern, document format engineered to replace PDF in the 21st century.
Want to bring Typst, Iroh, BitTorrent, Pdf, Brotli, or DjVu to
Omnishell? Or integrate a js engine like Boa? Check out components/content/svg
to see how to compile your first plugin to Wasm in minutes.
All plugins either take or return a Content type:
struct Content {
url: String,
info: MimeInfo,
length: u64,
content: ContentReader,
}
struct MimeInfo {
/// corresponds to the http `content-type` header
mime: String,
/// corresponds to the http `content-encoding` header
encoding: Option<String>,
}-
network plugin: handles a url scheme, takes an url and returns a content record. examples: http
-
archive plugin: handles a mime type, takes a content record and a path and returns a new content record. examples: zip
-
compression plugin: handles content-encoding, takes a content record with a content-encoding and returns a content record without a content-encoding. examples: zstd, deflate
-
transform plugin: handles a mime type, takes a content record of one mime type and returns a content record of another mime type. optionally exposes a source map. examples: markdown, typst, latex
-
view plugin: handles a mime type, takes a content record and returns an rgba frame. optionally handles input events, resources and child view plugins.
The omnishell handles the plugin lifecycle. To see how it works we will fetch
the hypothetical url: https://omnishell.com/book.zip!/index.md.
- The url is parsed into the following parts:
scheme:httpsbase-url:https://omnishell.com/book.zippath:index.md
- The
filescheme is builtin toomnishell. If its thefileschemeomnishelluses the extensions like.txt.gzto guess the mimetext/plainand encodinggzipand creates a content record. Otherse the scheme handler is loaded from the plugin registry. In this case thehttpplugin is loaded. - The
httpplugin is called with thebase-urland a list of supported encodings. Since thedeflateandzstdplugins are registered, the network plugin receives['gzip', 'deflate', 'defalte-raw', 'zstd']. - The
httpplugin performs aheadrequest with theaccept-encoding: identity, *;q=0header to read thecontent-length,content-typeandaccept-rangesheaders and the final redirected url. - If the
content-typestarts withvideo/orapplication/streaming is enabled by default, so uncompressed range queries are made and retreived. For othercontent-typesthe entire file is fetched, providing the supported encodings with theaccept-encodingheader. - In this case it is an
application/zipcontent-type with no content-encoding and apathofindex.md, so the archive plugin is loaded. The zip plugin supports content-types starting withapplication/zipor ending with+zip. - The
zipplugin guesses the content-type based on the file extension, in this casetext/markdownand matches the zip compression method 8 to the content-encodingraw-deflate. - The
deflatecompression plugin is loaded and applied. - The
text/markdowntransform plugin is loaded and atext/htmlcontent record is returned. - The
text/htmlplugin is loaded and parses the html. It sees that the assethttps://omnishell.com/book.zip!/image.pngand the fonthttps://omnishell.com/book.zip!/font.woffare missing. The font is fetched withfetch_bytes, doing the entire process again forfont.woff. The bytes are then parsed and loaded in the webview. Image and svg assets are fetched withfetch_view, attaching a child view plugin to the html view plugin. The parent view can now forward input events and render the child view using the child widget id. - The html view plugin is wrapped in a native widget and attached to the widget tree. It now handles input events forwarded by the widget wrapper and returns frames when requested.
MIT OR Apache-2.0
