SelectionText of info object become undefined given the existence of host permissions
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(thunderbird_esr68 fixed, thunderbird72 fixed, thunderbird73 fixed)
People
(Reporter: bprasannakumar, Assigned: darktrojan)
References
Details
(Keywords: regression)
Attachments
(2 files)
(deleted),
patch
|
mkmelin
:
review+
mkmelin
:
approval-comm-beta+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mkmelin
:
approval-comm-esr68+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Firefox/60.0
Steps to reproduce:
I had developed an Addon for Thunderbird to list custom ContextMenu entries to quickly access work related links with the text selected in the mail content. Till Thunderbird 60 the XUL based addon worked flawlessly.
Since, from Thunderbird 68 XUL based addons are deprecated/discouraged, i tried to port my XUL based addon to webextension for Thunderbird. Though i was able to successfully port my addon, the selected text in mail content is not getting listed in info object.
-
Created menu using browser.menus
browser.menus.create({
id:"open_customlink",
title: "Open CL",
type: "normal",
contexts: ["all"],
parentId: "context_mycl"
}, onCreated); -
Had function to handle the menu click event
browser.menus.onClicked.addListener((info, tab) => {
switch (info.menuItemId) {
case "open_customlink":
console.log(info.selectionText);
openCL(info,tab);
break;
}); -
Had a function to do actual action on the selected text
function openCL(info, tab) {
console.log("Custom Link item " + info.menuItemId + " was clicked");
console.log("Custom Link info: " + JSON.stringify(info));
console.log("Custom Link tab: " + JSON.stringify(tab));
// Other code here
} -
Had permissions for tab and menus in manifest.json
"permissions": [
"notifications",
"menus",
"activeTab",
"tabs",
"<all_urls>"
],
"content_scripts": [
{
"matches": ["<all_urls>"]
}
]
Actual results:
When we try to select a text in the mail content and click on the custom context menu entry, the info object is missing the SelectionText.
console.log(info.selectionText); -> undefined
JSON.stringify(info) -> {"menuItemId":"open_customlink","parentMenuItemId":"context_mycl","editable":false,"modifiers":[],"button":0}
Expected results:
Since, the required permissions have been acquired while installing the addon the SelectionText property of info object should have contained the selected text from mail content.
Note: I have asked a question on Stackoverflow (https://stackoverflow.com/questions/57743754/host-permissions-required-for-selectiontext-of-info-object-in-thunderbird-68) to see if anyone could help me quickly.
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
Marking this as a duplicate of bug 1504475, as the cause is exactly the same, and fixing one will fix the other. I just don't know how, yet.
Assignee | ||
Comment 2•5 years ago
|
||
Reopening this. The cause isn't bug 1504475, the cause is our context menu code needing a major update to bring it into line with Firefox's.
Assignee | ||
Comment 3•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Comment 6•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/247abc27cb52
Update nsContextMenu to fix selection text properties; r=mkmelin
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 8•5 years ago
|
||
Updated•5 years ago
|
Assignee | ||
Comment 9•5 years ago
|
||
Reporter | ||
Comment 10•5 years ago
|
||
Thank you very much for fixing this issue. Now info object returns value for selectionText in Thunderbird 72.0 BETA version and my contextmenu addon is working. Eagerly waiting for Thunderbird 72 or ESR 68.3.1 so my addon can become functional for the users who are using it.
Assignee | ||
Updated•5 years ago
|
Description
•