I want to make a chrome extension where I can use key commands on specific pages (Eg: "Ctrl+Shift+A") which then triggers some DOM manipulation code (such as clicking a button).
But the issue I am facing is that "chrome.commands" runs in the background environment (background property in manifest.json) and If I include "chrome.commands.onCommand" in content_scripts (inside manifest.json) I get this error.
Uncaught TypeError: Cannot read property 'onCommand' of undefined
.
How do I make it work?