How to hide pageAction icon on all urls?

Hi.
My extension will show a pageAction icon on all urls(via <all_urls> in manifest), I want to give a toggle button in extension option page for users to hide the icon on all urls?

I have found pageAction.hide(), but it needs tab.id, is there something like pageAction.hide(*), so I don’t need to hook the tab opened everytime?

Thanks.

I’m not sure there is a global way (like with the browserAction).
But you can always listen on browser.tabs.onCreated and when it’s created, call hide (the event handler has ID of the tab).

Yeah, can’t find a global method, I have to use this function temporarily.