4

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

Vinny
  • 570
  • 2
  • 10
  • 24

2 Answers2

19

You can style console.log messages:

console.log('%cStop!', 'color: red; font-size: 30px; font-weight: bold;');
Marinus Klasen
  • 358
  • 1
  • 4
4

You can use console.warn() at load event of window.

guest271314
  • 1
  • 12
  • 91
  • 170