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

How do I prevent a site's JS from changing the context menu?

  • 3 replies
  • 1 has this problem
  • 16 views
  • Last reply by jscher2000

more options

A few websites I use change the context menu (right-click menu), and I'd like to know how to prevent them from doing so. I haven't been able to find JavaScript settings anywhere in FF.

All Replies (3)

more options

It's complicated.

You can change a preference in Firefox so that even if the site shows a menu, Firefox's menu shows in front of it. When you need to use the site's menu, you can tap the Alt key to "peel off" Firefox's menu. This is what I use and it's 99% accurate and 25% annoying.

Recently, I learned that if you hold down the Shift key while right-clicking, Firefox will usually show its own menu and ignore the site's menu. So you might try that first.

Setting change to always show Firefox's menu in front

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button accepting the risk.

(2) In the search box in the page, type or paste context and pause while the list is filtered

(3) Double-click the dom.event.contextmenu.enabled preference to switch the value from true to false

More info on about:config: Configuration Editor for Firefox.

Helpful?

more options

Thanks for the quick reply! I figured there'd be something in config, but I'm hesitant to change much there, so thanks for the confirmation! This works beautifully most of the time, but I've noticed that sometimes on one site both context menus appear (FF's above and the site's below). Don't suppose there's a fix for that?

Helpful?

more options

No fix, I just tap the Alt key to peel off Firefox's menu. Esc may also work but that can close both menus.

Helpful?

Ask a question

You must log in to your account to reply to posts. Please start a new question, if you do not have an account yet.