You must Sign In to post a response.
  • Category: JavaScript

    How to disable the console code in all brower using javascript

    i have create the simple Asp.net MVC 4 web application. so how I can disabled/restrict console code execuition in developer tools within browsers specifically chrome using java script.
  • #753650
    Hi,
    I am confused with you query. What is there console application you have? You mentioned that you have created web application, which means you will not have any console window. Can you please explain clearly what exactly is the issue you are facing.


    Regards,
    Asheej T K

  • #753651
    <script type="'text/javascript'">
    (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;
    }
    });

    })();
    </script>

    I Hope To Use Full..
    And Choice The Best Answers

    php-wordpress Developer
    you can any problem to php wordpress to contact me
    jivanibhai7306@gmail.com
    Thanks!!...

  • #753722
    Can you please explain are you having nay issue in creating such application or the code you have some problem.

    Please be specific in what you are asking.

    Thanks & Regards
    Anil Kumar Pandey
    Microsoft MVP, DNS MVM


  • Sign In to post your comments