6

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
  • 597
  • 3
  • 11
  • 26

2 Answers2

22

You can style console.log messages:

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

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

guest271314
  • 1
  • 15
  • 104
  • 177