QWebEngine - how to catch execution of any javascripts from C++
-
I know how to communicate between C++ and Javascript in Qt WebEngine from this tutorial: https://myprogrammingnotes.com/communication-c-javascript-qt-webengine.html
But that is a case when I'm the author of loaded page so C++ and HTML parts are programmed by me. But is it possible to catch any javascript executed on any page loaded (like google.com etc)? Some kind of signal emitted when JS is executed so I could investigate function name and input args.
QWebEnginePage->QWebEngineScriptCollection->scripts()
return only my own injected scripts, it doesn't contain page scripts.Regards
-
It seems the QWebEngine topic is inactive. Maybe you should post your question on the stackoverflow.
-
@Kobid
As a general answer to the question as phrased, I would imagine the answer is "no". QtWebEngine is a wrapper to Chromium, and I don't think that is going to have a facility for "Some kind of signal emitted when JS is executed".However, if your purpose is to figure what is going on interactively when you are using it and have a look at arguments etc., you could use a JS debugger. See https://stackoverflow.com/questions/28681141/qtwebengine-debugging, which shows people bringing up the Developer Tools debugger or a FireBug one, or similar.