Skip to content

Commit 640df47

Browse files
committed
comment and clean onUpdated function
1 parent 131e26d commit 640df47

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/extension/background.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ chrome.runtime.onConnect.addListener(port => {
181181

182182
// background.js recieves message from contentScript.js
183183
chrome.runtime.onMessage.addListener((request, sender) => {
184-
console.log('this is request from background', request)
185184
// IGNORE THE AUTOMATIC MESSAGE SENT BY CHROME WHEN CONTENT SCRIPT IS FIRST LOADED
186185
if (request.type === 'SIGN_CONNECT') {
187186
return true;
@@ -346,11 +345,10 @@ chrome.tabs.onRemoved.addListener(tabId => {
346345

347346
// when a new url is loaded on the same tab, this remove the tabid from the tabsObj, recreate the tab and inject the script
348347
chrome.tabs.onUpdated.addListener((tabId, changeInfo) => {
349-
console.log('this is tabId from background on Updates', tabId)
350-
console.log('this is changeInfo from background on Updates', changeInfo)
351-
console.log('this is tabsObj[tabId].title from background on Updates', tabsObj[tabId].title)
348+
349+
// check if the tab title changed to see if tab need to restart
352350
if (changeInfo.title && changeInfo.title !== tabsObj[tabId].title){
353-
console.log('need restart tab object')
351+
354352
// tell devtools which tab to delete
355353
if (portsArr.length > 0) {
356354
portsArr.forEach(bg =>

0 commit comments

Comments
 (0)