@@ -35,7 +35,13 @@ const pruneAxTree = (axTree) => {
3535
3636 if ( ! name ) {
3737 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+ }
3945 } else {
4046 name = { value : 'visible node with no name' } ;
4147 }
@@ -59,7 +65,6 @@ const pruneAxTree = (axTree) => {
5965 axArr . push ( axNode ) ;
6066 }
6167 }
62- console . log ( 'axArr: ' , axArr ) ;
6368 return axArr ;
6469} ;
6570
@@ -113,21 +118,13 @@ async function axRecord(tabId) {
113118}
114119
115120async function replaceEmptySnap ( tabsObj , tabId , toggleAxRecord ) {
116- console . log (
117- 'background.js: top of replaceEmptySnap: tabsObj[tabId]:' ,
118- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
119- ) ;
120121 if ( tabsObj [ tabId ] . currLocation . axSnapshot === 'emptyAxSnap' && toggleAxRecord === true ) {
121122 // add new ax snapshot to currlocation
122123 const addedAxSnap = await axRecord ( tabId ) ;
123124 tabsObj [ tabId ] . currLocation . axSnapshot = addedAxSnap ;
124125 // modify array to include the new recorded ax snapshot
125126 tabsObj [ tabId ] . axSnapshots [ tabsObj [ tabId ] . currLocation . index ] = addedAxSnap ;
126127 }
127- console . log (
128- 'background.js: bottom of replaceEmptySnap: tabsObj[tabId]:' ,
129- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
130- ) ;
131128}
132129
133130// This function will create the first instance of the test app's tabs object
@@ -366,10 +363,7 @@ chrome.runtime.onConnect.addListener((port) => {
366363 tabsObj [ tabId ] . index = 1 ; //reset index
367364 tabsObj [ tabId ] . currParent = 0 ; // reset currParent
368365 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+
373367 return true ; // return true so that port remains open
374368
375369 case 'setPause' : // Pause = lock on tab
@@ -405,8 +399,6 @@ chrome.runtime.onConnect.addListener((port) => {
405399 tabId,
406400 } ) ,
407401 ) ;
408- } else {
409- console . log ( 'background.js: portsArr.length < 0' ) ;
410402 }
411403 return true ; // return true so that port remains open
412404
@@ -460,21 +452,12 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
460452 break ;
461453 }
462454 case 'jumpToSnap' : {
463- console . log (
464- 'background.js: top of jumpToSnap: tabsObj[tabId]:' ,
465- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
466- ) ;
467455 changeCurrLocation ( tabsObj [ tabId ] , tabsObj [ tabId ] . hierarchy , index , name ) ;
468456 // hack to test without message from mainSlice
469457 // toggleAxRecord = true;
470458 // record ax tree snapshot of the state that has now been jumped to if user did not toggle button on
471459 await replaceEmptySnap ( tabsObj , tabId , toggleAxRecord ) ;
472460
473- console . log (
474- 'background.js: bottom of jumpToSnap: tabsObj[tabId]:' ,
475- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
476- ) ;
477-
478461 // sends new tabs obj to devtools
479462 if ( portsArr . length > 0 ) {
480463 portsArr . forEach ( ( bg ) =>
@@ -484,9 +467,7 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
484467 tabId,
485468 } ) ,
486469 ) ;
487- } else {
488- console . log ( 'background.js: portsArr.length < 0' ) ;
489- }
470+ }
490471
491472 if ( portsArr . length > 0 ) {
492473 portsArr . forEach ( ( bg ) =>
@@ -543,13 +524,6 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
543524 break ;
544525 }
545526 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-
553527 const sourceTab = tabId ;
554528 tabsObj [ tabId ] . webMetrics = metrics ;
555529
@@ -572,10 +546,7 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
572546 tabsObj [ tabId ] ,
573547 new HistoryNode ( tabsObj [ tabId ] , request . payload , addedAxSnap ) ,
574548 ) ;
575- console . log (
576- 'background.js: bottom of recordSnap: tabsObj[tabId]:' ,
577- JSON . parse ( JSON . stringify ( tabsObj [ tabId ] ) ) ,
578- ) ;
549+
579550 if ( portsArr . length > 0 ) {
580551 portsArr . forEach ( ( bg ) =>
581552 bg . postMessage ( {
@@ -595,13 +566,11 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
595566 tabsObj [ tabId ] ?. currLocation ?. stateSnapshot ?. children [ 0 ] ?. componentData ?. actualDuration ;
596567 const incomingSnap = request . payload . children [ 0 ] . componentData . actualDuration ;
597568 if ( previousSnap === incomingSnap ) {
598- console . log ( 'background.js: previousSnap===incomingSnap' ) ;
599569 break ;
600570 }
601571
602572 // Or if it is a snapShot after a jump, we don't record it.
603573 if ( reloaded [ tabId ] ) {
604- console . log ( 'background.js: reloaded[tabId]' ) ;
605574 // don't add anything to snapshot storage if tab is reloaded for the initial snapshot
606575 reloaded [ tabId ] = false ;
607576 } else {
@@ -622,12 +591,6 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
622591 tabsObj [ tabId ] ,
623592 new HistoryNode ( tabsObj [ tabId ] , request . payload , addedAxSnap ) ,
624593 ) ;
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]' ) ;
631594 }
632595 }
633596
@@ -640,8 +603,6 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
640603 sourceTab,
641604 } ) ,
642605 ) ;
643- } else {
644- console . log ( 'background.js: portsArr.length < 0' ) ;
645606 }
646607 break ;
647608 }
0 commit comments