Skip to content

Instantly share code, notes, and snippets.

@code-boxx
Created June 13, 2023 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-boxx/c328ba7142a00a68d5d709e3e982474f to your computer and use it in GitHub Desktop.
Save code-boxx/c328ba7142a00a68d5d709e3e982474f to your computer and use it in GitHub Desktop.
Hide Javascript Source Code

WAYS TO "HIDE" JAVASCRIPT SOURCE CODE

https://code-boxx.com/hide-javascript-code-from-client/

LICENSE

Copyright by Code Boxx

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

https://obfuscator.io/
https://javascriptobfuscator.com/Javascript-Obfuscator.aspx
https://www.daftlogic.com/projects-online-javascript-obfuscator.htm
http://www.freejsobfuscator.com/
https://www.online-toolz.com/tools/javascript-obfuscator.php
https://javascriptobfuscator.com/downloads.aspx
https://github.com/search?q=org%3Ajavascript-obfuscator+JavaScript+Obfuscator&unscoped_q=JavaScript+Obfuscator
<!DOCTYPE html>
<html>
<head>
<title>
Disable Right Click Context Menu
</title>
<script>
document.addEventListener("contextmenu", (e) => {
e.preventDefault();
}, false);
</script>
</head>
<body>
<p>
Try to right click on this page - Nothing will happen.
</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>
Disable Control and Function Keys
</title>
<script>
document.addEventListener("keydown", (e) => {
// USE THIS TO DISABLE CONTROL AND ALL FUNCTION KEYS
// if (e.ctrlKey || (e.keyCode>=112 && e.keyCode<=123)) {
// THIS WILL ONLY DISABLE CONTROL AND F12
if (e.ctrlKey || e.keyCode==123) {
e.stopPropagation();
e.preventDefault();
}
});
</script>
</head>
<body>
<p>
Try to press CTRL-U or F12 - Nothing will probably happen.
</p>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment