1.鼠标点击事件

document.onmousedown = function mdClick(event) {
    var e = event || window.event || arguments.callee.caller.arguments[0];
    if (e.button == 2 || e.button == 3) {
        mAlert();
    }
}

 2. 禁用浏览器 默认右键菜单

document.oncontextmenu = new Function("return false;");

 3.监听键盘事件

document.onkeydown = document.onkeyup = document.onkeypress = function(event) {
    var e = event || window.event || arguments.callee.caller.arguments[0];

    if (e && e.keyCode == 123) {
            mAlert();
            e.returnValue = false;
            return (false);
    }
}
function mAlert() {
    alert("禁止操作控制台");
}

 

作者:非凡jk
来源:CSDN
原文:https://blog.csdn.net/jamesi987/article/details/78840802
版权声明:本文为博主原创文章,转载请附上博文链接!

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-31
  • 2021-06-05
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
相关资源
相似解决方案