Closed Bug 1372297 Opened 7 years ago Closed 7 years ago

API Request: contextMenus: add new hover events

Categories

(WebExtensions :: Frontend, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: oss+mozilla, Unassigned)

Details

(Whiteboard: [design-decision-denied])

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170520072017

Steps to reproduce:

OK, I must first say that I am very new to webextensions. I played around with them a bit, but hit a problem at some point, trying to make a context menu respond to hover, rather than click. I think this simply requires a new event; therefore I suggest to implement two event similar to the HTML DOM ones "onmouseover" and "onmouseout", that would be sent when the mouse starts or stops hovering a menu item.
Given that "onclick" became "onClicked", maybe these should be named "onEntered" and "onLeft", but that sounds a bit weird.

Hopefully, the implementation shouldn't be that hard (I don't know much of Firefox's internals, so this is a guess), and could reuse most of the one from the onClicked event, down to the parameters sent with it. Maybe the hardest part is actually choosing the right name?

Many thanks,

Mayeul
Component: WebExtensions: Untriaged → WebExtensions: Frontend
Whiteboard: [design-decision-needed]
Hi Mayeul, this has been added to the agenda for the July 11 WebExtension APIs triage meeting. Would you be able to join us? 

Wiki: https://wiki.mozilla.org/Add-ons/Contribute/Triage#Next_Meeting

Agenda: https://docs.google.com/document/d/1MEMC7EyZ2VVInbWod7FD2SFGp36osoxQkhUm5f0aNSs/edit#
Flags: needinfo?(mixedpuppy)
In general we do not provide access into the UI this way (ie. hover events).  We do have bug 1215376 to expand on the context menu functionality in other ways.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Flags: needinfo?(mixedpuppy)
Resolution: --- → WONTFIX
Whiteboard: [design-decision-needed] → [design-decision-denied]
> Hi Mayeul, this has been added to the agenda for the July 11 WebExtension APIs triage meeting. Would you be able to join us? 
Hello Caitlin, I apologize for missing the notification, I would have liked to join you for this meeting.

> In general we do not provide access into the UI this way (ie. hover events).  We do have bug 1215376 to expand on the context menu functionality in other ways.

I think I can understand this design decision pretty well.

> Not a strong case for hover events
My personal use case would be to replicate the functionality found in the "Nuke Anything Enhanced" extension, where hovering over the "remove this item" menu element will display a flashing border around the said item.
I can also imagine some other cases where it could be useful, generally as a preview mechanism: right click, hover "bold" and see the emboldened text, for instance.
I however agree that this is not a typical use case, and it is strongly tied to a UI paradigm (mouse/keyboard oriented).
Although I can imagine a few ways to replicate this functionality on touchscreen oriented devices, they may not be desirable.

One possible workaround for this would be to allow drawing a custom submenu with HTML, such as the ones that we already have in the toolbar. Another one could be to emit an event every time a submenu is opened, which would be compatible (and could be desirable) on touchscreen-based devices as well. That sounds like something that could be implemented as part of https://bugzilla.mozilla.org/show_bug.cgi?id=1215376 . I am not sure there are more use cases for this, though.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.