1

i have been trying to make a chrome extension to run every time a site changes without any success, i saw somewhere that i need to listen to chrome.tabs.onUpdated from a background process but it never prints anything

my manifest file

{
"manifest_version": 3,
"name": "run",
"version":"0.1",
"background": {
    "sevice_worker":"background.js"
},
"content_scripts":[{
    "matches":["<all_urls>"],
    "js":["content.js"]
}],
"action":{
    "default_popup":"popup.html"
},
"permissions":["tabs","activeTab"]
}

background.js

chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
console.log("changes fired from background.js");
});

content.js (this gets logged but just once during initial reload)

console.log("--------------------------------");
console.log("fired from content");
console.log("--------------------------------");

how would i get around doing this?

Brijraj
  • 33
  • 1
  • 5
  • In the same screen where you go to load your unpacked extension, there is a section for "Inspect Views service worker". Click on that and it will open the console for the background/service worker script – BoxedFruits Aug 13 '23 at 20:20

0 Answers0