Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More
Solved Archived

oncontextmenu

jscher2000 -... replied
smokcieni

Hello. First of all, I would like to mention that it is web developer's problem. I am creating a website on which I am going to use context menu (right click). I tried using oncontextmenu="function()" ,however, without any positive result. What alternative or solving would you recommend ?

Hello. First of all, I would like to mention that it is web developer's problem. I am creating a website on which I am going to use context menu (right click). I tried using oncontextmenu="function()" ,however, without any positive result. What alternative or solving would you recommend ?
Read this answer in context

Chosen Solution

Okay, since the problem is with the overlay, you may find assistance on another site more oriented toward scripting. For example:

All Replies (4)

Hmm, it works on my home page: http://www.jeffersonscher.com/

If it is ignored on your Firefox, perhaps one of your extensions is blocking it. Could you test in Firefox's Safe Mode? That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: Use Troubleshoot Mode in Firefox.

If Firefox is not running: Hold down the Shift key when starting Firefox.

If Firefox is running: You can restart Firefox in Safe Mode using either:

  • "3-bar" menu button > "?" button > Restart with Add-ons Disabled
  • Help menu > Restart with Add-ons Disabled

and OK the restart.

Both scenarios: A small dialog should appear. Click "Start in Safe Mode" (not Refresh).

Any difference?

Or perhaps the problem is not with intercepting the right click but with adding items to the menu. Could you clarify the problem you are encountering?

It is not only occuring in my firefox. I checked that on other devices it also didn't work. However, on every other browser it is working. Additionally, I use code to block default context menu and I create new one, which is simply made of divs and positioned using cursor X,Y. Blocking goes well, but generating........ just doesn't work. It is my main problem.

Chosen Solution

Okay, since the problem is with the overlay, you may find assistance on another site more oriented toward scripting. For example: