File tree Expand file tree Collapse file tree 1 file changed +31
-17
lines changed Expand file tree Collapse file tree 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) => {
2828 var fileInfo = getScriptOff(lineNumber);
2929 data = msg + ' (' + fileInfo[1] + ': line ' + fileInfo[0] + ')';
3030 }
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+ }, '*');
3946 return false;
4047 };
4148 // catch rejected promises
@@ -44,14 +51,21 @@ export const hijackConsoleErrorsScript = (offs) => {
4451 var errorNum = event.reason.stack.split('about:srcdoc:')[1].split(':')[0];
4552 var fileInfo = getScriptOff(errorNum);
4653 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+ }, '*');
5569 }
5670 };
5771 ` ;
@@ -62,7 +76,7 @@ export const startTag = '@fs-';
6276
6377export const getAllScriptOffsets = ( htmlFile ) => {
6478 const offs = [ ] ;
65- const hijackConsoleErrorsScriptLength = 52 ;
79+ const hijackConsoleErrorsScriptLength = 66 ;
6680 const embeddedJSStart = 'script crossorigin=""' ;
6781 let foundJSScript = true ;
6882 let foundEmbeddedJS = true ;
You can’t perform that action at this time.
0 commit comments