Revert "Complete engine rewrite - now featuring Gecko!"

This reverts commit b1be74adb8.
This commit is contained in:
Martin Dvořák 2026-10-11 17:39:39 +02:00
commit e4bb4aa8c4
20 changed files with 2309 additions and 4069 deletions

View file

@ -1,68 +1,46 @@
# RustyWolf
RustyWolf is a minimal, privacy-focused browser shell built in Rust with two engine modes:
- **WebKit mode (default, light)** — the system webview: `WebKitGTK` on Linux, `WKWebView` on macOS, `WebView2` on Windows. No browser install needed.
- **Gecko mode (opt-in)** — real Firefox (Gecko) engine through a RustyWolf-managed profile. Requires an installed Firefox.
Switch between them any time with the **leaf toggle** in the toolbar (or the leaf on the RustyWolf home page in Gecko mode). Open tabs carry over in both directions.
RustyWolf is a minimal, privacy-focused browser shell built with Rust + system webviews.
(complete honesty, this whole thing is vibecoded, however I never paid for any ai service (I got a free student plan for a year) so if you wanna avoid AI slop, just skip this but I never contributed to the AI BOOM with my money, if you wanna contribute, feel free to do so)
- macOS: native `WKWebView`
- Linux: `WebKitGTK`
- Windows: `WebView2`
No Firefox install. No extension system. Fast startup, clean UI.
<img
alt="image"
src="https://git.dvorakmortonxd.dev/dvorakmortonxd/RustyWolf/raw/branch/main/preview.png"
style="width: 100%; max-width: 1920px; aspect-ratio: 18 / 9; object-fit: contain; height: auto;"
/>
## Engines
| | WebKit mode | Gecko mode |
|---|---|---|
| Engine | WebKitGTK / WKWebView / WebView2 | Firefox (Gecko), driven by RustyWolf |
| Weight | lightest — typically ~300 MB with a tab open | Firefox-weight |
| RustyWolf UI | full chrome (tabs, URL bar, ADS, K, D, Properties) | Firefox's own UI + RustyWolf home page |
| Adblock | built-in lightweight blocker (ADS toggle) | Firefox strict tracking protection |
| Extras | keep-in-ram tabs (`K`), popup gate, download panel, properties page | Firefox features, managed profile, tab handoff |
The leaf button shows the current engine: **lit green = WebKit**, **dim = Gecko**.
## What It Does
- Really, I mean really lightweight in WebKit mode! the reason I even made this is because I need a lightweight browser to run on my old macbook unibody 2010 4gb ddr3
- in a gentoo(openrc)+i3wm setup it took only ~285 MB RAM with one tab open (dvorakmortonxd.dev) compared to firefox which took ~866 MB
- tabs have a toggle for Keeping-in-ram (`K`): with it off the tab is unloaded, only the URL is kept, and it reloads on click
- background tabs are suspended automatically, and the download ticker only runs while something is downloading
- Really, I mean really lightweight! the reason I even made this is because I need a lightweight browser to run on my old macbook unibody 2010 4gb ddr3
- So light in fact in my gentoo(openrc)+i3wm setup it took only 285mb ram with one tab open (dvorakmortonxd.dev) compared to firefox which took 866mb ram
- THATS 3.04 TIMES AS MUCH RAM, so yeah it is light
- tabs have a toggle for Keeping-in-ram (`K`), it basically just saves the url if its off and reloads it on reclick, if you toggle it on it keeps the whole page in ram.
- Privacy-first defaults: DuckDuckGo home + search fallback from the URL bar
- Multi-tab browsing with back, forward, reload, and keyboard shortcuts (`Ctrl/Cmd+T`, `W`, `L`)
- Built-in custom adblock with top-bar toggle (`ADS`), persisted across restarts
- Popup handling that behaves like a real browser: clicked links open tabs, clicked `window.open` popups (OAuth/"Sign in with Google", SoundCloud, ...) open real popup windows with `window.opener` intact, and scripted popups go through the permission gate
- Native user agent by default, so sites (and their login flows) see an honest browser; `--ua-chrome` is available for stubborn sites
- Built-in custom adblock with top-bar toggle (`ADS`)
- Popup permission gate: asks before a site opens a new tab
- Download support with live progress panel (`D`) and session download history
- Properties page with session browsing history + download history
- Default window size `1000x600` (still fully resizable)
- Optional `--private` mode in both engines
- Engine switch with tab handoff: WebKit tabs become Firefox tabs and vice versa
- Optional `--private` mode when backend support is available
## Run
```bash
cargo run --
```
# pick a URL / window title
```bash
cargo run -- --url https://example.com
cargo run -- --url example.com
cargo run -- --title "RustyWolf"
# engine selection (persisted in ~/.config/RustyWolf/config.json)
cargo run -- --engine webkit
cargo run -- --engine gecko
cargo run -- --engine gecko --firefox /path/to/firefox
# compatible user agent for picky sites (WebKit mode)
cargo run -- --ua-chrome
# misc
cargo run -- --private
cargo run -- --dry-run
@ -70,29 +48,18 @@ cargo run -- --dry-run
cargo run -- --linux-backend x11
cargo run -- --linux-backend wayland
cargo run -- --linux-disable-dmabuf
cargo run -- --linux-backend x11 --linux-disable-dmabuf
```
The leaf button in the toolbar switches engines immediately; the choice is remembered for the next launch.
## Gecko Mode (real Firefox engine)
There is no embeddable Gecko in 2026, so Gecko mode supervises a real Firefox with a dedicated profile under `~/.config/RustyWolf/gecko-profile`:
- hardening prefs are rewritten on every launch (strict tracking protection, DNT/GPC, no telemetry, no sponsored content, no Pocket)
- downloads go straight to your Downloads folder
- new tabs stay blank; the RustyWolf home page is the start page and carries the leaf button back to WebKit
- `browser.sessionstore.interval` is shortened so RustyWolf can hand your tabs back to WebKit
- Firefox is launched with `--no-remote --new-instance`, so your normal Firefox session is never touched (`--firefox` / `RUSTYWOLF_FIREFOX` to point at a specific binary)
## Privacy Notes
WebKit mode applies baseline hardening in page context:
RustyWolf applies baseline hardening in page context:
- `navigator.doNotTrack = "1"`
- disables legacy `openDatabase`
- disables `RTCPeerConnection`
Adblocking is built-in and lightweight. It is not full uBlock Origin parity. Gecko mode uses Firefox's own strict tracking protection instead.
Adblocking is built-in and lightweight. It is not full uBlock Origin parity.
# Linux Setup (prerequisites)
@ -129,8 +96,6 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
```
For Gecko mode just make sure Firefox is installed (`emerge www-client/firefox` or the binary release).
For NVIDIA, make the DRM modeset setting part of the boot command line, not only
`/etc/modprobe.d`, then reboot:
@ -214,8 +179,6 @@ If you do not want global appmenu integration, remove `appmenu-gtk-module` from
/etc/xdg/gtk-3.0/settings.ini
```
If RustyWolf segfaults instantly with `Couldn't register with accessibility bus` when launched from a bare TTY/SSH shell, there is no session D-Bus for the GTK accessibility bridge (`libatk-bridge`). Launch it from your graphical session, or make `DBUS_SESSION_BUS_ADDRESS` available (on many systems `export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus`).
# MacOS
## installing Homebrew (skip if already installed)
@ -224,25 +187,17 @@ If RustyWolf segfaults instantly with `Couldn't register with accessibility bus`
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```
Gecko mode finds Firefox in `/Applications/Firefox.app` automatically; WebKit mode uses the system `WKWebView`.
# Windows Setup
Install the Microsoft Edge WebView2 Runtime (Evergreen) for WebKit mode, then build normally with the Rust MSVC toolchain.
Install the Microsoft Edge WebView2 Runtime (Evergreen), then build normally with Rust MSVC toolchain.
- WebView2 Runtime: https://developer.microsoft.com/microsoft-edge/webview2/
- Rust toolchain target: `x86_64-pc-windows-msvc`
Gecko mode finds Firefox under `Program Files` / `%LOCALAPPDATA%\Mozilla Firefox`, or use `--firefox`.
## Dev Quick Checks
```bash
cargo fmt
cargo check
cargo test
cargo clippy --all-targets
# exercises the Gecko handoff against a real headless Firefox
cargo test -- --ignored --nocapture
```