Shift+right click shows context menu even if disabled in javascript
Categories
(Firefox :: Untriaged, defect)
Tracking
()
People
(Reporter: raphael.mozilla, Unassigned)
References
Details
Attachments
(1 file)
705 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:25.0) Gecko/20130723 Firefox/25.0 (Nightly/Aurora) Build ID: 20130723030205 Steps to reproduce: 1) disable context menu in javascript on a surface: <script> window.onload = function() { window.oncontextmenu = window.onclick = function(e) { e.preventDefault(); e.stopPropagation(); return false; } } </script> 2) Load the page in the browser 3) right click on this surface 4) shift+click on this surface Actual results: 3) if the user allows Javascript to disable context menus, the context menu doesn't appear, as expected. 4) the context menu appears Expected results: 3) this is the right behavior 4) This is unexpected if the user allows Javascript to disable context menus, the context menu should not appear.
Reporter | ||
Updated•11 years ago
|
Comment 1•11 years ago
|
||
This is a feature not bug. http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#context-menus "User agents may provide means for bypassing the context menu processing model, ensuring that the user can always access the UA's default context menus. For example, the user agent could handle right-clicks that have the Shift key depressed in such a way that it does not fire the contextmenu event and instead always shows the default context menu."
Reporter | ||
Comment 2•11 years ago
|
||
Thanks Alice for your reply and sorry for the invalid reporting. setting to RESOLVED DUPLICATE (after your comment, I found this https://bugzilla.mozilla.org/show_bug.cgi?id=692139 which didn't show during my search before reporting this one) However, this behavior can be annoying for making web applications that need a lot of actions in the mouse and other browsers do not behave this way. I think this behavior should be reconsidered. Is shift+right click really used?
Comment 3•3 years ago
|
||
I see the advantage of having shift-rightclick as a means of getting around those lame 'Right-click is disabled' interfaces.
But, as web-based applications become more and more complex, there are increasingly many completely valid use-cases where shift+rightclick is needed as a Javascript event, at which point the unblockable context menu becomes extremely hindering, and pretty much makes the interface unusable.
I'm not necessarily advocating removal of the feature entirely.
But if nothing else, is disabling this at least currently offered as an option, or even as a flag?
If not, then FF is pretty much useless for web-applications that require shift-rightclick in their interface.
If it is, though, then interfaces that do require shift-rightclick can simply detect the browser and direct the user to adjust the setting / flag to make the interface more usable. This would still permit users to bypass the lame 'Right-click is disabled' interfaces.
Comment 4•3 years ago
|
||
(In reply to codesmith32 from comment #3)
I see the advantage of having shift-rightclick as a means of getting around those lame 'Right-click is disabled' interfaces.
But if nothing else, is disabling this at least currently offered as an option, or even as a flag?
AFAIK, no.
But, testcase of Bug 330756(as long as this bug is not fixed) seems to able to disable the shift+right click contextmenu.
Comment 5•3 years ago
|
||
Hmm.. no, it appears that setting dom.event.contextmenu.enabled to false prevents the contextmenu event from triggering in Firefox, but it doesn't stop the contextmenu from opening. For me, that makes the issue worse.
I'm not sure exactly what Bug 330756 is, but it is possible it was fixed.
Perhaps a feature request can be opened, to allow disabling shift-rightclick?
Please don't "fix" this "bug." Hiding the context menu, a critical element of the browser interface, is not the business of the application running in the browser itself. Due to right-click being a useful operation for a web application, it makes sense to be able to hijack it, but not to disable it entirely. The shift+right-click seems like a very reasonable compromise.
The number of applications where shift+right-click is necessary would seem to be vanishingly small. But I have no objection to the option to disable this key combination with an advanced setting--any user who feels they need it can disable the browser behavior, while the rest of us have a way to use right click even when the webpage doesn't think we should.
Description
•