An open API service indexing awesome lists of open source software.

https://github.com/wisepythagoras/leebra

An experimental and hackable web browser built in Go.
https://github.com/wisepythagoras/leebra

browser go golang javascript wasm web-brwoser webassembly

Last synced: 3 months ago
JSON representation

An experimental and hackable web browser built in Go.

Awesome Lists containing this project

README

        

# Leebra

Leebra is an experimental browser engine written (mostly) in Go. To get it running you'll need to have at least Go 1.17.1 installed. Then you need to run the following:

``` sh
cd leebra
go build .
```

If everything went well, you should get a binary called `leebra`.

``` sh
./leebra -h
Usage of ./leebra:
-run string
Runs a JavaScript file
-url string
The URL to load (default "about:blank")
```

To just run a JavaScript file, all you need to do is run the following:

``` sh
./leebra -run path/to/js/file.js
```

There are plenty of JavaScript examples in the [js folder](js).

Also, you can supply a url with the `-url` command line argument. For now, this doesn't do much; it will only download the page and attempt to - at some level - parse the HTML and create DOM objects from it.

http://lexbor.com/docs/lexbor/
https://github.com/lexbor/lexbor

https://blog.gopheracademy.com/advent-2014/parsers-lexers/
https://about.sourcegraph.com/go/gophercon-2018-how-to-write-a-parser-in-go/
https://adampresley.github.io/2015/04/12/writing-a-lexer-and-parser-in-go-part-1.html
https://adampresley.github.io/2015/05/12/writing-a-lexer-and-parser-in-go-part-2.html
https://adampresley.github.io/2015/06/01/writing-a-lexer-and-parser-in-go-part-3.html

## How it works

The browser is built mostly from scratch.

### HTML and Style Engine

These will be built from scratch or I will use Go's [built-in HTML parser](https://pkg.go.dev/golang.org/x/net/html#Parse).

### JavaScript Engine

Leebra is using V8 as its JavaScript engine due to the ease of using it.

### WebAssembly Engine

This part is documented in a separate [README](jscore/wasm/README.md).

## Why?

I've always wanted to learn more about browsers and thought I should write one from scratch (ish).