[英]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? 当我在Facebook和Blockchain等网站上打开控制台时,我收到类似下面的警告,我想知道如何在我的网站上做到这一点? Display a warning telling the user it's dangerous and he should not paste anything there.
显示警告告诉用户它是危险的,他不应该粘贴任何东西。
您可以设置console.log消息的样式:
console.log('%cStop!', 'color: red; font-size: 30px; font-weight: bold;');
您可以在window
load
事件中使用console.warn()
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.