搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

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

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.

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.

所有回覆 (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.

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?

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.