js检测开发者工具Devtools是否打开

js检测开发者工具Devtools是否打开

1
2
3
4
5
6
var re = /x/;
console.log(re);

re.toString = function () {
return '您打开了控制台,想查找什么呢';
};

toString() is not called on logged objects unless the console is open

参考: https://stackoverflow.com/questions/7798748/find-out-whether-chrome-console-is-open/30638226#30638226

您的支持将鼓励我继续创作!