I know one can add event listener for window.error.
However when working with Iframes, each iframe has its own window element, and window.error
iframe
window.error
This might work.
function myHandler(msg, url, line){ //do stuff here... } //hook in all frames... function addErrorHandler(win, handler){ win.onerror = handler; for(var i=0;i