Open Bug 1484694 Opened 6 years ago Updated 2 years ago

New menus.ContextType on multiple Tab Selection

Categories

(WebExtensions :: Frontend, enhancement, P3)

63 Branch
enhancement

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: eros_uk, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Build ID: 20180820100129

Steps to reproduce:

The option to select/highlight multiple tabs is added in Firefox 63.

Firefox 63+ Tab menu adjusts accordingly as in 'Close Tab/Close Selected Tabs' and 'Reload Tab/Reload Selected Tabs'.

Getting the selected/highlighted tabs after the tab menu click via tabs.query is not a problem. However, showing the correct menu is the target of this enhancement request.

At the moment there is 'tab'  menus.ContextType. I propose the following (for example) addition/s:

-tabs-single: item is shown when single tab is highlighted e.g. 'Close Tab'
-tabs-multi: item is shown when multiple tabs are highlighted e.g. 'Close Selected Tabs'

IMHO, menus.ContextType is the API especially suited for this purpose of showing/hiding menuitems according to criteria.

An alternative method of using menus.onShown is not suitable since:

- menus.onShown  is especially suited to alter & update a single menu-item label
- there is no method to hide/show a menu item and removing and recreating the menu is not best suited for this purpose ( bug 1482529 )
- Querying large number of tab will delay the operation and "If the onShown handler calls any asynchronous APIs, then it's possible that the menu has been closed again before the handler resumes execution."
Flags: needinfo?(mconca)
Severity: normal → enhancement
Priority: -- → P3
I like the idea behind this request, but we'll need to think about the best way to present it to developers.  The suggestions in Comment 0 are a good place to start.
Flags: needinfo?(mconca)

Hello, I am new to contributing to Bugzilla can you assigned me to this issue so that I can learn to fix these bugs and also suggest to me how can Is start working on this bug to fix it.

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.