So my issue is that I want to make a chrome extension to read the header and content of a webpage, but I am stuck at the initial stage of development, where this error shows up and the debug message doesn’t appear.
The code is as follows:
MANIFEST VERSION 3
content.js
(() => {
chrome.runtime.onMessage.addListener((obj, sender, response) => {
const { type, value } = obj;
if (type === "NEW") {
console.log("Hi");
newVideoLoaded();
response([]);
chrome.runtime.lastError ;
}
});
})();
background.js
chrome.tabs.onUpdated.addListener((tabId, tab) => {
if (tab.url && tab.url.includes("cnbc")) {
console.log("Hello world");
chrome.tabs.sendMessage(tabId, {
type : 'NEW',
value: ''
});
}
});
The error appears, and there is a similar question whose answers i tried but it didn’t work.
Please help!
I want to make a chrome extension to read the header and content of a webpage, but I am stuck at the initial stage of development, where this error shows up and the debug message doesn’t appear.