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
Post a Comment