You are browsing as a guest. Sign up (or log in) to start making projects!

Open comments for this post

3h 51m 56s logged

C++ Browser Engine

You can try it online! : https://k754a.hackclub.app/

Source code: https://github.com/k754a/C-Plus-Plus-Web-Engine


I built a custom tokenizer for HTTP to be able to load and render websites!


I’m building a super-fast, pure custom C++ browser engine from scratch, and the thing I built today was an HTML parser!

HTML parsers are super hard to code, thanks to HTML being a very loose markup language. There can be tons of stuff, like:

Missing divs

<div>Hello World!</p></div>

Missing end tags

<img src="image.png"

Even nested divs!

<div class="container"><span>Nested Elements</span></div>


So I needed to build a parser that could handle all of it.

Another challenge I’ve been trying is forcing myself to stop making variables for everything and trying to be minimal and fast! This new update also added local HTML loading; this lets me test much faster and test certain things, especially for the DOM and render tree!

Some struggles I ran into while building this project were just the amount of errors and debugging I had to do to figure out what went wrong, as well as working with large pieces of code with constant changes.

This part really taught me about data types, how to find and remove elements from multiple different classes and types, how to make loops efficient, and how to use vectors!


My plan for the next devlog will be building a DOM tree or getting HTTPS to work. After doing some research, I found that I can use:

#include <wininet.h>

to help get this thing working, so that’s my plan!

Okay, this was super long. Thanks for looking at it. The video linked below is a demo of it loading and tokenizing some text locally on a machine!

2
110

Comments 2

@Sabrina

Bye bye firefox, hello this

@kallenseelo

@Sabrina Thanks so much lol!