Menu

1 / 2

A browser in 688 KB: what Win32 and WebView2 can still do

DEV Community: cpp·Unresolute·6 days ago
#TP6D762j
#devtocpp#devto#dev#window#webview2
Long article (1380 words) — no AI summary yet.
Reading 0:00
15s threshold

The browser engine is already on your machine. That sentence is the whole project.

I wanted a window small enough to keep one page in the corner of the screen — a dashboard, an API

reference, a chat — without keeping a whole browser window there. The options I found were either a

pinned browser window or an Electron mini-browser with an 80–150 MB runtime. So I built the host

myself: tinybrowser , a 160×90 always-on-top browser for Windows in a single 688,640-byte exe.

No Electron. No installer. No VC++ redistributable. C++20, Win32 and the WebView2 runtime that ships

with Edge and Windows 11.

The 46-second demo: demo.mp4 .

The engine is not inside the exe

That is the trick, and it is also the trade-off. WebView2 is a system component; the exe is only the

host. It statically links the runtime ( /MT ), compiles with /O2 , /OPT:REF and /OPT:ICF , and

carries the window, the HTML bar, the gestures, the containers and the snapshot format.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.