I am in the process of porting my Chrome / Firefox Extension »Tab Ahead« to Safari. The source-code is on https://github.com/janraasch/tab-ahead
Using "xcrun safari-web-extension-converter" I was able to get a nice Xcode Project and the extension works.
I did find one difference in behavior though: The extension uses tabs.query to retrieve a list of all tabs. On Chrome & Firefox setting the "permissions" to ["tabs"] in the manifest.json does the trick. On Safari there are two issues:
Every time time the user clicks the pop-up on a page they did not previously grant permission to access they are asked for permission.
And, tabs.query only returns tabs with urls the user previously granted access to.
Maybe I am overlooking something, but this does seem overly restrictive for any "tabs management"-extension and also this is misleading to the user of any such extension - I think.
Let me know, if there is another way to make tabs.query work the way it does on Chrome & Firefox.
Kind regards,
Jan
PS:
I am running this on Safari Version 14.0 (15610.1.28.1.7, 15610)
Also, I posted this as feedback as well. The ID is FB8705146.
I see why you would think you need to add <all_urls>, since that shows the "Always Allow on Every Website…" button in preferences. Safari should give users that option when just the "tabs" permission is used, since there is an expectation that tab managers like yours need access to all tabs. I will use your feedback request to track changes to Safari in that area.
You can use browser.permissions.request({origins: ['<all_urls>']}) to upgrade your extension later to get the "Always Allow on Every Website…" button. This will not grant all permissions, just the ability to ask the user to allow it. The user will still need to take action at time of use to allow one site, or all sites. (You will also need to put <all_urls> in optional_permissions in the manifest.)
Thanks for the info and feedback!