0
How to disable console in web? Is there any code for this?
Consol log is disturbing little bit during practice.
3 Réponses
+ 2
This must be your very first script in head tag:
console.log = function(){ };
To help you understand Tarun Pandey's answer i'm giving you the original article:
https://www.queness.com/post/16151/disable-javascript-console-in-browsers
It's ugly , old and doesn't work for all environments. I can't recommend that.
+ 1
To disable Javascript console, we need to throw an exception in the get accessor by checking if the property attached by chrome developer tool exists. With this script above, user won't be allowed to enter Javascript in the console. It also blocks auto-complete in console too.
+ 1
Thank you friends! I appreciate your help!