I'm making a browser extension and i want it to check a certain value whenever the user clicks on its icon in the toolbar. I've tried
browser.browserAction.onClicked.addListener(() => {
//code goes here
})
But it doesn't work. Is there any way to run a specific function whenever the user clicks on the toolbar icon?