As far as I can tell, the following is impossible, the API doesn’t provide direct access to this information. Is anyone aware of a method for obtaining the information indirectly?
browser.menus.onClicked.addListener((menuInfo, currTab) => {
switch (menuInfo.menuItemId) {
case 'bamenu_reload':
oPrefs.popuptab = 3;
/**** The following does not appear to exist ****/
let buttonhidden = await browser.browserAction.isOverflowed({
tabId: currTab.id
});
if (buttonhidden){
// Show in a window
browser.windows.create({
url: browser.extension.getURL('popup.html'),
type: "popup", state: 'normal',
top: 50, width: 706, height: 604
});
} else {
// Trigger the popup from the button and then remove the popup
browser.browserAction.setPopup({popup: browser.extension.getURL('popup.html')})
.then(browser.browserAction.openPopup())
.then(browser.browserAction.setPopup({popup: ''}));
}
break;
}
});