I am trying to inject a content.js script in my chrome extension through my background.js file - I've added the "scripting" and "activeTab permission but it still says:
-"Uncaught TypeError: Cannot read properties of undefined (reading 'executeScript')"
//manifest.json
{
"name": "WeWatch",
"version": "1.0",
"manifest_version": 3,
"permissions": [
"tabs", "scripting","activeTab"
],
"background": {
"service_worker": "background.js"
},
"action":{
"default_icon":{
"16":"pics/logo.png",
"48":"pics/logo.png",
"128":"pics/logo.png"
},
"default_popup": "htmls/dif_popup.html",
"default_title": "WeWatch$"
}
}
+++++++++++++++++++++++++++++++++++++++++++
//background.js
function room_process(){
chrome.scriptng.executeScript(
{
target:{tabId: room[3]}, //room[3]=tabId
files:["content.js"]
}
);
}