[Qtwebengine] Override chrome flags to disalbe hardware-media-key-handling

Florian Bruhin me at the-compiler.org
Fri May 22 15:41:01 CEST 2020

Hey Elias,

On Thu, May 21, 2020 at 06:35:18PM +0200, Elias Steurer wrote:
> This can be disabled in chrome via :
>  * chrome://flags/#hardware-media-key-handling
> But I have not found a way to disable this behaviour in the QWebEngine
> anywhere. Is there a way to do this in c++ or via some settings config?

For many commandline flags handled by Chromium, you can pass them to a
QtWebEngine application as well, and the underlying Chromium will pick them up.

Searching for "hardware-media-key-handling" in Chromium's sources[1][2],
looking at the available switches[2] and a bit of guessing/knowledge tells me
that the chrome://flags setting actually passes this:


Passing the same to a Qt application or setting it via
QTWEBENGINE_CHROMIUM_FLAGS[4] seems to work fine from a quick test I did.


[1] https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/about_flags.cc;l=4513-4516;drc=569eadfb101f995a921b894e3923cbb20d921239
[2] https://source.chromium.org/chromium/chromium/src/+/master:media/base/media_switches.cc;l=481-482;drc=46d7f22a530aed9c6bfdf2cfdba496e481e2e658
[3] https://peter.sh/experiments/chromium-command-line-switches/
[4] https://doc.qt.io/qt-5/qtwebengine-debugging.html#using-command-line-arguments

me at the-compiler.org (Mail/XMPP) | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/qtwebengine/attachments/20200522/eb059005/attachment.sig>

More information about the QtWebEngine mailing list