Skip to main content

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.

  • 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 onwards
  • saucer::scheme::request::content() is only available from Qt 6.7 onwards
  • saucer::navigation is only available from Qt 6.2 onwards
  • Force-Dark is only available from Qt 6.7 onwards

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.

Example: Disable JavaScript
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.

Example: WebKit Browser-Flags
saucer::webview webview{{
.application = app,
.browser_flags = {"upgradeKnownHostsToHTTPS=true", "defaultWebpagePreferences.allowsContentJavaScript=false",
"preferences.minimumFontSize=10", "applicationNameForUserAgent=\"Saucer App\""},
}};