WordPress添加防止F12扒代码(两种) | 闲鱼博客 macrr.com

Submitted by Yin in wordpress

一、防F12扒代码:按下F12关闭当前页面 使用方法:添加到footer.php即可,不过貌似这个能破解,哈哈。

<div>
  <script>function fuckyou(){  
 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();  
}</script>
</div>

二、防F12扒代码:按下F12画面卡死 使用方法:添加到footer.php即可,这个也能破解,感觉这个更牛一点。来自inlojv。

<div>
  <script type="text/Javascript">function inlobase_noF12(){while(1){}}function inlojv_console(){if((window.console&&(console.firebug||console.table&&/firebug/i.test(console.table())))||(typeof opera=="object"&&typeof opera.postError=="function"&&console.profile.length>0)){inlobase_noF12()}if(typeof console.profiles=="object"&&console.profiles.length>0){inlobase_noF12()}}inlojv_console();window.onresize=function(){if((window.outerHeight-window.innerHeight)>200){inlobase_noF12()}};</script>
</div>
1

You must log in or register to comment.

There's nothing here...