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.
- Host: GitHub
- URL: https://github.com/wisepythagoras/leebra
- Owner: wisepythagoras
- License: gpl-3.0
- Created: 2021-06-08T01:30:13.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-28T01:29:17.000Z (over 3 years ago)
- Last Synced: 2025-01-17T09:23:15.672Z (5 months ago)
- Topics: browser, go, golang, javascript, wasm, web-brwoser, webassembly
- Language: Go
- Homepage:
- Size: 530 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/lexborhttps://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).