Hello, I have made a small modification to QT's demo browser, by which I
change the sources of all images from the loaded HTML page using a custom
Javascript that I introduce in the loaded page through WebKit. My Javascript
just does that:

function changeImages () {
    newSource = "file:///c:/test.jpg";
    var images = document.getElementsByTagName("img")
    for (var i=0; i<images.length; i++) {
        image=images.item(i);
        image.src = newSource;
    }
}

I call this function in QT like that:

runScript(loadScript("myScript.js"), false);
runScript(QString("changeImages()");


It used to work well (until QT 4.4.3), but I've noticed that, after I've
compiled it with the latest QT 4.4.5 snapshots, it doesn't work anymore: it
does change the images src, but the change is not reflected in the browser.
However, if, instead of an image located in the local disk, I choose an
image located in a Web server (changing first line in the Javascript
function by something like: newSource = "http://anyserver/anyfile.jpg";), it
works!

So, my question is: is there now any kind of restrictions on Webkit's
implementation in QT 4.5 that forbids directly changing the image sources
with Javascript and pointing them to local files?

Thanks
_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to