In my Chrome v3 extention app I have changed chrome.tabs.executeScript to chrome.scripting.executeScript. Getting “No matching signature”, Tried to fix it but I was unable.
Please help me here to solve the error..!
Manifest:
{
"name": "OkBot",
"description": "OkBot is used as a Personal Asistant.",
"version": "1.1",
"manifest_version": 3,
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
},
"minimum_chrome_version": "88",
"offline_enabled": false,
"icons": {
"48": "web/images/icon_48.png",
"128": "web/images/icon_128.png"
},
"action": {
"default_icon": {
"19": "web/images/icon_19.png",
"38": "web/images/icon_38.png"
},
"default_title": "OkBot",
"default_popup": "popup.html"
},
"permissions": [
"idle",
"power",
"management",
"storage",
"tabs",
"activeTab",
"topSites",
"scripting"
],
"host_permissions": [
"*://*/*",
"<all_urls>"
],
"optional_permissions":[
],
"options_page": "options.html",
"background":{
"service_worker":"web/js/background.js"
},
"content_scripts": [
{
"js": ["web/js/content_script.js"],
"matches": ["<all_urls>", "*://*/*"]
}
]
}
OkBot.js Script:
chrome.scripting.executeScript(tabs[0].id, {file: "web/js/storage.js"}, function() {
if(chrome.runtime.lastError)
chrome.scripting.executeScript(tabs[0].id, {file: "web/js/content.js"}, function() {
if(chrome.runtime.lastError) {
console.error(chrome.runtime.lastError.message);
}
else
{
setTimeout(function(){
send_to_content(obj); // Then call send_to_content(obj) again after content.js injected
}, 300);
}
});
});
Error handling response: TypeError: Error in invocation of scripting.executeScript(scripting.ScriptInjection injection, optional function callback): No matching signature.