Created
July 7, 2017 19:49
-
-
Save ConnerAiken/90f1cd92fe90feada006d62b8b9615bb to your computer and use it in GitHub Desktop.
Disable right-click in webpages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('contextmenu', event => event.preventDefault()); | |
// This will annoy users and some browsers prevent this behavior so test accordingly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment