MCPcopy Index your code
hub / github.com/d0iasm/saba

github.com/d0iasm/saba @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
457 symbols 1,237 edges 49 files 83 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SaBA: Sample Browser Application

Actions Status License

Sample Browser Application (SaBA) on a single thread/process. The browser runs on Mac/Linux as a CUI application or on Wasabi OS as a GUI application.

test page on SaBA on Wasabi OS

The book is published on Nov 9, 2024!

『[作って学ぶ]ブラウザのしくみ──HTTP、HTML、CSS、JavaScriptの裏側』 is written in Japanese. The book describes how to make your own browser from scratch in Rust. The code used in the book is based on this repository.

[作って学ぶ]ブラウザのしくみ──HTTP、HTML、CSS、JavaScriptの裏側

Supported Features

It supports sending/receiving HTTP GET request/response, basic HTML tags, basic CSS syntax and basic JavaScript syntax.

  • [x] Handle HTTP GET request/response
  • [x] Basic HTML tags (html, head, body, h1, h2, p, etc.)
  • [x] Basic CSS syntax (background-color, color, display, etc.)
  • [x] Basic JavaScript syntax (addition, subtraction, variable, function)

Upcoming features:

  • [ ] QUIC (HTTP/3) protocol
  • [ ] HTTPS
  • [ ] More HTML tags
  • [ ] More CSS syntax
  • [ ] GUI on Mac/Linux

How to Run

GUI Application on Wasabi OS

You may not be able to run via cargo run because the target architecture is different from your environment. So use a helper script to run the code,

$ ./run_on_wasabi.sh

CUI Application on Mac/Linux

For CUI browser on your host computer,

$ cargo run --features=cui --bin=saba_cui --no-default-features

GUI Application on Mac/Linux

GUI on Mac/Linux is not supported yet.

For GUI browser on your host computer,

$ cargo run --features=gui --bin=saba_gui --no-default-features

Extension points exported contracts — how you extend this code

EventTarget (Interface)
https://dom.spec.whatwg.org/#interface-eventtarget [1 implementers]
core/src/renderer/dom/event.rs

Core symbols most depended-on inside this repo

to_string
called by 332
core/src/log.rs
next
called by 37
core/src/renderer/html/token.rs
first_child
called by 24
core/src/renderer/dom/node.rs
add_char
called by 22
core/src/renderer/html/attribute.rs
kind
called by 18
core/src/renderer/layout/layout_object.rs
insert_element
called by 15
core/src/renderer/html/parser.rs
pop_until
called by 15
core/src/renderer/html/parser.rs
eval
called by 14
core/src/renderer/js/runtime.rs

Shape

Method 284
Function 111
Class 40
Enum 21
Interface 1

Languages

Rust100%

Modules by API surface

core/src/renderer/js/ast.rs46 symbols
core/src/renderer/layout/computed_style.rs39 symbols
core/src/renderer/dom/node.rs36 symbols
core/src/renderer/js/runtime.rs28 symbols
core/src/renderer/css/cssom.rs27 symbols
core/src/renderer/layout/layout_object.rs25 symbols
core/src/renderer/js/token.rs23 symbols
core/src/renderer/html/token.rs21 symbols
core/src/url.rs20 symbols
core/src/renderer/layout/layout_view.rs18 symbols
ui/wasabi/src/app.rs16 symbols
core/src/renderer/html/parser.rs16 symbols

For agents

$ claude mcp add saba \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact