While migrating from manifest v2 to v3 facing issue(chrome.action.onClicked.addListener not working/invoking).
I have a manifest.json defined like this
{
"name": "dummy",
"manifest_version": 3,
"version": "5.2.0",
"version_name": "5.2.0",
"description": "The dummy v5.2.0 plugin allows our users to gain instant access to
their metadata and data.",
"action": {
"default_title": "execute.js will run (watch the Chrome DevTools' console)"
},
"content_scripts": [
{
"js": ["content.js"],
"matches": [
"https://*/*",
"http://*/*"
]
}
],
"background": {
"service_worker": "background.js"
},
"permissions": [
"contextMenus",
"tabs",
"scripting",
"storage"
],
"host_permissions": [
"https://*/*",
"http://*/*"
],
"web_accessible_resources": [{
"resources": ["*.html"],
"matches": ["https://*/*","http://*/*"]}]}
and background.js file has this code
chrome.action.onClicked.addListener(function (tab) {
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
setDomain({ tab: tabs[0] });
});});
I'm really lost here and it's extremely hard to debug.This code was working before migrating to manifest v3.