Additional permissions prompt not listing the optional permissions being requested
Categories
(Thunderbird :: Add-Ons: General, defect, P1)
Tracking
(relnote-thunderbird 140+, thunderbird_esr115 wontfix, thunderbird_esr128 wontfix, thunderbird138 affected, thunderbird139 affected, thunderbird140 fixed)
People
(Reporter: alex, Assigned: john)
References
Details
Attachments
(1 external file)
Steps to reproduce:
My MailExtension has an optional permission, "clipboardRead", that is listed in the optional_permissions block in the extension manifest. The call to navigator.clipboard.readText() in the extension is wrapped in a try...catch block, and in the catch block, I make a call to messenger.permissions.request() to request the user to grant the optional permission.
But the permissions prompt that appears in Thunderbird doesn't list the optional permission being requested; instead, it lists the same mandatory permissions that is requested when the extension was installed.
STEPS TO REPRODUCE:
- Install the Snippets extension. Link to GitHub repo: https://github.com/aecreations/snippets - latest release is version 2.0
- Copy some text to the clipboard. For example, locate an old email message in Thunderbird and copy its content.
- In the main Thunderbird window, click New Message to open a new message compose window
- Click the Snippets button on the composer toolbar to open the Snippets window
- In the Snippets window, under "Create new snippet", click the "From Clipboard" button.
- Click OK to the message box requesting that the additional permission to get data from the clipboard should be granted
- A puzzle piece icon should appear in the main Thunderbird window. Click on the icon to display the additional permissions prompt
Actual results:
The additional permissions prompt incorrectly requests the mandatory permissions that are defined in the permissions block in the extension manifest:
- Read and modify your email messages as you compose and send them
- Download files and read and modify the browser's download history
Expected results:
The additional permissions prompt should request the optional permission that is defined in the optional_permissions block in the extension manifest:
- Get data from the clipboard
This issue is discussed in the Thunderbird Add-ons developer forum: https://thunderbird.topicbox.com/groups/addons/Tde1f2c8248a54c76/additional-permissions-prompt-not-listing-the-optional-permissions-being-requested
| Assignee | ||
Comment 2•2 years ago
•
|
||
Confirmed. I reached out to the team how to move this forward. This seems to be very much broken: not showing the prompt in the composer, but in the main window (and only after switching to it) is confusing.
Note: In Daily this does not work, because you are losing the user-input-handler and the optional permission prompt is not shown at all.
To make your add-on work, you need to request the permission directly. We will fix this, but it needs proper planing.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
This patch fixes the wrong (or no) permissions being shown for optional
permission prompts. It also pulls in some upstream changes for the used
strings.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 4•1 year ago
•
|
||
Thank you for your patience, this one indeed took a while to get fixed. The patch adds a test to ensure this functionality is not breaking again.
We have decided that we will not implement permission prompts on other windows besides the main Thunderbird window. I saw that you modified your add-on already to not request the permission from the popup window. If the user could trigger permission requests while not interacting with the main Thunderbird window, we propose the following:
- use
browser.permissions.contains()to check if a permission is granted or not and enable/disable support for the related feature - the relevant UI could have a pointer to a help page about the feature (which is opened in a normal tab), which may have a button "request permission", which could then use
browser.permissions.request()to request the permission. - the relevant UI could also offer a link to open the options page via
runtime.openOptionsPage()to allow the user to enable the permission.
Updated•1 year ago
|
Pushed by corey@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/3de5a4b81d06
Fix optional permission prompts and port other related changes. r=mkmelin
| Assignee | ||
Comment 6•1 year ago
|
||
Release Note Request (optional, but appreciated)
[Why is this notable]: Optional permission prompts were either empty or showed the wrong permissions.
[Suggested wording]: Fixed: Optional permission prompts for WebExtensions displayed the wrong permissions
[Links (documentation, blog post, etc)]:
| Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Description
•