EN
JavaScript - display security warning for non-programmers in web browser console
1 points
In this article, we would like to show how to print security warnings in the web browser console that warns non-programmers about dangers caused by pasting, copying, or executing some code there.

Note:
console.log()
print was formatted with styles / CSS.
Practical example:
xxxxxxxxxx
1
2
<html>
3
<body>
4
<script>
5
6
var headStyle = 'text-shadow: 0px 0px 4px #ff0; font-weight: 700; font-size: 50px; color: red';
7
var textStyle = 'font-weight: 700; font-size: 16px; color: blue';
8
var warningStyle = 'font-weight: 700; font-size: 20px; color: red';
9
10
console.log(
11
'\n' +
12
'%cStop!\n' +
13
'%cThis feature is created only for software developers.\n' +
14
'%cIf someone asked you to copy, paste or do something here don\'t do it!\n\n' +
15
'%cIt can be dangerous and can lead to HACKs on your account!\n\n',
16
headStyle, textStyle, textStyle, warningStyle
17
);
18
19
</script>
20
</body>
21
</html>