WebExtensions API -> Extending Menu in Context folder_pane does not work ! ( all other context do properly )
Categories
(Thunderbird :: Add-Ons: Extensions API, defect)
Tracking
(Not tracked)
People
(Reporter: development, Unassigned)
Details
Attachments
(3 files)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
Trying to migrate my Addon.
For all other contexts the menus.create() works properly and es expected.
the context that doesnt work is "folder_pane".
These are the possible contexts for Thunderbird :
"enum": ["all", "page", "frame", "selection", "link", "editable", "password", "image", "video", "audio", "browser_action", "tab", "message_list", "folder_pane"],
Try this for instance :
- Easyiest and quickest way to test is to take the the example from the Mozilla Github and alter it a little ( see below )
https://github.com/mdn/webextensions-examples
-> take example "menu-demo"
-> Alter the "background.js a little ( see below )
In your background.js add
/*
Create context menu items.
*/
browser.menus.create({
id: "folder_pane",
title: "Context folder_pane",
contexts: ["folder_pane"]
}, onCreated);
browser.menus.create({
id: "message_list",
title: "Context message_list",
contexts: ["message_list"]
}, onCreated);
browser.menus.create({
id: "message_list",
title: "Context ALL",
contexts: ["all"]
}, onCreated);
I'll Attach the already modded File AND the original for comparison purposes for you in the attachment of this report.
Actual results:
No menu extension happens in the Folder Pane context.
Neither with context "all", nor with context "folder_pane"
All other contexts work properly.
For all other contexts the menus.create() works properly and es expected.
The context that doesnt work is "folder_pane" ( and "all" for the Folder Pane area ).
Expected results:
ContextMenu should be extended like it works as expected in all other contexts.
| Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Updated•6 years ago
|
| Reporter | ||
Comment 2•6 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #1)
Created attachment 9100777 [details]
example.pngThis works fine for me.
Well, that is strange...
I've dug a lil further into the issue now
( and sorry for not doing that earlier - must have sat on my brain there )
and found this :
Whenever i right click on a folder, the following error appears
in the Errorconsole :
"TypeError: tab.linkedBrowser is undefined" in "ext-menus.js:1001:23"
P.S.: I deinstalled all other Addons for this test, just to make absolutely sure, there cannot be any sort of interference whatsoever.
@Jorg :
You appear to use Linux ( Ubuntu i guess ) there, Jorg.
Maybe there is a difference on Thinderbird instances?
These are the specs of my Thunderbird installation here :
Version : 68.1.2 ( 32-bit ) , German, Windows 10 Pro
Hope that helps.
P.S.: If you tell me HOW i can and where to find, i would extract the actual instance of the "ext-menus.js" and post it here.
I've already looked throu the folders and didn't find it.
As far as i unterstand the omni.ja is being live-'compiled' on use when Thunderbird starts, but the actual and original "ext-menus.js" must be hidden in some other file.
If it helps and you tell me how, i will get it and post it here too.
| Reporter | ||
Comment 3•6 years ago
|
||
Comment 4•6 years ago
|
||
Here's the line in question: https://hg.mozilla.org/releases/comm-esr68/file/tip/mail/components/extensions/parent/ext-menus.js#l1001
I wonder if the error's caused by the previous line, I think tab should always be tabTracker.activeTab, but I can't see how the other option is even possible.
| Reporter | ||
Comment 5•6 years ago
|
||
(In reply to Geoff Lankow (:darktrojan) from comment #4)
Here's the line in question: https://hg.mozilla.org/releases/comm-esr68/file/tip/mail/components/extensions/parent/ext-menus.js#l1001
I wonder if the error's caused by the previous line, I think
tabshould always betabTracker.activeTab, but I can't see how the other option is even possible.
Thanks Geoff.
Hm, let me have an absolutely blind guess :
Could it be, that the Folderpane ist not of type tab or is not part of the tab, but of some sort of sidbar, which is NOT part of tab / tab-content ?!
OK, found soething !
Thinking about this and the trigger vs tabTracker.activeTab part.
=> "What if it doesn't track the correct tab ?"
=> "Hm well the Folder Pane ive been using for the last 10 or so days is in Tab 8 or so !... What if index is wrong or something ?
=> Let's test : just check if it works in Tab 1 ( index [0] very presumably )
=> Wohoo, good guess !!!
Yes the context menu IS THERE and works fine !
(only) If Folder Pane exists in the first tab, it works!
So, well that isn't too bad, yet ofc not satisfying for perfectionists and sure gives the next questions to chew on: Wtf is wrong with the tabTracking ? How deep does the bug reach and what else ist affected ?
At least i'd have some workingtheory and gut feeling at hand :
*It probably has something to do with an index that doesnt get read out -> stored correctly; *
-> and thus the wrong index is probably stored within all those event target properties;
( OR the seemingly independent tabTracker.activeTab object/property. But probably not - blind guess is, that the tabTracker.activeTab is an object used very often within Thunderbird and thus a wrong reading/functioning would long have gotten attention. Not sure tho ofc. )
So i guess the error happens when folder pane target is getting read out ... -> a wrong index ist getting read into the event target properties. But only for the folder pane, mind you. All other contexts work properly.
Mere speculation ofc...
Yet, all in all we're now one step further ahead at least ...
Comment 6•6 years ago
|
||
The folder_pane context is working properly in all tabs and windows in 78.
Description
•