用javascript禁用F12 ctrl+U 右键

枫叶资源网–官网地址
星际导航–官网地址

1、禁用F12 ctrl+U 右键

<script>
    document.oncontextmenu = function () { return false; }
document.onkeydown = function () {
var e = window.event || arguments[0];
if (e.keyCode == 123) {
    return false;
} else if ((e.ctrlKey) && (e.shiftKey) && (e.keyCode == 73)) {
    return false;
} else if ((e.shiftKey) && (e.keyCode == 121)) {
        return false;
} else if ((e.ctrlKey) && (e.keyCode == 85)) {
        return false;
}
};
</script>


<script>

document.onkeydown=function(){
	    
		var e = window.event||arguments[0];
		if(e.keyCode==123){
			    var tempwindow=window.open();
                window.location.href='https://www.baidu3.com/';
				return false;
		}
		if((e.ctrlKey)&&(e.shiftKey)&&(e.keyCode==73)){
            window.location.href='https://www.baidu4.com/';
			return false;
		}
		if((e.ctrlKey)&&(e.keyCode==85)){
			window.location.href='https://www.baidu5.com/';
			return false;
		}
		if((e.ctrlKey)&&(e.keyCode==83)){
		  window.location.href='https://www.baidu6.com/';
		   return false;
		}if ((e.shiftKey) && (e.keyCode == 121)) {
        return false;
        }if (e.keyCode == 123) {
            window.location.href='https://www.baidu7.com/';
            return false;
        }
        	}
   
	document.oncontextmenu=function(){
       window.location.href='https://www.baidu8.com/';
		return false;
	}
  
	var threshold = 160;
	window.setInterval(function() {  
	    if (window.outerWidth - window.innerWidth > threshold ||   
	    window.outerHeight - window.innerHeight > threshold) {  
			function disableDebugger() {
			    window.location.href='https://www.baidu9.com/';
				debugger;
			}
			$(document).ready(function () {
			    window.location.href='https://www.baidu10.com/';
			    debugger;
			});
	    }  
	}, 1e3);
</script>


<script >
    document.oncontextmenu = new Function("event.returnValue=false;"); //禁止右键功能
	document.onkeydown = MM_KeyPress;

    function MM_KeyPress(num) {
        //防止系统退格键
        var keycODe = event.keyCODe;
        if (keycode == 8) //屏蔽退格健
        {
            event.keyCode = 0;
            return;
        }
        if (keycode >= 122 && keycode <= 123) //屏蔽f12功能键
        {
            event.keyCode = 0;
            event.returnValue = false;
            return;
        }
    } 
</script>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值