I'm trying to understand why Firefox (I'm using 15 but it's the same even in nightly) is not behaving like WebKit when trying to access error event information.
This one works everywhere:
window.onerror = function(message, lineno, filename) { }
But of course I don't want to use this.
The right thing to do is:
window.addEventListener('error', function(e) {
console.log(e.message);
}, false);
Unfortunately this one only works in WebKit. In Firefox the handler is called, but the e
event is almost empty: no message, no line number, no filename properties.
The very minimal test is here: http://jsbin.com/efexiw/1/edit
I don't think this is a bug, though... so the question is: how do I get the error details in recent Firefox?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…