Recently, I’ve been working on developing an extension manager (using Manifest V3) for personal use, and I’ve encountered an issue regarding the loading icons of other extensions.
I am using the browser.management.getAll() API, which provides me with an array of ExtensionInfo objects. Within these objects, the icons field contains the icon URL I need, something like moz-extension://<extension-id>/path/to/icon.png . However, I can’t get the actual image data from thoose URL.
I’ve tried both the fetch API and canvas+img method. Unfortunately, I’ve hit a roadblock due to stringent CORS policies. Even after including <all_urls> in the host_permissions and granting the necessary permissions, this restriction still exist.
Does anyone is aware of a solution or approach? Your insights would be greatly appreciated!
Hm… for the most part it makes sense that CORS policies prevent one extension from accessing assets in another extension, but in the specific case of trying to retrieve the icon URL exposed by browser.management.getAll() it seems out of place.
@7sDream, if it’s not too much trouble, would you mind opening a bug on bugzil.la and attaching a minimal reproduction that demonstrates the error?