Closed Bug 1417118 Opened 7 years ago Closed 7 years ago

OnContext type event needed for detecting right click on right click context Menu options

Categories

(WebExtensions :: Untriaged, defect)

57 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: xamayon, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171112125346

Steps to reproduce:

XUL Extensions allowed detecting a right click event on a right click context menu option which could be used to trigger alternate behavior for that option. It would be nice to be able to re-add that functionality to my new WebExt version.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
I read thru 1215376 and I'm not sure how this is a duplicate of that one. The context menu shows up properly when you for example right click on an image. The context menu also displays a set of options properly, the issue is with how those options can be interacted with. The WebExtensions API treats both a left click and a right click on the context menu options identically. With XUL extensions it was possible to use oncontextmenu type events on the context menu options to identify whether they they had been right clicked and treat the click differently.

Unless I am overlooking something, I don't think the WebExtensions API allows for that same functionality. What would be needed is either a new event type to listen for, or a new set of information passed with the normal menus.onClicked event which would indicate whether the click is a left or right click much like how it indicates whether a modifier key was held during the click in the modifiers value: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/OnClickData
Flags: needinfo?(amckay)
I'm not sure how its a dupe either, so I've unmarked it as a dupe. But as I understand the requested feature this seems like something we should not be doing. 

Currently there is nothing in Firefox that treats a right click on a context menu as something different from a left click (please correct me if I'm wrong in that). Adding that functionality would be very confusing to a user, since there's no way they would know this. Unless we add more information to a context menu to show that a right click can do something. I'm cc'ing UX in on this, but as I understand the feature, I don't believe its something we should do.

If I've got the feature wrong, my apologies and please correct me.
Flags: needinfo?(amckay)
Resolution: DUPLICATE → WONTFIX
The default case would be to treat clicks the same as they have always been, but it is incredibly useful to be able to trigger two different actions based on a single menu item. It reduces clutter, reduces the number of clicks needed, and in general allows much more flexibility in how menus are utilized. This is especially important now that we have basically zero options with how we can create new menu items in WebExtensions extensions.

Users of my extension Image Search Options have been using the right click on context menu items functionality since 2010 to use POST image submission instead of the default left-click GET image submission without any confusion. It was never the most obvious feature, but the thousands of users who knew about it loved it. Additionally, users who didn't realize it was possible were left no worse off than they would have been without it existing.

Not having this functionality has significantly degraded the user experience of my extension, and from speaking with users the missing right click secondary options are one of the main reasons they are refusing to upgrade to the latest WebExtensions version.

I don't see how adding this would be significantly different, or in any way less desirable than the other infrequently used modifier-key clicks on menu items.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.