Missing Firefox 3.6 Right-Click Event

I am porting the application in JavaScript / CSS and it uses a right click. For some reason, Firefox 3.6 for Windows does not issue a right-click event, but Chrome and IE do. Here are some test codes. If you right-click #test , you will not get anything in Firefox, but you will get a warning in Chrome and IE.

 <html> <head> <title>Hi</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript"> $(function(){ $("#test").get(0).oncontextmenu = function() { return false; }; $("#test").mousedown(function() { alert("hi"); }); }); </script> </head> <body> <div id="test" style="background: red;">Hi</div> </body> </html> 

Why isn't a right-click event fired in Firefox?

+4
source share
5 answers

I found a problem. I have the All-in-One extension installed. I tried to run the code with it disabled and it worked fine. Looks like an error / extension restriction.

Update: I just tried the Mouse Gesture Fallout extension and it doesn’t have this problem.

+3
source

Firefox 3.6 gives the warning as accurately as possible either left or right on my Mac (OSX 10.5), like Safari and Google Chrome. I don’t know why your Windows version doesn’t - it doesn’t seem like a programming problem, more like a Firefox / Windows error, maybe ...?

+2
source

Firefox has an option: Content => Javascript => Advanced => Allow to disable / replace context menus.

+2
source

I checked your code. Firefox 3.6 gives a warning on my XP machine (SP3).

+1
source

Just add to the list. I had Multi Links add-ons installed that prevented right-clicking.

0
source

Source: https://habr.com/ru/post/1304103/


All Articles