Skip to content

Instantly share code, notes, and snippets.

@olimortimer
Last active August 29, 2015 13:57
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 olimortimer/9394985 to your computer and use it in GitHub Desktop.
Save olimortimer/9394985 to your computer and use it in GitHub Desktop.
JS: Disable Javascript Console
(function() {
try {
var $_console$$ = console;
Object.defineProperty(window, "console", {
get: function() {
if ($_console$$._commandLineAPI)
throw "Sorry, for security reasons, the script console is deactivated";
return $_console$$
},
set: function($val$$) {
$_console$$ = $val$$
}
})
} catch ($ignore$$) {
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment