Skip to content

Commit 37a58bc

Browse files
authored
Revert "Fixes #1546 capture and display rejected promises"
1 parent b05ce99 commit 37a58bc

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

client/utils/consoleUtils.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,6 @@ export const hijackConsoleErrorsScript = (offs) => {
3838
}], '*');
3939
return false;
4040
};
41-
// catch rejected promises
42-
window.onunhandledrejection = function (event) {
43-
if (event.reason && event.reason.message && event.reason.stack){
44-
var errorNum = event.reason.stack.split('about:srcdoc:')[1].split(':')[0];
45-
var fileInfo = getScriptOff(errorNum);
46-
var data = event.reason.message + ' (' + fileInfo[1] + ': line ' + fileInfo[0] + ')';
47-
window.parent.postMessage([{
48-
log: [{
49-
method: 'error',
50-
data: [data],
51-
id: Date.now().toString()
52-
}],
53-
source: fileInfo[1]
54-
}], '*');
55-
}
56-
};
5741
`;
5842
return s;
5943
};
@@ -62,7 +46,7 @@ export const startTag = '@fs-';
6246

6347
export const getAllScriptOffsets = (htmlFile) => {
6448
const offs = [];
65-
const hijackConsoleErrorsScriptLength = 52;
49+
const hijackConsoleErrorsScriptLength = 36;
6650
const embeddedJSStart = 'script crossorigin=""';
6751
let foundJSScript = true;
6852
let foundEmbeddedJS = true;

0 commit comments

Comments
 (0)