How to pass parameters to Chromium in QtWebEngine

We have talked about programming with Qt WebEngine. Every time you create a QWebEngineView object, you’ll start a QtWebEngineProcess.exe process. The process corresponds to the Chromium browser Qt WebEngine is based on. Chromium is a complex browser with a number of features. It can be controlled with various flags or options. How to specify the options or flags for Chromium? You’ve two choices:

  • Pass the flags as the arguments of your application, e.g., .\yourprogram.exe –ignore-certificate-errors –ignore-ssl-errors –log-level=3. Your program does not need or handle these parameters. But when your program starts the  QtWebEngineProcess.exe process, these parameters will be passed to it to control the behavior of Chromium,i.e, ignoring the certification error, outputting less log information,etc. By default, chromium will output a lot of log information likeERROR:ssl_client_socket_impl.cc(1050)] handshake failed; returned -1, SSL error code 1, net_error -100

    These are not fatal errors and can be ignored in most cases. Use proper Chromium flags to  suppress the error messages and make a clean output.

  • Create an environment variable QTWEBENGINE_CHROMIUM_FLAGS containing the flags you want to pass to chromium, i.e.,QTWEBENGINE_CHROMIUM_FLAGS=–ignore-certificate-errors –ignore-ssl-errors –log-level=3

 

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Leave a Reply