Skip to content

License

Notifications You must be signed in to change notification settings

aryan-madan/Photon-Browser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

6e94957 · · Dec 11, 2025

History

6 Commits
Dec 11, 2025
Dec 3, 2025
Dec 11, 2025
Dec 11, 2025
Dec 11, 2025
Dec 3, 2025

Repository files navigation

photon browser

(yes, it's a browser built from scratch in rust)

a minimal web browser that renders html, parses css, executes javascript.

demo

Screen.Recording.2025-12-11.at.8.38.11.PM.mov

what is this?

it's a custom web browser written entirely in rust. no webkit, no chromium, no gecko. just pure rust rendering HTML to pixels on your screen. it tokenizes HTML, builds a DOM tree, computes styles with CSS specificity, performs layout calculations, and paints everything to a framebuffer.

features

i wanted to understand how browsers actually work under the hood. parsing, rendering, layout—all of it. also, most "build a browser" tutorials stop at toy examples that can't load real websites.

so, i made this :D

installation

from source

# clone the repo
git clone https://github.com/aryan-madan/Photon-Browser

cd photon-browser


# build release version
cargo build --release



# run it
./target/release/photon_browserr

or you can download the .exe from releases tab

how it works

  1. fetch → downloads html via http
  2. tokenize → breaks html into tags and text
  3. parse → builds a tree of nodes (the dom)
  4. style → applies css rules with proper specificity
  5. layout → calculates position and size of boxes
  6. paint → rasterizes text and backgrounds to pixels
  7. display → presents the framebuffer to the window

known issues

  • large pages can be slow (no gpu acceleration)
  • some websites with complex css won't render correctly
  • javascript dom manipulation is limited
  • no https certificate validation

contributing

pull requests welcome! this is a learning project, so don't expect production-quality code. but if you want to add features or fix bugs, go for it.

acknowledgments

license

MIT - do whatever you want with it

enjoy (._.)/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages