PDA

View Full Version : QWebEngineProfile question.



ayanda83
11th December 2016, 11:31
So I have this QWebEnginePage object that loads a web page and I linked it to this QWebEngineProfile object where I have injected JavaScripts for the page object. The scripts are suppose to run on page loadFinished signal, which is working just fine. The intention is to run certain javascripts on the webpage's home page and completely different javascripts when I redirect to a different link on the page but it seems like the scripts that are loaded on the profile object will run regardless of what web page is currently opened. I there a way to avoid this?

anda_skoa
11th December 2016, 11:50
The goal of the script collection in the profile is to inject them into all pages that share this profile, if you trigger them on all pages is up to you.
Alternatively the scripts themselves could check if the should run given the current page's context.

Cheers,
_