I would like to evaluate JavaScript before page's document is constructed and its scripts evaluated, in essence emulating Page.addScriptToEvaluateOnNewDocument of Chrome Devtools Protocol.
I tried to evaluate the JS code on loadStarted and loadProgress events of QWebEngineView but the script was evaluated only after page fully loaded.