# WebTop Turn any website into a Windows desktop executable. Bundles the site inside a CEF-based runtime with an optional built-in AdBlocker [![Platform](https://img.shields.io/badge/Platform-Windows-blue?style=for-the-badge)](https://github.com/Louiml/WebTop) [![License](https://img.shields.io/badge/License-MIT-green?style=for-the-badge)](LICENSE) --- #### **Core Tech Stack** [![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)](https://www.rust-lang.org) [![C++](https://img.shields.io/badge/c++-%2300599C.svg?style=for-the-badge&logo=c%2B%2B&logoColor=white)](https://isocpp.org) [![Qt](https://img.shields.io/badge/Qt-%23217346.svg?style=for-the-badge&logo=qt&logoColor=white)](https://www.qt.io) [![CEF](https://img.shields.io/badge/CEF-Chromium%20Embedded-blue?style=for-the-badge)](https://bitbucket.org/chromiumembedded/cef/src/master/) ---
## Features ### Website-to-App Conversion * Simple GUI with website URL, app name, output folder, and AdBlocker toggle * CLI with the same options as the GUI: `--url`, `--out`, `--name`, `--no-adblock` * Generated apps are standalone executables with the URL baked in via config injection ### Built-in AdBlocker * Bundled EasyList snapshot, parsed and matched against every network request * Per-app toggle: enable AdBlocker at build time, or disable it with `--no-adblock` * Cosmetic rules (`##`) are ignored in this release; network rules (`||`, `@@||`, `^`) are supported ### Generated App Experience * Navigation toolbar with Back / Forward / Reload * System-tray icon with Show / Hide / Quit * Per-app persistent cache and cookies at `%APPDATA%\WebTop\\` --- ## Getting Started ### Prerequisites * **Visual Studio 2022** (MSVC, x64) * **CMake**: 3.20+ * **Qt 6** (Widgets, Concurrent) * **Rust**: 1.75+ * **Internet access** on first build (CEF download) ### Quickstart ```powershell # Clone repository git clone https://github.com/Louiml/WebTop.git cd WebTop # Download CEF + build the runtime stub .\scripts\build_stub.ps1 # Configure and build the builder (GUI + CLI) cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH= cmake --build build --config Release # Launch the GUI builder .\build\Release\webtop_builder.exe # Or use the CLI directly .\core\target\release\webtop_cli.exe --url https://example.com --out C:\Apps --name Example ``` The output folder will contain `.exe` plus the CEF runtime files (`libcef.dll`, `locales/`, `Resources/`, etc.). Run `.exe` to launch your site as a desktop app. --- ## Project Layout ``` webtop/ ├── core/ Rust core (FFI lib + CLI). Patches stub, copies CEF, emits output. ├── builder/ Qt6 GUI front-end (C++). Calls Rust via FFI; CLI passthrough. ├── runtime/ CEF runtime stub (C++). Reads embedded config, blocks requests. ├── scripts/ CEF download, stub build, EasyList refresh, CEF bundle. └── dist/ Built stub.bin + bundled CEF runtime files. ``` ## How It Works The Rust core appends a blob to a copy of `stub.bin`: ``` [ stub.exe ] [ u64 cfg_len ][ cfg_json ] url, app_name, adblock [ u64 flt_len ][ easylist text ] [ u64 blob_offset ][ "WBAPP\0\0\0" ] 16-byte trailer ``` The generated exe reads its own file at startup, locates the `WBAPP` magic trailer at EOF, and deserializes the config + EasyList filters. If AdBlocker is enabled, `CefResourceRequestHandler::OnBeforeResourceLoad` cancels any request whose URL matches an EasyList network rule. ## Notes / Limitations * **Windows only** (CEF binary distribution x64) * Single-folder output (~200 MB per app due to CEF runtime files) * AdBlocker matching is a simplified subset of EasyList (no regex, no `$third-party` / `$domain=` options yet) * Tray icon uses the default application icon