I'm having trouble loading the background.js file. I feel like it's not loading the file at all, so I tried adding a console log but that isn't working either. Am I using background.js incorrectly?
chrome.tabs.onUpdated.addListener((_tabId, changeInfo, tab) => {
const { status } = changeInfo;
const { url, title } = tab;
if (status === "complete" && url && url.startsWith("http")) {
initStore();
store.update(STORE_KEY, history => {
history.sites = [...history.sites, siteGenerator(url, title)];
});
console.log("HISTORY: ", store.get(STORE_KEY));
}
console.log("ZZzHISTORY: ", store.get(STORE_KEY));
});
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxX");
{
"name": "Prototype",
"options_page": "options.html",
"background": {
"scripts": ["background.bundle.js"],
"persistent": true
},
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["contentscript.bundle.js"]
}
],
"browser_action": {
"default_popup": "popup.html",
"default_icon": "icon-34.png"
},
"icons": {
"128": "icon-128.png"
},
"manifest_version": 2,
"content_security_policy":
"script-src 'self' 'unsafe-eval'; object-src 'self'"
}
var options = {
entry: {
popup: path.join(__dirname, "src", "js", "popup.js"),
options: path.join(__dirname, "src", "js", "options.js"),
background: path.join(__dirname, "src", "js", "background.js"),
contentscript: "./src/js/contentscript.js"
},
chromeExtensionBoilerplate: {
notHotReload: ["contentscript", "background"]
},