Skip to content

Instantly share code, notes, and snippets.

@kossoff
Last active August 29, 2015 14:16
Show Gist options
  • Save kossoff/8b73fa8ecd32606bbbb7 to your computer and use it in GitHub Desktop.
Save kossoff/8b73fa8ecd32606bbbb7 to your computer and use it in GitHub Desktop.
Disable right click & context menu for page
<body oncontextmenu="return false">
...
<script>
document.onmousedown=disableclick;
function disableclick ( event ) {
if ( event.button == 2 ) { return false; }
};
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment