Trying to make my setter for innerHTML:
var oldDescr = Object.getOwnPropertyDescriptor(Element.prototype, "innerHTML"); Object.defineProperty(Element.prototype, 'innerHTML', { set: function(htmlVal) { document.write("CATCH!"); oldDescr.set.call(this, htmlVal); } }); document.getElementById("foobar").innerHTML = "HEHE"; Everything works in FF 39, Chrome 43. I take examples from the Qt 5.4 bundle (browser / fancybrowser) - my setter is not called. How can I do what I want for QtWebkit?
PS: this is an ancient bug in WebKit that didn't seem to be fixed in QtWebkit: https://code.google.com/p/chromium/issues/detail?id=13175