i am currently working on a chrome extension that to work it need to grab the active tab's url and check if it is "siteName" and when I log's the result to check why it was not working it does say undefined.
I have tried the following line of code and i have searched on google and did not find anything else
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (changeInfo.url) {
console.log(changeInfo.url);
if (changeInfo.url.includes(siteName)) {
extensionActive = true;
} else {
extensionActive = false;
}
}
});
This is my manifest premisions
"manifest_version": 3,
"permissions": [
"background",
"webRequest",
"activeTab",
"pageCapture",
"unlimitedStorage"
],