# blenderweb **Repository Path**: xujintao1985/blenderweb ## Basic Information - **Project Name**: blenderweb - **Description**: A Blender add-on that docks a real, interactive web browser inside the Blender window (right-hand editor area). Pages are rendered in-process by Chromium through Qt WebEngine - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-30 - **Last Updated**: 2026-11-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: blender, plusin, Web ## README # Blender Embedded Web Browser A Blender add-on that docks a real, interactive web browser **inside the Blender window** (right-hand editor area). Pages are rendered in-process by Chromium through Qt WebEngine — the add-on never calls `webbrowser.open()` and never hands the URL to the operating system's external browser. ## Features - **Right-side dock** — splits the current editor and hosts the browser in the new right-hand area. - **Navigation** — URL bar, Enter to navigate, Back, Forward, Reload, Stop. Bare domains get `https://`; plain text falls back to a search query. - **Multiple tabs** — click **`+`** to open a new tab; every tab has its own address bar and navigation buttons. Each tab header has a close button, and right-clicking a link offers **Open link in new tab**. - **Browsing history** — every visited URL is persisted, searchable, double-click to revisit, with per-entry removal and clear-all. - **Favorites / bookmarks** — star button toggles the current page; the Favorites tab lists, filters and opens saved pages. - **Downloads** — right-click a link in the page and choose **Download link**, or use **Download this URL**. A save dialog selects the destination. The Downloads tab shows state and progress for every transfer. - **Download records** — persisted history of downloaded URLs, target path, received/total bytes and final state; double-click a record to open the file, right-click to re-download or clear records. - **Return to Blender** — the **Blender** toolbar button restores keyboard focus to Blender. - **Local-first** — history, bookmarks and download records are JSON files under Blender's user config; no cloud service is involved. ## Technology | Layer | Implementation | | --- | --- | | Blender integration | `bpy` operator registers a `VIEW_3D` sidebar panel, splits an editor area, and drives a `bpy.app.timers` callback at ~16 ms for geometry sync and Qt event processing. | | Browser engine | `PySide6` / `QtWebEngine` (Chromium). A dedicated `QWebEngineProfile` isolates cookies/cache, and `QWebEnginePage` handles navigation, history and downloads. | | Embedding | Win32 `SetParent` reparents the frameless Qt window into Blender's top-level HWND; `SetWindowPos` tracks the host area rectangle every tick. The content is drawn inside Blender, not in a separate browser process. | | Persistence | Thread-safe JSON stores (`history.json`, `bookmarks.json`, `downloads.json`) in `bpy.utils.user_resource('CONFIG', path='blender_web_browser')`. | | Packaging | `install.py` detects Store/regular Blender installations, copies the add-on (including a vendored PySide6 runtime) into the user add-on directory and installs a small startup script that enables the add-on automatically. | > **About "system browser core":** Qt WebEngine is a self-contained Chromium build — the same engine family used by Edge and Chrome. It is embedded in-process, which is what makes in-Blender rendering possible. The Windows machine is also checked for the Edge WebView2 runtime; the browser backend is isolated in `browser.py` so an alternative engine can be swapped in without touching the Blender UI code. ## Requirements - Windows 10/11, Blender 3.0 or newer (verified with **Blender 5.3, Microsoft Store edition**). - Bundled PySide6 6.12 + Qt WebEngine (already included in `blender_web_browser/vendor/` by the installer). - Python 3.9+ to run `install.py` (the add-on itself runs on Blender's embedded Python 3.13). ## Installation From this directory, run: ```bash python install.py ``` The script: 1. Looks for Blender under `C:\Program Files\WindowsApps\BlenderFoundation.Blender_*` (Microsoft Store) first, then regular installs, PATH and registry entries. 2. Reads the version from the install path (for example `5.3`). 3. Copies the add-on to: `%APPDATA%\Blender Foundation\Blender\\scripts\addons\blender_web_browser` 4. Writes a startup script that enables the add-on on launch. Useful options: ```bash python install.py --version 5.3 # override auto-detection python install.py --no-vendor # use a PySide6 you installed yourself python install.py --no-startup # enable the add-on manually instead ``` Manual alternative: copy the `blender_web_browser` folder into the add-on directory above, then in Blender open **Edit → Preferences → Add-ons → Install…** and select `__init__.py`. ## Usage 1. Start Blender. The add-on is enabled automatically by the startup script (otherwise enable **Embedded Web Browser** in Preferences → Add-ons). 2. In the 3D Viewport, open the **N** panel and select the **Web** tab. 3. Click **Open Embedded Browser**. The editor splits; the right side becomes the browser. 4. Type a URL in the address bar and press **Enter**. Use `◀`, `▶`, `⟳`, `■` for Back, Forward, Reload and Stop. 5. Click **★ / ☆** to bookmark the current page. 6. Click **History**, **Favorites** or **Downloads** to show the corresponding panel; type in the filter box to search. Double-click an item to open it. Right-click for extra actions. 7. Click **`+`** to open another tab; use the **×** on a tab header to close it. Right-click a link to open it in a new tab, copy its address or download it. 8. Right-click a link on a page and choose **Download link**, or use **Download this URL** from the same menu. Pick a destination in the save dialog and track progress in the **Downloads** tab. 9. Click **Blender** in the toolbar when you want Blender to regain keyboard focus; click **Close Browser** in the sidebar to shut down the embedded view. ## Data locations - Config and JSON records: `%APPDATA%\Blender Foundation\Blender\5.3\config\blender_web_browser\` - Default download folder: `...\blender_web_browser\downloads\` ## Uninstall Delete the `blender_web_browser` add-on folder and `blender_web_browser_autostart.py` from the Blender config directories listed above. To keep the browser data, leave the `blender_web_browser` config folder in place. ## Troubleshooting If clicking the button only splits the editor and the right side stays a 3D view, check the diagnostic log: ```text %TEMP%\blender_web_browser.log ``` It records browser-engine import errors, the Blender window handle, the split result, the host area rectangle and whether the Qt window was successfully attached as a child window. Attach `True` with a non-zero area size means the browser is docked; if attach is `False`, the add-on falls back to a topmost floating window placed over the area. If the area is reported as `0x0` right after a split, a right-side fallback rectangle is used until Blender computes the real area size. The browser is now created **before** the editor is split, so an engine failure no longer leaves an empty editor behind. Closing the browser calls `screen.area_close()` (with `area_join` as a fallback) on the host editor, so the split is actually removed and no empty divider is left behind. If links cannot be clicked or a black strip appears below the page: the embedded window clears `WS_EX_TOOLWINDOW` / `WS_EX_NOACTIVATE`, focuses the view on mouse press, and re-applies the size through Qt (not just Win32 `SetWindowPos`) so the WebEngine viewport follows the editor area. As a fallback, a left click on an `` element is detected with JavaScript and navigated from Python (Ctrl+click or `target="_blank"` opens a new tab), so links work even when WebEngine's own input routing is blocked by the embedded window. ## Known limitations - The Win32 window reparenting used for embedding is Windows-specific. On macOS/Linux the add-on loads but only the Blender-side panel appears. - Chromium's sandbox is disabled via `QTWEBENGINE_DISABLE_SANDBOX` because packaged Store applications can block sandboxed child processes. - Very high DPI / non-100% Windows scaling may require adjusting the area rectangle mapping in `win32util.py`. - DRM-protected or `X-Frame-Options` sites behave exactly as they do in a normal Chromium browser. ## Project layout ```text blender_web_browser/ __init__.py add-on registration, area split, lifecycle timer browser.py Qt WebEngine window, navigation, panels, downloads storage.py JSON persistence win32util.py Blender HWND discovery, parenting and geometry helpers vendor/ bundled PySide6 runtime (generated by the installer) install.py Blender detection + add-on installation README.md this document ```