I am currently working on a web application, I have a JS logging mechanism that Handles Javascript error that are not caught by the js code inside the page. I am using windo
you can replace Error.prototype.toString in Opera!
window.onerror = function (msg) {
// send msg to http://errors.net/log.php, for example
(new Image()).src = 'http://errors.net/log.php?msg=' + encodeURIComponent(msg);
};
if (({}).toString.call(window.opera) === '[object Opera]') {
(function () {
var x = Error.prototype.toString;
Error.prototype.toString = function () {
var msg = '';
try {
msg = x.apply(this, arguments);
if (typeof (window.onerror) === "function") {
window.onerror(msg, typeof (this) === 'object' ? this.stack : '', '');
}
} catch (e) {}
return msg;
};
}());
}
seems, it doesn't work for Opera 11.50... only for early versions ...