Skip to content
Advertisement

how to suppress console output from QWebEngineView errors?

I get the following error if I create a QWebEngineView instance from Python instances in different working directories:

JavaScript
JavaScript

enter image description here

It seems this is a known issue and will be fixed in QT6: https://bugreports.qt.io/browse/QTBUG-66014

But in the meantime, how can I suppress this message? I tried changing QtCore.qInstallMessageHandler and also x.page().javaScriptConsoleMessage = lambda self, level, msg, line, sourceID: None, neither affected this message.

Advertisement

Answer

One possible solution is to raise the level of the chromium log:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement