Commit a4c53efdf159ff329387d9b20da95321f118faa6
Exists in
master
and in
1 other branch
Merge pull request #630 from yujiosaka/master
call old onerror when it's already defined
Showing
1 changed file
with
4 additions
and
1 deletions
Show diff stats
public/javascripts/notifier.js
... | ... | @@ -1171,13 +1171,16 @@ printStackTrace.implementation.prototype = { |
1171 | 1171 | } |
1172 | 1172 | }; |
1173 | 1173 | |
1174 | + var oldOnerror = window.onerror; | |
1174 | 1175 | window.onerror = function (message, file, line, code, error) { |
1175 | 1176 | setTimeout(function () { |
1176 | 1177 | var e = error || {stack: '()@' + file + ':' + line} |
1177 | 1178 | e.message = message |
1178 | 1179 | new Notifier().notify(e); |
1179 | 1180 | }, 0); |
1180 | - | |
1181 | + if (oldOnerror) { | |
1182 | + return oldOnerror(message, file, line, code, error); | |
1183 | + } | |
1181 | 1184 | return true; |
1182 | 1185 | }; |
1183 | 1186 | })(); | ... | ... |