Qt native WebView bridge with PySide6 bindings
Project description
FIT WebView Bridge
Description
FIT WebView Bridge is a cross‑platform Qt widget (C++/Objective‑C++) with PySide6 bindings that wraps the OS‑native web engines:
- Windows → Edge WebView2
- macOS → WKWebView
- Linux → WebKitGTK (with GStreamer for codecs)
It exposes a unified Python API for browser control and enables forensic viewing/capture of content, including media requiring proprietary codecs (e.g., H.264/AAC), without custom QtWebEngine builds or codec redistribution burdens (system codecs are used). All controls (UI and app logic) are delegated to the PySide window.
Why this project
QtWebEngine (Chromium) does not enable proprietary codecs by default, and redistributing them requires licensing. Alternatives (building QtWebEngine with codecs or using QtWebView/QML) have portability/control limitations. The chosen path is to leverage native engines, achieving codec compatibility and full control via a Python API.
Repository layout
fit-webview-bridge/
├─ CMakeLists.txt
├─ cmake/ # Find*.cmake, toolchains, helpers
├─ include/fitwvb/ # Public headers (API)
├─ src/
│ ├─ core/ # Facade / common interfaces
│ ├─ win/ # Edge WebView2 backend (C++)
│ ├─ macos/ # WKWebView backend (Obj-C++)
│ └─ linux/ # WebKitGTK backend (C++)
├─ bindings/pyside6/ # Shiboken6: typesystem & config
├─ tests/ # Unit / integration
└─ examples/ # Minimal PySide6 demo app
Interface (methods/slots + signals)
Methods / slots
load(url)back()forward()reload()stop()setHtml(html, baseUrl)evalJs(script, callback)
Signals
urlChanged(QUrl)titleChanged(QString)loadProgress(int)loadFinished(bool)consoleMessage(QString)
Note: the API is uniform across OSes; implementations delegate to the native engine.
Prerequisites
Common
- CMake (>= 3.24 recommended)
- Ninja (generator)
- Python 3.9+
- PySide6 and Shiboken6 (for Python bindings)
- Platform build toolchain
Windows
- MSVC (Visual Studio 2022 or Build Tools) and Windows SDK
- Microsoft Edge WebView2 Runtime
- WebView2 SDK (NuGet/vcpkg)
macOS
- Xcode + Command Line Tools
- Objective‑C++ enabled (.mm)
- Frameworks:
WebKit,Cocoa
Linux
- GCC/Clang,
pkg-config - WebKitGTK dev packages (e.g.,
webkit2gtk-4.1or distro equivalent) - GStreamer (base + required plugins for codecs)
Build (indicative)
git clone https://github.com/fit-project/fit-webview-bridge.git
cd fit-webview-bridge
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_PYSIDE6_BINDINGS=ON
cmake --build build
# (optional) ctest --test-dir build
Examples
PySide6 samples in examples/ demonstrate URL loading, JS injection, and signal handling.
Codec & licensing notes
The project does not redistribute proprietary codecs: it leverages codecs already provided by the OS. End‑user usage must comply with the relevant licenses/formats.
Project status
Initial/alpha (API subject to change).
Fit Web — Project rationale and options for proprietary codecs
Fit Web is the FIT project's scraper module designed to forensically acquire and preserve web content: https://github.com/fit-project/fit-web.
Like the other modules, Fit Web is based on PySide (Qt for Python). It currently uses QtWebEngine, which is a Chromium wrapper.
The problem
By default, Chromium does not enable proprietary audio/video codecs, notably H.264 and AAC.
Options considered
1) Build QtWebEngine with proprietary codecs
Enable the -webengine-proprietary-codecs option.
Documentation: https://doc.qt.io/qt-6/qtwebengine-overview.html
Drawbacks
- Must be done for all supported operating systems.
- The build requires very powerful machines (e.g., difficulties on a MacBook Air M2 with 16 GB RAM).
- Licensing: distributing H.264 and AAC requires a license.
2) Use QtWebView
QtWebView relies on the OS’s native web APIs; for proprietary‑codec content it uses the system’s codecs.
Pros: no custom builds, no direct license handling.
Cons: the UI layer is QML, geared toward lightweight (often mobile) UIs, so it doesn’t provide full browser control compared to QtWebEngine.
Documentation: https://doc.qt.io/qt-6/qtwebview-index.html
3) Implement a native Qt widget (C/C++) per OS
Develop a Qt widget (usable from PySide6) that embeds the system’s web engine:
- Windows → Edge WebView2
- macOS → WKWebView
- Linux → WebKitGTK (with GStreamer for codecs)
Advantages
- No redistribution licensing: leverage the codecs already provided by the OS.
- A common API can be exposed to PySide6.
- More control than QtWebView, without QML’s limitations.
Disadvantages
- Medium‑to‑high complexity to implement.
- Requires C++ and, on macOS, Objective‑C++.
- Requires custom CMake to include libraries and linking.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fit_webview_bridge-0.2.9a6.tar.gz.
File metadata
- Download URL: fit_webview_bridge-0.2.9a6.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5fe1395b32ea0b18d0f83d5491d4ff358b49bfece3cccc62000d74370da9c07
|
|
| MD5 |
22d75e31075d6e02d76583761906ecf3
|
|
| BLAKE2b-256 |
c7860191552a49add8547d5a52fb476537027bf1f62c8612199505dad82ebd0e
|
File details
Details for the file fit_webview_bridge-0.2.9a6-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: fit_webview_bridge-0.2.9a6-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 92.4 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f50028c70533035266b288029f989ea1729ce5f2758eb95d5a0028dee87cbd9
|
|
| MD5 |
c3b243ae1e7eeaedc49dd989450d8c9a
|
|
| BLAKE2b-256 |
bbd0b1800631cc86550d5d0545187606d90988737fdc9b346e119b5fc95c07f2
|
File details
Details for the file fit_webview_bridge-0.2.9a6-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: fit_webview_bridge-0.2.9a6-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 92.4 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f172acedfc532f881c47105e88380251c2d85ece9cc48fb2549ee578a8dfed9b
|
|
| MD5 |
ba1572ab1e52340b6b04a8e9061851f5
|
|
| BLAKE2b-256 |
fd8924d0c50cab4a229f489c2c47242e1cb15c2f4af806944849551333994555
|
File details
Details for the file fit_webview_bridge-0.2.9a6-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: fit_webview_bridge-0.2.9a6-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 92.4 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e1d373ae5d6a79b0570a6cbf6635ce7301f484cdbb4c25619d0b705137112e4
|
|
| MD5 |
12e63bb121acdda738466bbbe87352f3
|
|
| BLAKE2b-256 |
4b5ab4101fd3f51e6b586e08c1ddadb6a82898a43e41eb2f80a38bca8471ad0a
|