When I open the console on some sites like Facebook and Blockchain, I get a warning like the one below, I was wondering how I can do that on my site? Display a warning telling the user it's dangerous and he should not paste anything there.
How can I display a warning to users who open the Chrome console, like Facebook and Blockchain does?
Asked
Active
Viewed 3,566 times
6
-
It is just a console.log – epascarello Feb 10 '17 at 17:25
-
They're just logging to the console, and they make sure not to have anything else in the log, just that message – chiliNUT Feb 10 '17 at 17:26
-
1Answer to this is explained better on following link: http://stackoverflow.com/questions/21692646/how-does-facebook-disable-the-browsers-integrated-developer-tools – Avtar Nanrey Feb 10 '17 at 17:31
2 Answers
22
You can style console.log messages:
console.log('%cStop!', 'color: red; font-size: 30px; font-weight: bold;');

Marinus Klasen
- 388
- 1
- 5