• josh.earth
  • ← All projects

    Mini Browser in 750 Lines

    A web browser prototype that renders a useful subset of HTML and CSS in about 750 lines of code.

    Personal · 2022

    The web was designed to degrade gracefully. To prove that you can render much of the web without
    the full complexity of the entire web standard (which is essentially an operating system), I wrote a mini graphical web-browser in less than a thousand lines of code. It's just a prototype, but shows that the core of the web is surprisingly simple.

    The prototype uses TypeScript and OhmJS grammars to parse HTML and CSS, then renders basic text, links, lists, and images using Canvas 2d. It is intentionally not a standards-complete browser and does not support JavaScript. It uses a host browser for networking and graphics, to keep the code small enough to understand and extend.

    The mini browser rendering a sample page with text, a link, and an image

    Read the project story or browse the source on GitHub.