jiveaxe
24th February 2010, 16:19
Hi,
can anybody help me to solve this problem? I would like to apply a javascript on a web page while is loading so that the final webpage is a modified version of the remote one. The script to apply is:
(function () {
dl=document.links;
for(i=0;i<dl.length;++i){
if(dl[i].href.substr(-4)==".pdf"){
dl[i].href="http://docs.google.com/viewer?url="+dl[i].href;
}
}
})();
I have seen that QWebFrame has evaluateJavaScript but I don't know how to use it (if it's the right way!)
Any tips?
Best regards
can anybody help me to solve this problem? I would like to apply a javascript on a web page while is loading so that the final webpage is a modified version of the remote one. The script to apply is:
(function () {
dl=document.links;
for(i=0;i<dl.length;++i){
if(dl[i].href.substr(-4)==".pdf"){
dl[i].href="http://docs.google.com/viewer?url="+dl[i].href;
}
}
})();
I have seen that QWebFrame has evaluateJavaScript but I don't know how to use it (if it's the right way!)
Any tips?
Best regards