Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display a warning to users who open the Chrome console, like Facebook and Blockchain does?

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.

enter image description here

like image 697
Vinny Avatar asked Nov 30 '22 15:11

Vinny


1 Answers

You can style console.log messages:

console.log('%cStop!', 'color: red; font-size: 30px; font-weight: bold;');
like image 159
Marinus Klasen Avatar answered Dec 04 '22 13:12

Marinus Klasen