Portability
This page documents platform / backend specific behavior or oddities.
Saucer tries its best to make all backends behave the same, however, there are certain cases where the backend simply does not provide the required functionality or similar.
- Qt
- WebKitGtk
- MacOS / WebKit
- There is no way to specify a status code for custom schemes, thus the user specified one in
saucer::scheme::response
is ignored - Usage of JS
fetch
with custom schemes (and embedded files for that matter) is only possible since Qt 6.6 saucer::scheme::::response::headers
are only respected from Qt 6.7 onwardssaucer::scheme::request::content()
is only available from Qt 6.7 onwardssaucer::navigation
is only available from Qt 6.2 onwards- Force-Dark is only available from Qt 6.7 onwards
As GTK4 aims to be more compatible with Wayland, certain functionalities are currently missing:
- No support for window icons (
saucer::window::set_icon
does nothing) - There is no way to artificially focus the window (
saucer::window::focus()
does nothing) - There is no way to check whether or not a window is minimized
- GTK4 has no concept of a max-size
- Always-On-Top does not work
The saucer::preferences::storage_path
may behave unexpected on macOS.
WKWebView does not offer any way to store webview data to a specific file, instead it associates the data with a UUID through some opaque means.
Thus a UUID derived from the provided storage_path
is given to WKWebView.
- WKWebView provides no way to access favicons
- WKWebView does not allow to control hardware-acceleration
Browser Flags
It is possible to pass certain browser flags to the underlying webview through saucer::preferences::browser_flags
.
For all Chromium based webviews (Qt, WebView2) these can be usual chromium flags.
For WebKit based backends (WebKitGtk, WKWebView) these flags behave slightly different.
WebKitGtk Flags
WebKitGtk accepts browser-flags as key-value pairs in the following form: property=value
.
A list of available properties can be found in the webkitgtk documentation.
saucer::webview webview{{
.application = app,
.browser_flags = {"enable-javascript=false"},
}};
WKWebView Flags
The WebKit backend also accepts browser-flags as key-value pairs.
The available properties are all those of the WKWebViewConfiguration
and it's members.
saucer::webview webview{{
.application = app,
.browser_flags = {"upgradeKnownHostsToHTTPS=true", "defaultWebpagePreferences.allowsContentJavaScript=false",
"preferences.minimumFontSize=10", "applicationNameForUserAgent=\"Saucer App\""},
}};