File tree 1 file changed +31
-17
lines changed
1 file changed +31
-17
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,21 @@ export const hijackConsoleErrorsScript = (offs) => {
28
28
var fileInfo = getScriptOff(lineNumber);
29
29
data = msg + ' (' + fileInfo[1] + ': line ' + fileInfo[0] + ')';
30
30
}
31
- window.parent.postMessage([{
32
- log: [{
33
- method: 'error',
34
- data: [data],
35
- id: Date.now().toString()
36
- }],
37
- source: fileInfo[1]
38
- }], '*');
31
+ window.parent.postMessage(
32
+ {
33
+ source: fileInfo[1],
34
+ messages: [
35
+ {
36
+ log: [
37
+ {
38
+ method: 'error',
39
+ data: [data],
40
+ id: Date.now().toString()
41
+ }
42
+ ]
43
+ }
44
+ ]
45
+ }, '*');
39
46
return false;
40
47
};
41
48
// catch rejected promises
@@ -44,14 +51,21 @@ export const hijackConsoleErrorsScript = (offs) => {
44
51
var errorNum = event.reason.stack.split('about:srcdoc:')[1].split(':')[0];
45
52
var fileInfo = getScriptOff(errorNum);
46
53
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
- }], '*');
54
+ window.parent.postMessage(
55
+ {
56
+ source: fileInfo[1],
57
+ messages: [
58
+ {
59
+ log: [
60
+ {
61
+ method: 'error',
62
+ data: [data],
63
+ id: Date.now().toString()
64
+ }
65
+ ]
66
+ }
67
+ ]
68
+ }, '*');
55
69
}
56
70
};
57
71
` ;
@@ -62,7 +76,7 @@ export const startTag = '@fs-';
62
76
63
77
export const getAllScriptOffsets = ( htmlFile ) => {
64
78
const offs = [ ] ;
65
- const hijackConsoleErrorsScriptLength = 52 ;
79
+ const hijackConsoleErrorsScriptLength = 66 ;
66
80
const embeddedJSStart = 'script crossorigin=""' ;
67
81
let foundJSScript = true ;
68
82
let foundEmbeddedJS = true ;
You can’t perform that action at this time.
0 commit comments