But on Chrome, I need ‘tabs’ permission to get them.
Without ‘tabs’ permission, chrome.tabs.query({}, r=>console.log(r)) returns tabs without URL. Even those tabs from my extension.
‘tabs’ permission is too wide. I don’t think users will be comfortable with that.
Is there any way to get them withou ‘tabs’ permission?
That I find strange because according to the MDN documentation, Firefox should also need either host permissions or permission for the Tabs API to query tabs with a certain URL. Perhaps Firefox allows it because it’s an internal extension page, not a website.
Unfortunately, since Chrome doesn’t allow you to access the URL of a tab without permission, you can’t really get around it.
However, since it’s an internal page generated with your add-on, you could maybe get around it by using some kind of workaround. Something like opening a runtime port or sending a runtime message to the background script (aka service worker) and using the response to generate a list of tab IDs. But that is kind of a “hacky” way of doing it.