QtWebEngine-6.7.2

Introduction to QtWebEngine

QtWebEngine integrates chromium's web capabilities into Qt. It ships with its own copy of ninja which it uses for the build if it cannot find a system copy, and various copies of libraries from ffmpeg, icu, libvpx, and zlib (including libminizip) which have been forked by the chromium developers.

This package and browsers using it may be useful if you need to use a website designed for google chrome, or chromium, browsers.

[Warning]

Warning

QtWebEngine uses a forked copy of chromium, and is therefore vulnerable to many issues found there. The Qt developers seem to fork a newer version for minor Qt versions, but because chromium moves to newer versions very often, by the time the Qt developers get a forked version to pass their extended tests it is always an old version and security fixes from chromium (some of which have a CVE number) can take several months to appear in a QtWebengine release, even if the severity has been rated as Critical.

Therefore, you should be wary of using QtWebEngine in a sensitive context and should always update to the next release as soon as it appears in this book, even if is not flagged as a Security Update. Identifying which vulnerabilities have been fixed in a particular release requires pulling the appropriate 'based-NNN' branch just before the previous and current releases and is often impractical. Reports of fixed QTBUG items do not seem to be available and there is not any documentation in the tarball for changes after the qt-5 versions.

This package is known to build and work properly using an LFS 12.2 platform.

[Warning]

Warning

By default, ninja will use all online CPUs +2 (if at least 4 exist), even if they are not available to the current task because the build terminal has been restricted with 'taskset'. In BLFS, this package takes more time to build than any other. In one example, the build of this package crashed at about the 90 percent point due to an out of memory problem on a system with 24 cores and 32 GB of memory.

To work around this, see the Command Explanations below.

Package Information

Additional Downloads

qtwebengine Dependencies

Required

Cups-2.4.10, html5lib-1.1, nodejs-20.16.0, nss-3.103, pciutils-3.13.0, and Qt-6.7.2

Recommended

[Note]

Note

If these packages are not installed, the build process will compile and install its own (perhaps older) version, with the side effect of increasing build and installed disk space and build time.

Optional

libevent-2.1.12, MIT Kerberos V5-1.21.3, pipewire-1.2.3, Poppler-24.08.0, jsoncpp, libsrtp, snappy

Installation of qtwebengine

First, adapt the bundled copy of Chromium to the latest version of ffmpeg:

patch -Np1 -d src/3rdparty/chromium < ../qtwebengine-6.7.2-ffmpeg7_fixes-1.patch

Next, fix a build failure that occurs because the BLFS build of ffmpeg does not use OpenH264:

sed -e '189 s/=/& false/' \
    -e '190 d'            \
    -i.orig src/3rdparty/chromium/third_party/webrtc/webrtc.gni

Install qtwebengine by running the following commands:

mkdir build &&
cd    build &&

cmake -D CMAKE_MESSAGE_LOG_LEVEL=STATUS             \
      -D QT_FEATURE_webengine_system_ffmpeg=ON      \
      -D QT_FEATURE_webengine_system_icu=ON         \
      -D QT_FEATURE_webengine_system_libevent=ON    \
      -D QT_FEATURE_webengine_proprietary_codecs=ON \
      -D QT_FEATURE_webengine_webrtc_pipewire=ON    \
      -D QT_BUILD_EXAMPLES_BY_DEFAULT=OFF           \
      -G Ninja .. &&

ninja

This package does not come with a test suite.

Now, as the root user:

ninja install

Command Explanations

CMAKE_MESSAGE_LOG_LEVEL=STATUS: Output interesting messages that project users might be interested in. Ideally these should be concise, no more than a single line, but still informative.

QT_FEATURE_webengine_system_*: Specify what external packages the system should use.

QT_BUILD_EXAMPLES_BY_DEFAULT=OFF: Do not build examples by default.

NINJAJOBS=4 make: If you patched system ninja in LFS to recognize the NINJAJOBS environment variable, this command will run system ninja with the specified number of jobs (i.e. 4). There are several reasons why you might want to use options like this this:

  • Building on a subset of CPUs allows measuring the build time for a smaller number of processors, and/or running other CPU-intensive tasks at the same time. For an editor on a machine with a lot of CPUs, trying to measure the build time for a 4-CPU machine, NINJAJOBS=4 make will give a reasonable approximation (there is a short period where N+2 python and node jobs run).

  • On a machine with only 4 CPUs online, the default of scheduling N+2 jobs for qtwebengine is slower by between 3% and 7%, probably because of the size of the C++ files and their many includes and templates. Therefore, if in doubt set NINJAJOBS to the number of CPUs.

  • Reducing the number of cores being used on long running, CPU intensive packages may alleviate heat problems.

  • Reducing the number of cores will prevent potential out-of-memory problems on systems that do not have enough memory (or swap) when all cores are active. A suggested approach is to limit the number of cores to about one core for each 1.5 GB of combined RAM and swap space.

Configuring QtWebEngine

Configuration Information

If you are upgrading from an older minor version of this application, for some webpages to load you may need to clear the browser caches, e.g. for falkon they will be found in ~/.cache/falkon/. You will need to do this if the browser starts to render the page and then changes to a blank tab with a message that something went wrong, and a button to Retry. Even after removing the old caches, you may need to retry a few times for each affected tab.

If a browser using this package fails to run and when run from a term it reports 'Trace/breakpoint trap' that is probably a kernel configuration issue - there is no need to rebuild QtWebEngine, see the next section, recompile the kernel and reboot to the new kernel.

Kernel Configuration

This package does not require any of the optional kernel namespace items, but if User namespace is enabled (as happens in some unit files, for hardening) PID namespace must also be enabled. In that case enable the following options in the kernel configuration and recompile the kernel if necessary:

General setup --->
  -*- Namespaces support --->                                       [NAMESPACES]
    # Enable or disable *both* of them:
    [ /*] User namespace                                               [USER_NS]
    [ /*] PID Namespaces                                                [PID_NS]

Contents

Installed Programs: qtwebengine_convert_dict and QtWebEngineProcess (both in $QT6DIR/libexec)
Installed Libraries: libQt6Pdf.so, libQt6PdfQuick.so, libQt6PdfWidgets.so, libQt6WebEngineCore.so, libQt6WebEngineiQuick.so, libQt6WebEngineQuickDelegatesQml.so, and libQt6WebEngineWidgets.so
Installed Directories: $QT6DIR/include/QtPdf, $QT6DIR/include/QtPdfQuick, $QT6DIR/include/QtPdfWidgets, $QT6DIR/include/QtWebEngineCore, $QT6DIR/include/QtWebEngineQuick, $QT6DIR/include/QtWebEngineWidgets, $QT6DIR/qml/QtWebEngine, and $QT6DIR/translations/qtwebengine_locales

Short Descriptions

qtwebengine_convert_dict

converts hunspell dictionaries (.dic) to chromium format (.bdic)

QtWebEngineProcess

is a libexec program which runs a zygote process (one that listens for spawn requests from a master process and will fork itself in response)