Skip to content

Commit 49aeced

Browse files
Haider AliHaider Ali
authored andcommitted
intial attempt
1 parent e7b51da commit 49aeced

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/extension/background.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,13 @@ chrome.runtime.onConnect.addListener((port) => {
293293
Again, this port object is used for communication within your extension, not for communication with external ports or tabs in the Chrome browser. If you need to interact with specific tabs or external ports, you would use other APIs or methods, such as chrome.tabs or other Chrome Extension APIs.
294294
*/
295295
portsArr.push(port); // push each Reactime communication channel object to the portsArr
296-
296+
console.log('in background.js on line 296');
297297
// sets the current Title of the Reactime panel
298298
if (portsArr.length > 0 && Object.keys(tabsObj).length > 0) {
299+
console.log(JSON.stringify('portsArr'));
300+
console.log(portsArr);
301+
console.log('activeTab');
302+
console.log(activeTab);
299303
portsArr.forEach((bg, index) => {
300304
// go through each port object (each Reactime instance)
301305
bg.postMessage({
@@ -381,6 +385,7 @@ chrome.runtime.onConnect.addListener((port) => {
381385
return true; // return true so that port remains open
382386

383387
case 'launchContentScript':
388+
if (tab.url?.startsWith("chrome://")) return undefined;
384389
chrome.scripting.executeScript({
385390
target: { tabId },
386391
files: ['bundles/content.bundle.js'],
@@ -526,6 +531,7 @@ chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
526531
htmlBody.appendChild(script);
527532
};
528533

534+
if (tab.url?.startsWith("chrome://")) return undefined;
529535
chrome.scripting.executeScript({
530536
target: { tabId },
531537
func: injectScript,

0 commit comments

Comments
 (0)