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

c++ - Function signature as a function template parameter -

How to call a javascript function after the page loads with a chrome extension? -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -