Disable JavaScript execution from console

As seen on http://kspace.in/blog/2013/02/22/disable-javascript-execution-from-console/ What is a disable javascript execution from console How do you make a disable javascript execution from console? This script and codes were developed by Ludvig Lindblom on 19 March 2022, Saturday.

How do I make an disable javascript execution from console?
  1. Disable JavaScript execution from console Previews
  2. Disable JavaScript execution from console HTML Codes
  3. Disable JavaScript execution from console CSS Codes
  4. Disable JavaScript execution from console JS Codes
Disable JavaScript execution from console Previews

Disable JavaScript execution from console HTML Codes

<!DOCTYPE html>
<html >
<head>
  <meta charset="UTF-8">
  <title>Disable JavaScript execution from console</title>
  
  
  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>
  <p>You should not be able to execute scripts from the console.</p>
<p>
  Ope n
  <a href='https://s.codepen.io/ludviglindblom/fullpage/aJCnt?'>this page in a new window</a>
  and press ⌘ + ⌥ + i to ope n console and try it, even autocomplete should be disabled.
</p>
<i>Only works in Google Chroms (as far as I know).</i>
  
    <script  src="js/index.js"></script>

</body>
</html>

Disable JavaScript execution from console CSS Codes

body {
  background: #eee;
  color: #333;
  font: 100%/1.3 sans-serif;
  text-align: center;
}

i {
  font-size: 80%;
}

a {
  color: #f00;
}

Disable JavaScript execution from console JS Codes

(function(){
  var _z = console;
  Object.defineProperty( window, "console", {
    get : function(){
      if( _z._commandLineAPI ){
        throw "Sorry, can't exceute scripts!";
      }
      return _z; 
    },
    set : function(val){
      _z = val;
    }
  });
})();
Do you want hide your ip address?Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup.