1
1
// Import snapshots from "../app/components/snapshots".
2
2
import 'core-js' ;
3
+
4
+ console . log ( 'Hello from line 4' ) ;
3
5
// Store ports in an array.
4
6
const portsArr = [ ] ;
5
7
const reloaded = { } ;
@@ -123,6 +125,7 @@ function changeCurrLocation(tabObj, rootNode, index, name) {
123
125
124
126
// Establishing incoming connection with devtools.
125
127
chrome . runtime . onConnect . addListener ( port => {
128
+ console . log ( 'Hello from line 126' ) ;
126
129
// port is one end of the connection - an object
127
130
// push every port connected to the ports array
128
131
portsArr . push ( port ) ;
@@ -199,6 +202,7 @@ chrome.runtime.onConnect.addListener(port => {
199
202
return true ;
200
203
case 'launchContentScript' :
201
204
// !!! in Manifest Version 3 this will need to be changed to the commented out code below !!!
205
+ console . log ( 'Youre here' ) ;
202
206
chrome . scripting . executeScript ( {
203
207
target : { tabId } ,
204
208
files : [ 'bundles/content.bundle.js' ] ,
@@ -220,6 +224,7 @@ chrome.runtime.onConnect.addListener(port => {
220
224
221
225
// background.js listening for a message from contentScript.js
222
226
chrome . runtime . onMessage . addListener ( ( request , sender , sendResponse ) => {
227
+ console . log ( 'Hello from line 224' ) ;
223
228
// AUTOMATIC MESSAGE SENT BY CHROME WHEN CONTENT SCRIPT IS FIRST LOADED: set Content
224
229
if ( request . type === 'SIGN_CONNECT' ) {
225
230
return true ;
@@ -282,19 +287,21 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
282
287
// This injects a script into the app that you're testing Reactime on,
283
288
// so that Reactime's backend files can communicate with the app's DOM.
284
289
case 'injectScript' : {
290
+ console . log ( 'Hello from line 287' ) ;
285
291
chrome . scripting . executeScript ( {
286
292
target : { tabId } ,
287
- func : ( ) => {
293
+ func : tab => {
288
294
const injectScript = ( file , tag ) => {
289
295
const htmlBody = document . getElementsByTagName ( tag ) [ 0 ] ;
290
296
const script = document . createElement ( 'script' ) ;
291
297
script . setAttribute ( 'type' , 'text/javascript' ) ;
292
298
script . setAttribute ( 'src' , file ) ;
293
- document . title = tabId + '-' + document . title ;
299
+ document . title = tab + '-' + document . title ;
294
300
htmlBody . appendChild ( script ) ;
295
301
} ;
296
302
injectScript ( chrome . runtime . getURL ( 'bundles/backend.bundle.js' ) , 'body' ) ;
297
303
} ,
304
+ args : [ tabId ] ,
298
305
} ) ;
299
306
// chrome.tabs.executeScript(tabId, {
300
307
// code: `
0 commit comments