fregante / webext-permission-toggle

Browser-action context menu to request permission for the current tab.
https://fregante.github.io/webext-permission-toggle/
MIT License
70 stars 5 forks source link

activeTab no longer needed for recent Chrome/Chromium? #50

Closed aspiers closed 6 months ago

aspiers commented 6 months ago

Following on from https://github.com/fregante/webext-permissions/issues/22#issuecomment-2053821226, I have done some testing with demo/mv2 and demo/mv3 across Chrome 123.0.6312.105, Chromium 120.0.6099.224, and Firefox 122.0, and found the following:

aspiers commented 6 months ago

If this was previously needed with the Chrome family, then maybe something has changed at some point more recently; however I couldn't find any reference to activeTab when using the search at https://chromereleases.googleblog.com/. It seems more likely to me that something in your code has improved more recently to the point that it can work gracefully in the absence of the activeTab permission; for example:

https://github.com/fregante/webext-permission-toggle/blob/ddedc78ebf2816e75ca0f97c5d72a21fe59b82de/index.ts#L64-L83

aspiers commented 6 months ago

BTW it's worth noting that when activeTab is present, then I can confirm that temporary permission is granted to the site even after the user clicks Deny on the popup asking for permissions, as previously noted https://github.com/fregante/webext-permissions/issues/22#issuecomment-1902676915.

When I try this in Chrome, the activeTab permissions persist after multiple page reloads, whereas in Firefox, on the first page reload after clicking Deny they exist fleetingly and then immediately vanish again:

image

It feels to me like at least one of these should be considered buggy, but it wouldn't be the first time a browser exhibits quirky behaviour.

fregante commented 6 months ago

It's best to open a bug on Chromium if you think it's not needed. Because again the extension should not have access to the current URL without activeTab. If it does, it's a temporary Chrome bug and there's nothing to change here.