反禁用开发者工具JS,和熊孩子们说再见!

过去有站长为了防复制禁用了鼠标右键,现在一些网站竟然连开发者工具都禁止开启,这个社会怎么了?

今天有朋友告诉我有一些网站挂上了禁用开发者工具的JS,我很诧异,虽然国内的脑残站长很多,但是听说有人禁用开发者工具的还是头一次.如果有人真要抄袭你的网站,用个JS禁用掉开发者工具根本没用,如果是搞采集的站长,根本就不需要鸟你的JS.这种脑残行为最好不要出现下一例了.

下面还是讲讲正题,怎么把这些熊孩子站长的禁用开发者工具JS处理掉,我相信大多数同行都是会的.

禁用开发者工具的JS如下:

var _0x1715=["\x6C\x6F\x63\x61\x74\x69\x6F\x6E","\x61\x62\x6F\x75\x74\x3A\x62\x6C\x61\x6E\x6B","\x63\x6C\x6F\x73\x65","\x70\x72\x6F\x66\x69\x6C\x65","\x70\x72\x6F\x66\x69\x6C\x65\x45\x6E\x64","\x63\x6C\x65\x61\x72","\x6C\x65\x6E\x67\x74\x68","\x70\x72\x6F\x66\x69\x6C\x65\x73","\x63\x6F\x6E\x73\x6F\x6C\x65","\x66\x69\x72\x65\x62\x75\x67","\x6F\x62\x6A\x65\x63\x74","\x70\x6F\x73\x74\x45\x72\x72\x6F\x72","\x66\x75\x6E\x63\x74\x69\x6F\x6E","\x6F\x6E\x72\x65\x73\x69\x7A\x65","\x6F\x75\x74\x65\x72\x48\x65\x69\x67\x68\x74","\x69\x6E\x6E\x65\x72\x48\x65\x69\x67\x68\x74","\x6B\x65\x79\x64\x6F\x77\x6E","\x65\x76\x65\x6E\x74","\x6B\x65\x79\x43\x6F\x64\x65","\x77\x68\x69\x63\x68"];function fuckyou(){window[_0x1715[0]]=_0x1715[1];window[_0x1715[2]]();} ;function ck(){console[_0x1715[3]]();console[_0x1715[4]]();if(console[_0x1715[5]]){console[_0x1715[5]]();} ;return console[_0x1715[7]][_0x1715[6]]>0;} ;function hehe(){if((window[_0x1715[8]]&&window[_0x1715[8]][_0x1715[9]])||( typeof opera==_0x1715[10]&& typeof opera[_0x1715[11]]==_0x1715[12])){fuckyou();} ;if(ck()){fuckyou();} ;} ;hehe();window[_0x1715[13]]=function (){if((window[_0x1715[14]]-window[_0x1715[15]])>200){fuckyou();} ;} ;$(document)[_0x1715[16]](function (){return key(arguments[0]);} );function key(_0x2f04x5){var _0x2f04x6;if(window[_0x1715[17]]){_0x2f04x6=_0x2f04x5[_0x1715[18]];} else {if(_0x2f04x5[_0x1715[19]]){_0x2f04x6=_0x2f04x5[_0x1715[19]];} ;} ;if(_0x2f04x6==123){window[_0x1715[2]]();return false;} ;} ;  

简单翻译一下代码:

function fuckyou() {  
    window.location = 'about:blank';
    window.close();
};

function ck() {  
    console.profile();
    console.profileEnd();
    if (console.clear) {
        console.clear();
    };
    return console.profiles.length > 0;
};

function hehe() {  
    if ((window.console && window.console.firebug) || (typeof opera == "object" && typeof opera.postError == "function")) {
        fuckyou();
    };
    if (ck()) {
        fuckyou();
    };
};

hehe();

window.onresize = function() {  
    if ((window.outerHeight - window.innerHeight) > 200) {
        fuckyou();
    };
};

$(document).keydown(function() {
    return key(arguments[0]);
});

function key(a) {  
    var b;
    if (window.event) {
        b = a.keyCode;
    } else {
        if (a.which) {
            b = a.which;
        };
    };
    if (b == 123) {
        window.close();
        return false;
    };
};

我看到了混用原生javascript和jQuery,作为一个完美主义者实在是不能忍.

这里面最主要的代码是fuckyou函数,这个函数会跳转当前页面到空白页并关闭该页面.

解决的方法比较简单,在浏览器的地址栏输入以下内容并回车即可:

javascript:fuckyou=ck=hehe=window.onresize=key=null  

如果你不想每次都用地址栏解决问题,也可以自己写一款浏览器扩展,这没什么难度.

当然一劳永逸的方法也是有的,把这些熊孩子们的网站都列入黑名单吧!