WebExtension: get the postion of the browser action

Hello,
I just writing my first webextension and have a few problem. I’d like to show a popup when a browser action in the toolbar is clicked, and just open a url in new tab when the browser action is in the browser menu panel, instead of open the subview in the menu panel.
But I can’t find a way to know weather the browser action is in the toolbar or in the menu panel. Or there is any way to solve this problem?