microview
A fully functional WebView2 browser in as little as 2,960 bytes (2.89 KB).
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Chrome (430 MB) βββββββββββββββββββββββββββββββββββββββββββ
β Brave (400 MB) βββββββββββββββββββββββββββββββββββββββ β
β Edge (370 MB) ββββββββββββββββββββββββββββββββββββ β
β Firefox (250 MB) ββββββββββββββββββββββββ β
β Electron (150 MB) ββββββββββββββ β
β Tauri (3 MB) β β
β microview (2.9 KB) β (less than 1 pixel at this scale) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
What is this?
A Windows executable that opens a fully functional Chromium-based browser window. It loadβ¦
microview
A fully functional WebView2 browser in as little as 2,960 bytes (2.89 KB).
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Chrome (430 MB) βββββββββββββββββββββββββββββββββββββββββββ
β Brave (400 MB) βββββββββββββββββββββββββββββββββββββββ β
β Edge (370 MB) ββββββββββββββββββββββββββββββββββββ β
β Firefox (250 MB) ββββββββββββββββββββββββ β
β Electron (150 MB) ββββββββββββββ β
β Tauri (3 MB) β β
β microview (2.9 KB) β (less than 1 pixel at this scale) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
What is this?
A Windows executable that opens a fully functional Chromium-based browser window. It loads a webpage, handles window resizing, and works exactly like any Electron/Tauri app - but in under 3 KB.
This works because Windows 10/11 ships with the WebView2 runtime (the Edge browser engine). We just create a window and ask WebView2 to render in it.
Quick Start
// main.rs
let wv = WebView::new(1024, 720);
wv.navigate(&url(b"https://google.com\0"));
wv.run();
Download
Grab the pre-built binary from Releases and run it. No installation needed.
Build
Requires Rust and Windows:
git clone https://github.com/warcade/microview.git
cd microview
cargo build --release
The executable will be at target/x86_64-pc-windows-msvc/release/microview.exe
How is this possible?
1. No Standard Library (#![no_std])
The Rust standard library adds ~300KB. We use #![no_std] and call Windows APIs directly.
2. ANSI APIs
Windows has two versions of most functions:
CreateWindowExW- takes UTF-16 strings (2 bytes per char)CreateWindowExA- takes ANSI strings (1 byte per char)
We use ANSI everywhere except Navigate() which requires UTF-16.
3. Direct WebView2 Runtime Loading
Instead of using Microsoftβs WebView2Loader.dll (162 KB), we:
- Read the Edge location from registry
- Load
EmbeddedBrowserWebView.dlldirectly withLoadLibraryExA - Call the internal
CreateWebViewEnvironmentWithOptionsInternalfunction
4. Manual COM Implementation
WebView2 uses COM interfaces. Instead of a COM library, we manually implement vtables:
#[repr(C)]
struct VTbl {
QueryInterface: fn(...),
AddRef: fn(...),
Release: fn(...),
Invoke: fn(...), // Our callback
}
5. Aggressive Linker Flags
# .cargo/config.toml
rustflags = [
"-C", "link-arg=/ALIGN:16",
"-C", "link-arg=/FILEALIGN:1",
"-C", "link-arg=/MERGE:.rdata=.text",
"-C", "link-arg=/MERGE:.pdata=.text",
"-C", "link-arg=/MERGE:.data=.text",
"-C", "link-arg=/MERGE:.bss=.text",
]
6. No Error Handling
If WebView2 isnβt installed, it crashes. This saves hundreds of bytes of error handling code.
Project Structure
microview/
βββ src/
β βββ main.rs # Entry point (30 lines)
β βββ webview.rs # WebView2 wrapper (160 lines)
βββ .cargo/
β βββ config.toml # Linker flags
βββ Cargo.toml
βββ README.md
API
WebView::new(width: i32, height: i32) -> WebView
Creates a window and initializes WebView2.
webview.navigate(&url)
Navigates to a URL. The URL must be UTF-16 encoded. Use the url() helper:
static URL: [u16; 23] = url(b"https://example.com\0");
wv.navigate(&URL);
webview.run()
Runs the message loop. Blocks until the window is closed.
URL Helper
WebView2βs Navigate function requires UTF-16 strings. We provide a compile-time converter:
/// Converts ASCII to UTF-16 at compile time
const fn url<const N: usize>(s: &[u8; N]) -> [u16; N] {
let mut out = [0u16; N];
let mut i = 0;
while i < N - 1 {
out[i] = s[i] as u16;
i += 1;
}
out
}
// Usage - the \0 is required for null termination
static URL: [u16; 24] = url(b"https://github.com\0");
Size Breakdown
| Component | Bytes |
|---|---|
| PE headers | ~400 |
| Import table | ~300 |
| Registry/DLL path strings | ~200 |
| Window creation | ~400 |
| COM callback handlers | ~500 |
| WebView2 init + navigation | ~600 |
| Message loop | ~200 |
| URL data | ~50 |
| Total | ~2,960 |
| Window Size | Binary Size |
|---|---|
| 800 x 600 | 2,960 bytes |
| 1024 x 720 | 3,008 bytes |
Comparison
Browsers
| Browser | Size | vs microview |
|---|---|---|
| Chrome | 430 MB | 148,000x larger |
| Brave | 400 MB | 138,000x larger |
| Edge | 370 MB | 128,000x larger |
| Firefox | 250 MB | 86,000x larger |
| Opera | 240 MB | 83,000x larger |
| Vivaldi | 290 MB | 100,000x larger |
| microview | 2.89 KB | 1x |
App Frameworks (empty "Hello World" app)
| Framework | Size | vs microview |
|---|---|---|
| Electron | 150 MB | 52,000x larger |
| NW.js | 120 MB | 41,000x larger |
| CEF (C++) | 100 MB | 34,000x larger |
| Qt WebEngine | 60 MB | 21,000x larger |
| Flutter | 25 MB | 8,600x larger |
| Neutralino | 3 MB | 1,000x larger |
| Tauri | 3 MB | 1,000x larger |
| Wails | 8 MB | 2,800x larger |
| microview | 2.89 KB | 1x |
Requirements
- Windows 10/11 (WebView2 runtime pre-installed)
- x64 architecture
- Rust toolchain
Limitations
- Windows only
- No error handling - crashes if WebView2 unavailable
- Single window only (uses global state)
- ASCII URLs only (use
url()helper)
License
Public domain. Do whatever you want.
Acknowledgments
- Inspired by the demoscene tradition of extreme size optimization
- WebView2 runtime by Microsoft