1

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.

0

1 Answer 1

2

You can use the QWebEngineScript to do this. It allows you to set an injection point and execution world for your script (similar to e.g. greasemonkey).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.