打开控制台的三种方式
1.鼠标右键的检查
2.键盘F12按
3.Ctrl+Shift+J 快捷键
…
对应的禁用方式:
禁用鼠标右键 window.οncοntextmenu = function (e) { return false; };
禁用F12键 window.onkeydown = function () { if (window.event && window.event.keyCode == 123) { return false; } };
禁用Ctrl+Shift+J 快捷键 window.onkeydown = function () { if (window.event && window.event.keyCode == 17) { return false if (window.event && window.event.keyCode == 16) { return false; } }
禁用控制台(汇总)
window.οncοntextmenu = function (e) { return false; }; window.onkeydown = function () { if (window.event && window.event.keyCode == 123) { return false; } if (window.event && window.event.keyCode == 17) { return false if (window.event && window.event.keyCode == 16) { return false; } };