@@ -19,23 +19,10 @@ chrome.runtime.onConnect.addListener((port) => {
19
19
// if snapshots were saved in the snapshots,
20
20
// send it to devtools as soon as connection to devtools is made
21
21
if ( Object . values ( tabsObj ) [ 0 ] . snapshots . length > 0 ) {
22
- // later we want to send the entire tabsObj to devTools
23
- // but currently since devTools can only handle one tab at a time
24
- // we will test our obj assuming that the user opened only one tab
25
- // below is what we want the postMessage to look like eventually
26
- // ---------------------------------------------------------------
27
22
bg . postMessage ( {
28
23
action : 'initialConnectSnapshots' ,
29
24
payload : tabsObj ,
30
25
} ) ;
31
- // ---------------------------------------------------------------
32
- // bg.postMessage({
33
- // action: 'initialConnectSnapshots',
34
- // payload: {
35
- // snapshots: Object.values(tabsObj)[0].snapshots,
36
- // mode: Object.values(tabsObj)[0].mode,
37
- // },
38
- // });
39
26
}
40
27
41
28
// receive snapshot from devtools and send it to contentScript
@@ -98,9 +85,6 @@ chrome.runtime.onMessage.addListener((request, sender) => {
98
85
99
86
const { persist } = tabsObj [ tabId ] . mode ;
100
87
101
- console . log ( 'request: ' , request )
102
- console . log ( 'sender: ' , sender )
103
-
104
88
switch ( action ) {
105
89
case 'tabReload' :
106
90
tabsObj [ tabId ] . firstSnapshot = true ;
@@ -114,13 +98,6 @@ chrome.runtime.onMessage.addListener((request, sender) => {
114
98
// don't add anything to snapshot storage if mode is persisting for the initial snapshot
115
99
if ( ! persist ) tabsObj [ tabId ] . snapshots . push ( request . payload ) ;
116
100
if ( bg ) {
117
- // bg.postMessage({
118
- // action: 'initialConnectSnapshots',
119
- // payload: {
120
- // snapshots: tabsObj[tabId].snapshots,
121
- // mode: tabsObj[tabId].mode,
122
- // },
123
- // });
124
101
console . log ( 'connecting' ) ;
125
102
bg . postMessage ( {
126
103
action : 'initialConnectSnapshots' ,
@@ -134,10 +111,6 @@ chrome.runtime.onMessage.addListener((request, sender) => {
134
111
135
112
// send message to devtools
136
113
if ( bg ) {
137
- // bg.postMessage({
138
- // action: 'sendSnapshots',
139
- // payload: tabsObj[tabId].snapshots,
140
- // });
141
114
bg . postMessage ( {
142
115
action : 'sendSnapshots' ,
143
116
payload : tabsObj ,
0 commit comments