No description
| Makefile | ||
| README.md | ||
| WebApp.c | ||
WebApp
Minimal C web browser launcher. Downloads the site favicon as the app/taskbar icon. Two compile-time backends: Qt6 WebEngine (default) or WebKit2GTK.
Quick start
make # Qt6 WebEngine (default)
make USE_WEBENGINE=0 # WebKit2GTK
sudo make install # install to /usr/local/bin
Usage
./WebApp [OPTIONS] <URL> [TITLE]
| Option | Description |
|---|---|
--cache |
Cache favicon + title in ~/.cache/<app>/. On subsequent runs, loads from cache instead of scraping. |
--desktop |
Create a .desktop launcher on the user's app menu. Requires a title (from scraping, cache, or [TITLE] arg). Warns but does not fail if no icon is found. |
The application name is autodetected from argv[0]. To change it, rename the source file — the Makefile derives TARGET automatically, and all banners / usage / titles follow.
Examples
# Open a site with scraped favicon and title
./WebApp 192.168.3.194:8080
# Force a custom title
./WebApp 192.168.3.194:8080 "Open WebUI"
# Cache the favicon for faster subsequent launches
./WebApp --cache 192.168.3.194:8080
# Generate a desktop launcher
./WebApp --cache --desktop 192.168.3.194:8080
Build targets
| Target | Command |
|---|---|
| Qt6 WebEngine (default) | make or make webengine |
| WebKit2GTK | make USE_WEBENGINE=0 or make webkit |
| WebEngine with sandbox | make sandbox |
| WebEngine without sandbox | make nosandbox (default) |
| WebEngine with GPU | make gpu or make USE_GPU=1 |
| WebEngine with GPU + no sandbox | make gpu DISABLE_SANDBOX=1 |
| Clean | make clean |
| Install | sudo make install |
| Uninstall | sudo make uninstall |
Dependencies
Qt6 WebEngine path
sudo apt install qt6-webengine-dev libcurl4-openssl-dev g++
WebKit2GTK path
sudo apt install libgtk-3-dev libwebkit2gtk-4.1-dev libcurl4-openssl-dev
Session persistence (Qt6 WebEngine)
Login sessions, cookies, and localStorage persist across restarts under:
~/.local/share/WebApp/WebApp/
How it works:
- A custom
QWebEngineProfile(notdefaultProfile) is created with an explicitsetPersistentStoragePath. Qt6 only guarantees persistence paths on explicitly created profiles. - Cookies are forced persistent via
ForcePersistentCookies. - On window close, the view/page is destroyed first, then a 2.5 s flush delay gives Chromium's IO thread time to sync the Cookies SQLite file and IndexedDB to disk before the process exits.
If sessions are not persisting, clear the profile directory and rebuild:
rm -rf ~/.local/share/WebApp/WebApp
make clean && make USE_WEBENGINE=1
Notes
- Bare-IP URLs (e.g.
192.168.3.194:8080) are auto-normalized withhttp://prefix. - The sandbox is disabled by default (
DISABLE_SANDBOX=1) for compatibility on many systems. Re-enable withmake sandbox. - GPU acceleration is disabled by default (
USE_GPU=0) for headless/VM compatibility. Enable withmake USE_GPU=1. Sandbox and GPU flags are independent — combine freely (e.g.make USE_GPU=1 DISABLE_SANDBOX=0). - WebKit2GTK renders via GTK's software stack — no GPU toggle applies.
- Single source file, zero config. Just edit
WebApp.cand runmake.