javascript - Disable Firefox's silly right click context menu -


i making html 5 game requires use of right click control player.

i have been able disable right click context menu doing:

<body oncontextmenu="return(false);"> 

then came attention if hold shift , right click, context menu still opens in firefox!

so disabled adding js well:

document.onclick = function(e) { if(e.button == 2 || e.button == 3) { e.preventdefault(); e.stoppropagation(); return(false); } }; 

however, if hold shift, , double right click in firefox still opens!

please tell me how disable bloody thing once , (i'm willing revert obscure, hacky, , unpractical solution, long works).

you never able entirely disable context menu in cases, firefox has setting allows user tell browser ignore such hijinx trying pull. note: i'm on mac, setting in pretty uch same place on platforms.

that being said, try event.preventdefault() (see vikash madhow's comment on other question: how disable right-click context-menu in javascript)


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -