@@ -35,7 +35,13 @@ const pruneAxTree = (axTree) => {
35
35
36
36
if ( ! name ) {
37
37
if ( ignored ) {
38
- name = { value : `ignored node: ${ ignoredReasons [ 0 ] . name } ` } ;
38
+ // name = { value: 'ignored node'};
39
+ if ( ignoredReasons . length ) {
40
+ name = { value : `ignored node: ${ ignoredReasons [ 0 ] . name } ` } ;
41
+ }
42
+ else {
43
+ name = { value : 'ignored node' } ;
44
+ }
39
45
} else {
40
46
name = { value : 'visible node with no name' } ;
41
47
}
@@ -59,7 +65,6 @@ const pruneAxTree = (axTree) => {
59
65
axArr . push ( axNode ) ;
60
66
}
61
67
}
62
- console . log ( 'axArr: ' , axArr ) ;
63
68
return axArr ;
64
69
} ;
65
70
@@ -113,21 +118,13 @@ async function axRecord(tabId) {
113
118
}
114
119
115
120
async function replaceEmptySnap ( tabsObj , tabId , toggleAxRecord ) {
116
- console . log (
117
- 'background.js: top of replaceEmptySnap: tabsObj[tabId]:' ,
118
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
119
- ) ;
120
121
if ( tabsObj [ tabId ] . currLocation . axSnapshot === 'emptyAxSnap' && toggleAxRecord === true ) {
121
122
// add new ax snapshot to currlocation
122
123
const addedAxSnap = await axRecord ( tabId ) ;
123
124
tabsObj [ tabId ] . currLocation . axSnapshot = addedAxSnap ;
124
125
// modify array to include the new recorded ax snapshot
125
126
tabsObj [ tabId ] . axSnapshots [ tabsObj [ tabId ] . currLocation . index ] = addedAxSnap ;
126
127
}
127
- console . log (
128
- 'background.js: bottom of replaceEmptySnap: tabsObj[tabId]:' ,
129
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
130
- ) ;
131
128
}
132
129
133
130
// This function will create the first instance of the test app's tabs object
@@ -366,10 +363,7 @@ chrome.runtime.onConnect.addListener((port) => {
366
363
tabsObj [ tabId ] . index = 1 ; //reset index
367
364
tabsObj [ tabId ] . currParent = 0 ; // reset currParent
368
365
tabsObj [ tabId ] . currBranch = 1 ; // reset currBranch
369
- console . log (
370
- 'background.js: bottom of emptySnap: tabsObj[tabId]:' ,
371
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
372
- ) ;
366
+
373
367
return true ; // return true so that port remains open
374
368
375
369
case 'setPause' : // Pause = lock on tab
@@ -405,8 +399,6 @@ chrome.runtime.onConnect.addListener((port) => {
405
399
tabId,
406
400
} ) ,
407
401
) ;
408
- } else {
409
- console . log ( 'background.js: portsArr.length < 0' ) ;
410
402
}
411
403
return true ; // return true so that port remains open
412
404
@@ -460,21 +452,12 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
460
452
break ;
461
453
}
462
454
case 'jumpToSnap' : {
463
- console . log (
464
- 'background.js: top of jumpToSnap: tabsObj[tabId]:' ,
465
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
466
- ) ;
467
455
changeCurrLocation ( tabsObj [ tabId ] , tabsObj [ tabId ] . hierarchy , index , name ) ;
468
456
// hack to test without message from mainSlice
469
457
// toggleAxRecord = true;
470
458
// record ax tree snapshot of the state that has now been jumped to if user did not toggle button on
471
459
await replaceEmptySnap ( tabsObj , tabId , toggleAxRecord ) ;
472
460
473
- console . log (
474
- 'background.js: bottom of jumpToSnap: tabsObj[tabId]:' ,
475
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
476
- ) ;
477
-
478
461
// sends new tabs obj to devtools
479
462
if ( portsArr . length > 0 ) {
480
463
portsArr . forEach ( ( bg ) =>
@@ -484,9 +467,7 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
484
467
tabId,
485
468
} ) ,
486
469
) ;
487
- } else {
488
- console . log ( 'background.js: portsArr.length < 0' ) ;
489
- }
470
+ }
490
471
491
472
if ( portsArr . length > 0 ) {
492
473
portsArr . forEach ( ( bg ) =>
@@ -543,13 +524,6 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
543
524
break ;
544
525
}
545
526
case 'recordSnap' : {
546
- console . log (
547
- 'background.js: top of recordSnap: tabsObj[tabId]:' ,
548
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
549
- ) ;
550
-
551
- console . log ( 'background.js: recordSnap case: toggleAxRecord:' , toggleAxRecord ) ;
552
-
553
527
const sourceTab = tabId ;
554
528
tabsObj [ tabId ] . webMetrics = metrics ;
555
529
@@ -572,10 +546,7 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
572
546
tabsObj [ tabId ] ,
573
547
new HistoryNode ( tabsObj [ tabId ] , request . payload , addedAxSnap ) ,
574
548
) ;
575
- console . log (
576
- 'background.js: bottom of recordSnap: tabsObj[tabId]:' ,
577
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
578
- ) ;
549
+
579
550
if ( portsArr . length > 0 ) {
580
551
portsArr . forEach ( ( bg ) =>
581
552
bg . postMessage ( {
@@ -595,13 +566,11 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
595
566
tabsObj [ tabId ] ?. currLocation ?. stateSnapshot ?. children [ 0 ] ?. componentData ?. actualDuration ;
596
567
const incomingSnap = request . payload . children [ 0 ] . componentData . actualDuration ;
597
568
if ( previousSnap === incomingSnap ) {
598
- console . log ( 'background.js: previousSnap===incomingSnap' ) ;
599
569
break ;
600
570
}
601
571
602
572
// Or if it is a snapShot after a jump, we don't record it.
603
573
if ( reloaded [ tabId ] ) {
604
- console . log ( 'background.js: reloaded[tabId]' ) ;
605
574
// don't add anything to snapshot storage if tab is reloaded for the initial snapshot
606
575
reloaded [ tabId ] = false ;
607
576
} else {
@@ -622,12 +591,6 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
622
591
tabsObj [ tabId ] ,
623
592
new HistoryNode ( tabsObj [ tabId ] , request . payload , addedAxSnap ) ,
624
593
) ;
625
- console . log (
626
- 'background.js: bottom of recordSnap: tabsObj[tabId]:' ,
627
- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
628
- ) ;
629
- } else {
630
- console . log ( 'background.js: tabsObj[tabId][index]' ) ;
631
594
}
632
595
}
633
596
@@ -640,8 +603,6 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
640
603
sourceTab,
641
604
} ) ,
642
605
) ;
643
- } else {
644
- console . log ( 'background.js: portsArr.length < 0' ) ;
645
606
}
646
607
break ;
647
608
}
0 commit comments