braheezy/zibra
Web browser from scratch
749197a3f9d25e211615960c02380a3d659b20f9masterab5cf5feb936fa3b72c95d3ad0c0c67791937ba1827ad6a03ef1ad390b1ae8d96521b7cd3aaa19ffWARNING This project is actively in work!
HEADusually works but it may be broken or produce nasty results.
This repo holds my Zig code for the browser implemented in Web Browser Engineering.
You'll need Zig installed.
Clone the project
git clone https://github.com/braheezy/zibra.git
To build the project, run:
zig build
cp zig-out/bin/zibra .
zibra (optionally) takes one URL and displays the result in a window:
zibra https://example.org
Run without a URL for a default HTML.
zibra is small but supports the basics:
file:// URIsdata: URIs& → & (ampersand)< → < (less than)> → > (greater than)" → " (quotation mark)' → ' (apostrophe)­ → (soft hyphen)Connection: keep-alive headerCache-Control headerContent-Encoding: gzip and Transfer-Encoding: chunked headers<b>Bold</b><i>Italic</i><big>Larger text</big><small>Smaller text</small><sup>Superscript</sup><h1 class="title">Centered title</h1>: An h1 with class set to title will be centered<abbr>Abbreviations</abbr><pre>Preformatted text</pre>: Including bold and italic variants<html>, <head>, and <body> tags<img />, <br />, and <input />There's more Zig commands:
# build and run
zig build run -- https://example.com
# Run tests
zig build test
To test chunked gzip responses, run gzipServer.py locally.