2

Many websites have started replacing the right-click context menu with one of their own. Firefox lets me choose whether a website can disable Firefox's menu, but not much else.

Neither value of the Firefox's setting is acceptable: allow it to be blocked, and I can never access some of the features on some websites. Disallow, and I have two menus on every website that uses this feature legitimately:

                                              Looks familiar?

Is there an addon that would solve this problem elegantly? For example, by letting right-click do what the site wants, but making Ctrl+Right Click always show the Firefox menu?

7
  • Where is the option to enable/disable this feature? Or do you actually have to navigate to a website that attempts to override the right-click context menu?
    – MrWhite
    Dec 8, 2011 at 17:21
  • @w3d that option is here: imgur.com/Sm2H4
    – RomanSt
    Dec 8, 2011 at 17:48
  • Ah OK thanks. The default option appears to be to "Allow scripts to... disable or replace context menus"
    – MrWhite
    Dec 8, 2011 at 18:23
  • What specific website is this? The websites where I have noticed this behavior, only showed the website's custom menu. Dec 8, 2011 at 19:05
  • @Simon of course, because the setting is enabled by default. Disallow disabling the context menu and you'll see it. Websites that come to mind are Google Docs and NewsBlur. Websites that abuse this setting include various lyrics websites, disabling the menu without replacing it.
    – RomanSt
    Dec 8, 2011 at 20:12

4 Answers 4

2

Partial solution, but better than nothing:

With Toolbar Buttons, you have an additional button Toggle JavaScript on/off that you can add to any toolbar in Firefox.

Then, you set Firefox to allow to replace context menus by the sites.

When you don't like context menu provided by the site you're on, you toggle JS off - then, on right-click you have original Firefox menu. Toggle on and you have site's menu back.

Remember however that when the page loads, you should probably have JS turned on, otherwise you may have to reload the page for certain onload JavaScripts to be invoked.

BTW. The Toggle JavaScript on/off button, contrary to Stop Flash button, does not kill JavaScript, only let's call it "pauses it". You have to use both to see the difference ;) "Stop Flash" will kill all preloaded YouTube videos for instance, and after switching it back on, all the Flash content will have to be reloaded. JavaScript is only paused.

0
1

If you have a keyboard with a context menu button (to the right of the space bar on most English keyboards) you can always display the default applications context menu (ie. the browsers context menu) by hitting this key.

Context menu key on the keyboard

If you have a 3 (or more) button mouse then you could configure one of the other buttons to display the applications context menu (more commonly displayed with the right mouse button).

2
  • Yes but... the contents of this menu depend on what I right-click on. Try this: right-click on the image you inserted. There is a "View Image" menu item. Now try to achieve the same with the Menu key. Impossible.
    – RomanSt
    Dec 10, 2011 at 17:16
  • @romkyns: Ah, yes that is true. The Apps key would seem to display the context menu for whatever page element (in the browser at least) has focus. Whilst this might work for anchors and some other tab-able elements, images do not seem to receive focus, so their context menu cannot be accessed by the keyboard? (Aside: I wonder how this affects accessibility for keyboard-only users?)
    – MrWhite
    Dec 10, 2011 at 18:24
1

You can disable Javascript changing the context menu per site, if you use a Greasemonkey script: http://www.orbona.com/greasemonkey/show.php?gscript=15 You can include or exclude pages as you like.

// ==UserScript== 
// @name Enable Context Menu 
// @description Restore context menus on specific sites that try to disable them 
// @namespace http://www.orbona.com/greasemonkey/ 
// @include http://*marktplaats.nl/*
// @include http*
// @exclude http*://maps.google.com/*
// ==/UserScript== 

function doIt() { 
    unsafeWindow.document.onmousedown = null;
    unsafeWindow.onmousedown = null;
    unsafeWindow.document.oncontextmenu = null;
    unsafeWindow.oncontextmenu = null;
if (document.all) { 
    allElemsCount = document.all.length;
    for (var i = 0;i < allElemsCount;i++) { document.all[i].setAttribute("oncontextmenu", "return true;");
    document.all[i].setAttribute("onmousedown", "return true;");
    document.all[i].setAttribute("onmouseup", "return true;");
} } 
else { 
    allElems = document.getElementsByTagName('*');
    allElemsCount = allElems.length;
for (var i = 0;i < allElemsCount;i++) { 
    allElems[i].setAttribute("oncontextmenu", "return true;");
    allElems[i].setAttribute("onmousedown", "return true;");
    allElems[i].setAttribute("onmouseup", "return true;");
} } } 
window.addEventListener("load", function() { doIt();
}, false);
1
  • Well yeah, but the page in question has a useful right-click menu. I can't just turn it off without losing a lot of functionality. Google Docs Spreadsheet is another such example.
    – RomanSt
    Jul 2, 2012 at 9:16
-2

I've tried it, and it works properly. No custom menu on Google docs nor on NewsBlur. The menu you showed in the picture, is a drop down menu and not a right-click menu.

Also, make sure you've installed the latest version.

7
  • 1
    -1 It works properly, but there IS a custom (context) menu on NewsBlur. The (green) menu shown in the picture is a drop down menu AND is also available as a right-mouse context menu, overriding the default. This is using FF8 with default settings (which permits scripts to replace context menus - the right mouse onclick event). IMO NewsBlur should not be overriding the context menu in this instance, since the same menu is already available via the drop down. Google Docs also has a context menu when in the document itself.
    – MrWhite
    Dec 9, 2011 at 12:25
  • This is just a drop down menu that's activated with right-clicking. If it were a right-click menu, it would open at the mouse's location. Google Docs does not override it when I tell FF not to allow this. Dec 9, 2011 at 12:31
  • "This is just a drop down menu that's activated with right-clicking." - Yes, but in doing so it has overridden the applications default context menu (which is also opened by right clicking). It only opens at the mouse's location if the developer has specifically programmed it to do so.
    – MrWhite
    Dec 9, 2011 at 16:51
  • No it does not override it, because it isn't a right-click menu. Dec 9, 2011 at 19:10
  • What do you mean "it does not override it"? If you right-click anywhere in the navigation area on the left on NewsBlur you get the green popup menu, you do not get the browsers default context menu, it has therefore been overridden. (Unless you have specifically unchecked the option in Firefox to prevent such behaviour.)
    – MrWhite
    Dec 9, 2011 at 19:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .