0

I have been trying to use the commands API in my project but can't incorporate it into my project. I have included all the required information on my manifest.json file for commands object.

..............
...."commands":{
    "run-change-col": {
        "suggested_key":"Ctrl+Shift+0",
        "description":"Change color by using this key"
    },
    "run-restore-col": {
        "suggested-key": {
            "default":"Ctrl+Shift+1"
        },
        "description": "This is used to restore the old color"
    }
}...............

I want my alert prompt to run on the tab opened. But it's not working. Below is my background.js file.

chrome.commands.onCommand.addListener((command) => {
   alert(`Command ${command} has been called`);
});

I have tried reloading the extension but it is not working yet!!

m4n0
  • 27,411
  • 26
  • 71
  • 84
  • If this is ManifestV3, it can't use `alert` in service worker. Use [devtools](/a/10258029). – wOxxOm Oct 09 '21 at 06:19

0 Answers0