I have a context menu which calls a processSearch function when one of its items is selected:
browser.contextMenus.onClicked.addListener(processSearch);
Inside the processSearch function, I’ve got the following code:
browser.sidebarAction.isOpen({})
.then((isOpen)=>{
if (isOpen) browser.sidebarAction.close();
})
.catch((err)=>{
if (logToConsole) console.error(err);
});
I don’t understand why I’m getting the following error message because processSearch function is a user input handler:
Error: sidebarAction.close may only be called from a user input handler
Could this be a bug?