fregante / webext-permissions

WebExtensions module: Get any optional permissions that users have granted you.
MIT License
15 stars 1 forks source link

Resolve overlapping permissions (e.g. only return `*://*/*` if present) #9

Closed fregante closed 2 years ago

fregante commented 2 years ago

Optionally, but by default, I think permissions should be resolved. If the user granted:

The latter will always include the former, so processing both is rarely useful. This is additionally shown by a Chrome issue (which I'm not sure other browsers replicate):

This module could return only *://*/* if found.

If webext-patterns can safely match the former with the latter, then it's easy to drop every overlapping pattern, otherwise I can just handle "all urls" as a special case.