diff --git a/conference.js b/conference.js index e8523f1f8..447859c5b 100644 --- a/conference.js +++ b/conference.js @@ -316,8 +316,18 @@ export default { this.roomName = options.roomName; JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.TRACE); - // attaches global error handler - window.onerror = JitsiMeetJS.getGlobalOnErrorHandler; + // attaches global error handler, if there is already one, respect it + if(JitsiMeetJS.getGlobalOnErrorHandler){ + var oldOnErrorHandler = window.onerror; + window.onerror = function (message, source, lineno, colno, error) { + + JitsiMeetJS.getGlobalOnErrorHandler( + message, source, lineno, colno, error); + + if(oldOnErrorHandler) + oldOnErrorHandler(message, source, lineno, colno, error); + }; + } return JitsiMeetJS.init(config).then(() => { return Promise.all([