'Code to display warning message when the console is activated?

Self-XSS - History and mitigation states that

Facebook and others now display a warning message when users open the web developer console

What is the HTML/Javascript code to display a warning message when the console is activated?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source