====================================================================== MU-QTBROWSER v0.0.4g - Lightweight IPC-coupled & Tabbed Web Container ====================================================================== https://forum.puppylinux.com/viewtopic.php?t=17682 -------------------------------------------------------------------------------------------------------------------------------- 1. WHAT IS IT AND WHAT IS IT GOOD FOR? ---------------------------------------------------------------------- mu-qtbrowser is a modular, high-performance web container architecture specifically designed for lightweight Linux desktop environments like IceWM, Openbox, or Fluxbox (such as Linux Mint, antiX, MX Linux, or Puppy Linux). It offers two core paradigms tailored for low-RAM systems (e.g., 2 GB RAM devices): 1. **IPC-Coupled Suite (`mu-browser` + `mu-controller`)**: Decouples the heavy Chromium rendering engine from a lightweight Vala/GTK3 toolbar via UNIX domain sockets. 2. **Low-RAM Tabbed Variant (`mu-browser-tabs`)**: A pure, lightning-fast C++/Qt6 multi-tab browser supporting up to 10 tabs, automated session restore, and minimal memory overhead without IPC communication overhead. Additionally, `mu-browser` can be run standalone as a single-window web container. 2. ARCHITECTURE & TECHNOLOGIES ---------------------------------------------------------------------- - Backend (`mu-browser`): C++ / Qt6 (QWebEngineView) with internal QLocalServer for multi-instance IPC, custom context menu, X11 window layer positioning, and an interactive mini-editor to generate `.desktop` launchers on-the-fly. - Tabbed Browser (`mu-browser-tabs`): C++ / Qt6 multi-tab container (max 10 tabs) with automatic `session.json` persistence, integrated bookmark manager, and low-RAM footprint. - Controller (`mu-controller`): Vala / GTK3 native toolbar communicating via UNIX sockets. - Launcher Wrapper (`launch-mu-browser.sh`): Manages socket cleanup and startup sequence. 3. MAJOR ACHIEVEMENTS & FEATURES (v0.0.2) ---------------------------------------------------------------------- - Link Navigation & History Fix: Automatic JavaScript injection strips `target` attributes (`_blank`, `_new`) on load, preventing broken history states and ensuring first-click back/forward functionality. - Custom Qt Context Menu: Replaced default Chromium context menu with a reliable custom menu offering Back, Forward, Reload, Toolbar Toggle, and Exit. - Interactive Desktop Launcher Editor: One-click "📌 .desktop" button opens a dialog to customize window geometry, titles, frameless state, X11 layers, and save directly to the Desktop or `~/.local/share/applications`. - Low-RAM Tabbed Variant (`mu-browser-tabs`): Supports up to 10 tabs, shortcut keys (`Ctrl+T`, `Ctrl+W`), and automated session state recovery (`session.json`). - Persistent Bookmark Management: Full Qt-based GUI to add, edit, and delete bookmarks stored as clean JSON (`bookmarks.json`). - Multi-Instance Support: Dynamic unique UNIX domain socket naming (`--socket`) preventing IPC collision issues. - X11 Window Layers: Full support for desktop background, below, and above window types. 4. SHELL SCRIPT SUPPORT & COMMAND-LINE OPTIONS ---------------------------------------------------------------------- Both `mu-browser` and `mu-browser-tabs` feature extensive command-line argument support for fine-grained window control, positioning, and layering: * `--url ` or `-u `: Set the initial web address (default: `https://schinkenpizza.de`). * `--pos ` or `-p `: Specify window screen coordinates (e.g., `100,50`). * `--size ` or `-s `: Set initial window dimensions (e.g., `1280x720`). * `--frameless`: Launch in borderless/frameless window mode (`Qt::FramelessWindowHint`). * `--hide-toolbar`: Start with the top control toolbar hidden. * `--layer `: Set X11 window manager stacking layer hints. * `--socket ` (mu-browser only): Custom UNIX domain socket path or name for isolated IPC communication. ### Wrapper Script (`launch-mu-browser.sh`) The provided shell script automates the full IPC suite startup: 1. Cleans up stale UNIX domain socket files from `/tmp`. 2. Launches the C++/Qt6 backend (`mu-browser`) with background process management. 3. Waits for socket readiness. 4. Spawns the Vala/GTK3 frontend controller (`mu-controller`), ensuring that terminating either process gracefully closes the entire session. 5. BUILD AND INSTALLATION COMMANDS ---------------------------------------------------------------------- To compile all components (`mu-browser`, `mu-browser-tabs`, `mu-controller`): make To install binaries, wrapper script, and desktop entries system-wide (requires root): sudo make install To build a Debian package (`.deb`): make deb To build a Puppy Linux PET package (`.pet`): make pet To clean up build files: make clean 6. USAGE EXAMPLES ---------------------------------------------------------------------- Launch complete browser suite (Backend + GTK Controller): ./launch-mu-browser.sh Launch standalone Qt6 browser without GTK Controller: ./build/mu-browser --url "https://schinkenpizza.de" Launch low-RAM tabbed browser variant: ./build/mu-browser-tabs --url "https://schinkenpizza.de" Launch isolated frameless desktop layer instance (Backend): ./build/mu-browser --socket /tmp/browser1.sock --url "https://example.com" --pos 100,100 --size 800x600 --frameless --hide-toolbar --layer desktop Connect Vala controller to specific instance socket: ./mu-controller /tmp/browser1.sock 7. SHELL COMMAND CONTROL & IPC ---------------------------------------------------------------------- You can control any running mu-browser instance directly from the shell by passing the instance socket and a command or raw JSON payload to `mu-controller`: - Reload page: mu-controller /tmp/mu-browser-SOCKET_ID.sock reload - Navigate to URL: mu-controller /tmp/mu-browser-SOCKET_ID.sock '{"cmd":"navigate","url":"https://example.com"}' - Toggle control toolbar: mu-controller /tmp/mu-browser-SOCKET_ID.sock toggle-toolbar - Go back / forward: mu-controller /tmp/mu-browser-SOCKET_ID.sock back mu-controller /tmp/mu-browser-SOCKET_ID.sock forward - Quit browser instance: mu-controller /tmp/mu-browser-SOCKET_ID.sock quit 8. CHANGELOG ---------------------------------------------------------------------- Version 0.0.7 introduces comprehensive improvements focused on UI consistency, robust anti-bot handling for Google services, and advanced customization options for lightweight desktop environments. Key Highlights & Improvements Google Anti-Bot & CSP Compatibility Fix: Strips Chrome Client Hints while enforcing a Firefox User-Agent across all Google domains, permanently resolving bot blocks ("This browser or app may not be secure") and CSP issues with gstatic.com scripts. Precise UI Scaling (50% to 250%): Implements seamless font scaling and uniform height alignment across all toolbar elements—including back/forward arrows, input fields, and dropdowns—ensuring a clean, symmetrical layout. Independent Tab Font Scaling: Adds a dedicated control in the settings menu to adjust the tab bar font size separately from general UI elements. True Dark Mode & Custom Scrollbars: Injects a true dark theme (#121212) and sleek custom dark scrollbars directly into web pages via a robust DOM MutationObserver. Stable Context Menu: Features a robust WebEngine context menu equipped with standard Qt icons for image editors (GIMP/mtPaint), link handling, and tab navigation, fully compatible with lightweight window managers (IceWM, Fluxbox). Scrollable Settings Dialog: Organizes all browser configurations within a compact QScrollArea to ensure effortless navigation and visibility. v0.0.6 - added a third variant, mu-browser-desktop for machines >2 GB RAM - no tab limit, open in new tab, Changelog Version 006 represents a major evolution for the desktop browser, introducing robust architectural enhancements and highly requested user features. The application has been migrated from the shared default profile to a dedicated, persistent MuDesktopProfile stored under the local data location. This ensures session isolation and guarantees permanent cookie and password storage. Persistent cookie enforcement has been explicitly enabled alongside isolated SQLite database paths to permanently resolve recurrent session losses and annoying cookie consent resets like Google consent banners, supported by proactive directory creation checks before profile startup. Several practical UI components and customization options have also been added. A dedicated tab navigator combo box now sits next to the tab bar, allowing you to instantly jump to any open tab by its full title when tabs become too crowded to read. You can now configure a freely selectable homepage stored persistently in the configuration file, accessible via a new toolbar home button or directly through a "Set as Homepage" entry in the context menu. A clean native browser settings dialog is now available via right-click, letting you manage your homepage, true black dark mode, and strict privacy flags from one central place. File operations and downloading are fully functional through a native Linux file dialog handler connected to WebEngine profile requests, successfully enabling "Save Page As..." and standard file downloads. Finally, the privacy configuration has been made toggleable through the settings dialog and a command-line flag, allowing you to activate or deactivate strict privacy settings that disable telemetry and network pings on demand without breaking bot-sensitive web platforms. v0.0.5 - contextmenu toggle darkmode - contextmenu hide tabbar - contextmenu hide toolbar - contextmenu toggle fullscreen - support for youtube and hopefully other players to use their fullscreen mode v0.0.4g: Google Login Fix (Gemini final) - WORKING STATE, DO NOT TOUCH THE UA ANYMORE! - Google Login Fix (Gemini final): Chrome/124.0.0.0 for all hosts, Firefox/130.0 ONLY for all Google domains (google.com, google.de, gstatic.com, googleapis.com, googleusercontent.com, incl. accounts.*, myaccount.*, etc.), via QWebEngineUrlRequestInterceptor. - Client-Hints conflict fixed: For Google domains, the Chrome Client Hints are cleared (Sec-CH-UA, Sec-CH-UA-Mobile, Sec-CH-UA-Platform, Sec-CH-UA-Full-Version, Sec-CH-UA-Arch, Sec-CH-UA-Bitness, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version = ""). Otherwise Google sees: "Firefox identity with Chrome signature" -> "This browser or app may not be secure". Catching only accounts.google.com is not enough, Google redirects across dozens of subdomains. - The interceptor is registered in main() directly after profile creation, BEFORE the first page load. Order matters. - NO Chrome/131, NO Sec-CH-UA spoofing, NO userAgentData spoofing. These "improvements" made Google even more suspicious. - IMPORTANT - DO NOT TEST WITH OTHER UAs ANYMORE: Every UA change in a short time (same IP, same device, same account, but 102 / 131 / 124 / Firefox within a few hours) looks like bot / account takeover to Google. Google then flags device/account SERVER-SIDE, not just in local cookies. After that, even v0.0.2, which worked before, stops working. - Recovery after flagging: Fresh profile (--profile-dir /tmp/mu-fresh-test), test once, then leave it alone. Ideally 12-24h pause before the test. Deleting storage alone is not enough (rm -rf ~/.local/share/mu-qtbrowser/storage + cache). Do not reuse the old flagged profile. - Back up the working state: Copy main.cpp / main_tabs.cpp as *.GOOGLE-WORKING, back up binaries. New tests only with a separate --profile-dir, never with the good profile. - Back button fix stays: Only same-host links lose their target (target="_new" / "_blank" on schinkenpizza.de), cross-site popups (logins) stay. Via loadFinished + runJavaScript, no QWebEngineScriptCollection (does not build on Qt 6.4). - Qt 6.4 compatibility: No QWebEngineSettings::globalSettings() (Qt 5 only), no NotificationsEnabled (only from Qt 6.7). #include "main.moc" / "main_tabs.moc" is at the very end of the file. - Wrong line in CustomWebPage class removed: installSameHostTargetFixOnPage(page); must ONLY appear in functions after ->setNewPageFactory(...), not in the class definition. v0.0.4 - 0.0.4f (intermediate states, DO NOT USE anymore): - 0.0.4: Shared profile for both binaries, SpellCheck off, renderer-process-limit=3, 32 MB memory cache, no autoplay. target=_blank is NO LONGER stripped globally (logins need popups). - 0.0.4b: Qt 6.4 fixes (see above). - 0.0.4c/d: Same-host target fix (back button) + runJavaScript instead of ScriptCollection. - 0.0.4e/f: BROKEN intermediate states (Chrome/131 + Sec-CH-UA and userAgentData spoofing) - broke Google login. Do not use. v0.0.2: - Added low-RAM tabbed browser variant (`mu-browser-tabs`) supporting up to 10 tabs, session restore (`session.json`), and shortcut keys (`Ctrl+T`, `Ctrl+W`). - Added built-in interactive Qt desktop launcher editor dialog with full window configuration options. - Added persistent bookmark management dialog with JSON storage (`bookmarks.json`). - Added explicit "Exit" option in the custom context menu for frameless and kiosk modes. - Fixed back button history behavior by stripping target attributes (`_blank`, `_new`, etc.) via JS injection. - Replaced native Qt context menu to resolve code view lockup issue. - Improved reload reliability via JS window location re-assignment. - Added Vala POSIX process monitoring (`--pkg posix`) to automatically close GTK controller on backend termination. - Added `mu-browser-standalone.desktop` and `mu-browser-tabs.desktop` entries. - Added multi-instance support via dynamic unique UNIX domain socket naming (--socket). - Added CLI parameters: --url, --pos, --size, --frameless, --hide-toolbar, --layer, --socket. - Added X11 window layer management (_NET_WM_WINDOW_TYPE_DESKTOP, BELOW, ABOVE). v0.0.1: - Initial release with basic IPC socket communication between Qt backend and GTK3 controller. 9. LICENSE ---------------------------------------------------------------------- This software is licensed under the **GNU General Public License v2.0 or later (GPLv2+)**. Developed collaboratively by Mark and Gemini. Enjoy lightweight web browsing! ======================================================================