php屏蔽右键代码,禁止F12及鼠标右键代码

document.οncοntextmenu=new Function("event.returnValue=false;"); //禁止右键功能

document.οnkeydοwn=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;

}

}

window.close(); //关闭当前窗口(防抽)

window.location="about:blank"; //将当前窗口跳转置空白页

}

function ck() {

console.profile();

console.profileEnd();

//我们判断一下profiles里面有没有东西,如果有,肯定有人按F12了,没错!!

if(console.clear) { console.clear() };

if (typeof console.profiles =="object"){

return console.profiles.length > 0;

}

}

function hehe(){

if( (window.console && (console.firebug || console.table && /firebug/i.test(console.table()) )) || (typeof opera == 'object' && typeof opera.postError == 'function' && console.profile.length > 0)){

fuckyou();

}

if(typeof console.profiles =="object"&&console.profiles.length > 0){

fuckyou();

}

}

hehe();

window.onresize = function(){

if((window.outerHeight-window.innerHeight)>200)

//判断当前窗口内页高度和窗口高度,如果差值大于200,那么呵呵

fuckyou();

}

一般来说添加到底部文件中例如:footer.php文件末端。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值