禁止页面右键、选择、F12操作

 

<script>
    //禁止右键
    $(document).bind("contextmenu",function(){return false;});
    //禁止选择
    $(document).bind("selectstart",function(){return false;});
    //禁止F12
    document.onkeydown = function(){
        if(window.event && window.event.keyCode == 123) {
            event.keyCode = 0;
            event.returnValue = false;
        }
       }
</script>

原文https://cloud.tencent.com/developer/article/1560959

 

posted @ 2020-06-15 10:22  塞巴斯酱  阅读(664)  评论(0编辑  收藏  举报