several IE11 fixes avoiding or working around javascript errors

This commit is contained in:
Ralf Becker
2014-02-19 15:10:39 +00:00
parent 2f8b7064d8
commit b692346cce
3 changed files with 25 additions and 8 deletions

View File

@ -283,8 +283,16 @@ egw.extend('debug', egw.MODULE_GLOBAL, function(_app, _wnd) {
// bind to global error handler
jQuery(_wnd).on('error', function(e)
{
// originalEvent does NOT exist in IE
// originalEvent does NOT always exist in IE
var event = typeof e.originalEvent == 'object' ? e.originalEvent : e;
// IE(11) gives a syntaxerror on each pageload pointing to first line of html page (doctype).
// As I cant figure out what's wrong there, we are ignoring it for now.
if (navigator.userAgent.match(/Trident/i) && typeof event.name == 'undefined' &&
Object.prototype.toString.call(event) == '[object ErrorEvent]' &&
event.lineno == 1 && event.filename.indexOf('/index.php') != -1)
{
return false;
}
log_on_client('error', [event.message], typeof event.stack != 'undefined' ? event.stack : null);
raise_error();
// rethrow error to let browser log and show it in usual way too