dom.event.contextmenu.enabled=false not working for some pages




15 years ago
15 years ago


(Reporter: cesarb, Unassigned)



Firefox Tracking Flags

(Not tracked)





15 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040514
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040514

I have dom.event.contextmenu.enabled set to false. However, the site in the URL
manages to pop up two alert() dialogs every time I click the right mouse button,
before the context menu appears.

Reproducible: Always
Steps to Reproduce:
Right click on the page background
Actual Results:  
Two alert() dialogs followed by the expected context menu

Expected Results:  
Only the context menu should appear; the javascript in the page should not be

This might be a regression of bug 86193, however the testcase attached there
works as expected (no alert() dialog).
Well, bug 86193 is a pref which can disable script functions who prevent the
context mousedown event from bubbling up.
That site isn't trying to disable the contextmenu, it only adds something extra.
So I think this bug is INVALID.
Yep.  That pref just prevents the site from cancelling the context menu; it
doesn't prevent the oncontextmenu handler from running.  That's consistent with
the preferences UI for that preference (which talks about disabling and
replacing context menus).

Comment 3

15 years ago
I thought that returning false from the onclick handler did cancel the context
menu (and that it appeared anyway because Mozilla has a misbug which always show
the context menu even if you tried to avoid it). So, since it is returning false
from the handler, and because of it cancelling the context menu, it would fall
under bug 86193.

If I'm wrong and returning false from the onclick handler does not matter, feel
free to close as INVALID and I'll look for the "don't ever run any javascript
when I want the context menu" bug -- there must be one already filled somewhere.
The pref only affects whether cancelling the event works (via return false,
preventDefault(), etc).  Maybe the pref name sucks.  Oh well.  C'est la vie.
Last Resolved: 15 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.