Context menu (and "contextmenu" event) is unavailable in tabs provided by an extension
Categories
(Thunderbird :: Add-Ons: General, defect)
Tracking
(thunderbird_esr78 unaffected)
Tracking | Status | |
---|---|---|
thunderbird_esr78 | --- | unaffected |
People
(Reporter: yuki, Assigned: darktrojan)
References
(Regression)
Details
Attachments
(2 files)
When an extension provides its UI as a tab, the context menu is not opened in the tab. Moreover, "contextmenu" event is also not dispatched. As the result both Thunderbird's own context menu and the extension's custom menu are unavailable.
Steps to reproduce
- Start Thudnerbird.
- Load an addon including a page.
- Open the debugger for the addon.
- Open an extension page in a tab, like
browser.tabs.create({ url: '/ui.html' })
. - Right-click on the content area of the tab.
Actual result
Nothing happens.
Expected result
The default context menu opens.
Environment
- Windows 10 21H1
- Thunderbird 89.0b4 (build ID: 20210512134201)
- Daily 90.0a1 (build ID: 20210518125031)
Reporter | ||
Comment 1•3 years ago
|
||
Here is a testcase.
- This adds a toolbar button to the Thunderbird window.
- Click the toolbar button "testcase". Then a tab and a popup window are opened.
- Open the debugger for the testcase extension.
- Try to do right-click on both the opened tab and the popup window.
- Then you'll see the context menu only on the popup window. Moreover, you'll see a "contextmenu" event in the console only after you do that in the window.
Reporter | ||
Updated•3 years ago
|
Comment 2•3 years ago
|
||
This is a regression caused by bug 1698723.
Assignee | ||
Comment 3•3 years ago
|
||
It works for me, on the tip of comm-central and mozilla-central.
Comment 4•3 years ago
•
|
||
What landed since yesterday which could have fixed this? Does not work in current daily on Windows. (Will check tip in 1h)
Assignee | ||
Comment 5•3 years ago
|
||
Interesting. It's OS-specific.
Assignee | ||
Comment 6•3 years ago
|
||
This is weird. In some cases the "click" event on a <browser> fires before the "contextmenu" event, and our click handler returning false prevents the context menu event firing. It doesn't seem to affect
ordinary left-clicking. I am not convinced the click event should even happen, but at a guess I'd say it was happening due to the time it takes for the remote browser to fire contextmenu.
This patch changes the return value of contentAreaClick to true in this case. Nothing actually happens if you click on a remote browser in the parent process, so it shouldn't cause problems.
The patch also adds a test for extension content tabs in browser_mailContext.js. I don't think the added test would've picked up this problem but it is an omission that should be corrected.
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 7•3 years ago
|
||
bugherder |
Reporter | ||
Updated•3 years ago
|
Reporter | ||
Comment 8•3 years ago
|
||
I've confirmed the problem I saw has been fixed at Daily 90.0a1 (Build ID: 20210521104831). Thanks!
Description
•