Out of no where chrome.tabs.executeScript is undefined, I'm really not sure what happened, I rolled back almost everything that matters but still undefined, I posted a simple code where it's also not working, this code is from the background.js script, what am I missing?
chrome.alarms.onAlarm.addListener(async (alarm) => {
if (alarm.name == "CheckJobs") {
d4rTabId 0;
console.log('from cahce: '+d4rTabId);
chrome.tabs.create({ url: "https://stackoverflow.com/questions/66618167/chrome-extension-alarm-interval-working-after-a-while", active: false }, async tab => {
d4rTabId = tab.id;
console.log(d4rTabId);
chrome.tabs.executeScript(d4rTabId,
{
code: "document.title ='aaaa'"
})
});
}});
{
"name": "aaa",
"version": "0.0.1",
"manifest_version": 3,
"background": {
"service_worker":"background.js" //"bgjob2.js" //
},
"permissions": [
"tabs",
"alarms",
"activeTab",
//"background",
"storage"
//"identity",
//"identity.email"
],
"host_permissions": [
"http://*/",
"https://*/",
"*://*/*"
],
"icons": {
"16": "aaa.png",
"48": "aaaa.png",
"128": "aaaaa.png"
},
"action": {
"default_popup": "/popout/pop.html",
"default_title": "aaa"
},
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*",
"*://*/*"
],
"js": [
"jquery-3.6.0.slim.min.js"
]
}
]
}