web-ext
web-ext copied to clipboard
Print message to emphasize the need to grant host permissions when a MV3 extension is loaded
In Firefox, MV3 extensions are not granted host permissions at install time (MDN: host_permissions: Requested permissions and user prompts). This includes patterns in content scripts and host_permissions. To avoid developer confusion, we should emphasize the need to grant the permissions manually, e.g. by recommending to add -u about:addons (and toggling the permissions manually) or through the extension's own UI.
The condition for printing the message is:
manifest_version > 3host_permissionsorcontent_scriptsis non-empty.
Suggested implementation:
- Declare an array (to hold the informative messages). E.g. called
helpful_messages - When target is Firefox (condition in source code), and
manifestData.manifest_version > 3andcontent_scriptsorhost_permissionsare non-empty arrays, append the help text to thehelpful_messagesarray. - When the browsers have finally launched, call
log.info();for each message (afterextensionRunner.run();)
Hi @Rob--W, I'd like to give this issue a try! Thanks.
Hi @Rob--W, I'd like to give this issue a try! Thanks.
See my comment above for pointers. Let me know if you have questions!