For the development of my PyQt5 browser project, I read here that by passing Chrome flags as application arguments, they will automatically be passed onto the QtWebEngineProcess.exe
when it gets launched by the code. I have tried doing app = QApplication(sys.argv + [--enable-force-dark])
, but this doesn't make the chromium render the web pages in dark mode (I have also tries lots of variations of the flag name, so I assume this isn't the problem).
I am wondering whether it is possible to manually call the QtWebEngineProcess.exe
with custom flags set, from the PyQt5 code by inheriting a class and overriding a function, and connecting the QtWebEngineView
to this class, so like ...("QtWebEngineProcess.exe -[1st flag] -[2nd flag"])
?
If the above method is not possible, is there any other way to use chromium with custom flags in the QtWebEngineView
? I am running PyQt5.14.2 (Chromium 77), Python 3.8.0, Windows 10