Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, 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

oncontextmenu

more options

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 ?

Chosen solution

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

Read this answer in context 👍 1

All Replies (4)

more options

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?

more options

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?

more options

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.

more options

Chosen Solution

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