You can defeat this without any extensions, here is how:
Since this only applies to Chrome, so do the instructions:
1) Open netflix.com
2) Open developer tools.
3) Go to Sources tab.
4) Click on the tiny icon for "Show Navigator" on the left.
5) Find the JavaScript file that has:
(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$$){}})();
For me this is cdn1.nflxext.com/FilePackageGetter/sharedSystem/pkg-nflxsrc-*
6) For me the offending line is line 3. Click on the line number, this will set a breakpoint.
7) Reload the page, now the Script will pause before running line 3.
You don't need the breakpoint. Just run Object.defineProperty(window, "console", {configurable: false}); before loading netflix and you are good to go ;)
That doesn't work for me. When the page load happens aren't a new set of client-side browser object created? Do you have any more detailed information?
Yes, or if this becomes common one could easily write a little Chrome plugin that stashes a reference to the console and checks to see if it has been disabled (onload and on an interval) and simply puts it back.
The only thing Netflix's 'security' measure does is make me respect the company a bit less. Who, precisely is this going to hurt? A serious "attacker" is going to be stopped for about 15 seconds. It might stymie some kid trying to learn about front-end web dev. Good job Netflix!
The most benign explanation I can think of is to prevent an attacker from using social engineering where they give the victim a command to run in the JavaScript console.
Sites with a large number of inexperienced users (including children) have to think about these things.
The other day at work, my co-worker noticed that FB was hijacking the console object. When you trying to invoke console.log it would output in big red letters telling you that it was dangerous to paste js into webpages. And offered a url to a page you could turn off the warning.
I just tried it now on my FB account and it looks like they didn't touch my console. My guess is that I've been developing apps on FB since 2007 and maybe i already disabled that via something long ago.
It was something they only ever rolled out experimentally to a few users as far as I know. Having worked on a relatively popular social network before the reason they did it made perfect sense to me. A lot of people are really willing to buy in to the idea that they'll get some special treatment if they say a magic incantation into a thing they don't understand.
Just look at those "Forward this email or Bill Gates will kill MSN/sell your children/make the moon landing fake!" things that used to go around. People fell for them.
I think the most compelling example of this is something called "Freemen on the Land", and related belief systems. Instead of people's ignorance of technology, it exploits their ignorance of the basics of law. Like, did you know the government holds hundreds of millions of dollars in your name in a secret account? If you just say the right magical incantation in court, you can use it to pay off your parking tickets. Many people have believed this and tried it.
If you haven't heard of it before, prepare for a journey through Wikipedia as fascinating as it is pitiful.
According to the stackoverflow link, it appears to be a soak test on certain accounts. If you aren't affected (or if you have developer tools on) it will likely not do this.
Since this only applies to Chrome, so do the instructions:
1) Open netflix.com
2) Open developer tools.
3) Go to Sources tab.
4) Click on the tiny icon for "Show Navigator" on the left.
5) Find the JavaScript file that has: (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$$){}})();
For me this is cdn1.nflxext.com/FilePackageGetter/sharedSystem/pkg-nflxsrc-*
6) For me the offending line is line 3. Click on the line number, this will set a breakpoint.
7) Reload the page, now the Script will pause before running line 3.
8) Switch to the Console tab.
9) Run: Object.defineProperty(window, "console", {configurable: false});
10) Switch back to the Sources tab and press the resume script button or F8.
11) Enjoy console access again.