html的禁止右键以及f12的script代码分享
2022-07-16 18:40:41 548阅读 0评论 0点赞

又是许久没更新了

最近整到了一些api接口以及自己写了一些,在努力修复测试

本文下面就可以有一个查询的网址,当然需要回复才可以看到哦

html的禁止右键以及f12代码分享

之前咸鱼分享过php的禁止代码
其实大同小异,这次咸鱼去搞来了html的,下面就直接上代码分享

 <script>
//屏蔽F12和右键
 function click(e) {
 if (document.all) {
 if (event.button == 2 || event.button == 3) {
 alert("欢迎光临寒舍,有什么需要帮忙的话,请与站长联系!谢谢您的合作!!!");
          oncontextmenu = 'return false';
        }
      }
 if (document.layers) {
 if (e.which == 3) {
          oncontextmenu = 'return false';
        }
      }
    }
 if (document.layers) {
      document.captureEvents(Event.MOUSEDOWN);
    }
    document.onmousedown = click;
    document.oncontextmenu = new Function("return false;")

    document.onkeydown = document.onkeyup = document.onkeypress = function () {
 if (window.event.keyCode == 123) {
        window.event.returnValue = false;
 return (false);
      }
    }
</script>

以上就是代码了,html不想让别人看到的话,就放在

<head>这里吧</head>

以下为查询信息的网站地址

此处内容作者设置了 评论 可见

评论

取消