Skip to content

Commit 6601e7f

Browse files
committed
Fix handling console.error() with multiple arguments
1 parent aff2ec8 commit 6601e7f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

content.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,13 @@ new function() {
117117

118118
// handle console.error()
119119
var consoleErrorFunc = window.console.error;
120-
window.console.error = function(text) {
121-
consoleErrorFunc.call(console, text);
122-
handleUserError(text);
120+
window.console.error = function() {
121+
var argsArray = [];
122+
for(var i in arguments) { // because arguments.join() not working! oO
123+
argsArray.push(arguments[i]);
124+
}
125+
consoleErrorFunc.apply(console, argsArray);
126+
handleUserError(argsArray.join(' '));
123127
};
124128

125129
// handle uncaught errors

0 commit comments

Comments
 (0)