On a web page, I tried to create a URL bar for a IFrame element(on the page) which URL is on the same origin. I could catch 'load' event on iframe, but some page like phpmyadmin does not fire load event but fire Ready State Change event. I tried to cache "readystatechange" event like below:
var newFrame = document.createElement("iframe");
newFrame.setAttribute("src", url);
...
newFrame.addEventListener('load', function(){
newFrame.contentDocument.addEventListener('readystatechange', function(ev){
console.log('readystatechange', ev);
});
});
But, this does not work. I cannot catch the "readystatechange" event. Is there any way to catch the "readystatechange" event of the iframe ?