-1

I tried disabling the console but it didnt work in my chrome for some reason.

How does Facebook disable the browser's integrated Developer Tools?

Code

    $(document).ready(function(){ 

     with ((console && console._commandLineAPI) || {}) {
    (function() {
        try {
            var $_console$$ = console;
            Object.defineProperty(window, "console", {
                get: function() {
                    if ($_console$$._commandLineAPI)
                        throw "Sorry, for security reasons, the script console is deactivated on netflix.com";
                    return $_console$$
                },
                set: function($val$$) {
                    $_console$$ = $val$$
                }
            })
        } catch ($ignore$$) { 
        }
    })();
     }
});

function abs(){
  return "Hey Its not Working";
}

When i run abs() from console it shows me output Hey Its not Working which means its not disabled. So am i doing something wrong ?

Community
  • 1
  • 1
John Doe
  • 53
  • 5

1 Answers1

0

Google repaired the console so that it is no longer possible to disable it in that way.

Note that Facebook does still add a warning message to the console, but you can still freely run arbitrary code there.

At this time there is no mechanism to prevent someone from using the Developer Tools to... well, develop stuff.

VoteyDisciple
  • 37,319
  • 5
  • 97
  • 97
  • Is there any reverse engineer scripts out to google's fix yet ? – John Doe Mar 22 '16 at 15:54
  • No. At this time there is no mechanism to prevent someone from using Developer Tools. (Nor, realistically, would any browser author allow there to be for long — the whole point of Developer Tools is not to be impacted by what's on the page, so that it can remain a tool for developers.) – VoteyDisciple Mar 22 '16 at 15:56