I do not observe the problem when using your project but I had this problem before and the solution was to write the javaScriptConsoleMessage()
method, eliminating the default behavior.
from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
class WebEnginePage(QtWebEngineWidgets.QWebEnginePage):
def javaScriptConsoleMessage(self, level, msg, line, sourceID):
pass
if __name__ == '__main__':
import sys
app = QtWidgets.QApplication(sys.argv)
view = QtWebEngineWidgets.QWebEngineView()
page = WebEnginePage(view)
view.setPage(page)
view.load(QtCore.QUrl("https://www.google.com/"))
view.show()
sys.exit(app.exec_())
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…