有个神奇的东西叫做审查元素,按下神奇的F12,就是见证奇迹的时刻。审查元素真的是一个强大功能,有的时候看中别人网站的某个样式做的比较好,按下F12审查元素来查看别人的代码,统统扒过来。那么如果防止别人查看自己网站的代码,扒代码呢,当然,也只是防新手而已~心理安慰~

一、防F12扒代码:按下F12关闭当前页面
使用方法:添加到footer.php即可,高手一般能破解,哈哈。

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>

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

<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>

Q.E.D.


如人饮水、冷暖自知