如何仅在智能手机的Chrome上隐藏Javascript?但是不是在其他移动浏览器(或台式机)中吗?

时间:2018-12-04 15:11:18

标签: javascript google-chrome smartphone

我的网页上有一个内联JavaScript,我不想在智能手机上的Chrome上下载,解析或执行。

如何实现?我想要这个,是因为脚本的功能在智能手机的Chrome上无用。由于必须下载,解析和执行JavaScript,这只会使网页变慢。

该脚本已经在页脚中,但是仍然最好将其隐藏在智能手机Chrome中。

谢谢。

这是我的剧本

<script type="text/javascript"  charset="utf-8">
eval(function(e,t,n,o,i,a){if(i=function(e){return(t>e?"":i(parseInt(e/t)))+((e%=t)>35?String.fromCharCode(e+29):e.toString(36))},!"".replace(/^/,String)){for(;n--;)a[i(n)]=o[n]||i(n)
o=[function(e){return a[e]}],i=function(){return"\\w+"},n=1}for(;n--;)o[n]&&(e=e.replace(RegExp("\\b"+i(n)+"\\b","g"),o[n]))
return e}(";q O='',28='1V';1R(q i=0;i<12;i++)O+=28.X(D.N(D.J()*28.F));q 2A=8,2u=4q,2w=4p,2y=55,2U=B(t){q o=!1,i=B(){z(k.1g){k.2T('2Z',e);E.2T('1U',e)}P{k.2P('2O',e);E.2P('1W',e)}},e=B(){z(!o&&(k.1g||4o.2d==='1U'||k.2J==='37')){o=!0;i();t()}};z(k.2J==='37'){t()}P z(k.1g){k.1g('2Z',e);E.1g('1U',e)}P{k.2M('2O',e);E.2M('1W',e);q n=!1;2K{n=E.4m==4l&&k.1Y}2Q(a){};z(n&&n.2L){(B r(){z(o)G;2K{n.2L('17')}2Q(e){G 4k(r,50)};o=!0;i();t()})()}}};E[''+O+'']=(B(){q t={t$:'1V+/=',4j:B(e){q r='',d,n,o,c,s,l,i,a=0;e=t.e$(e);1a(a<e.F){d=e.14(a++);n=e.14(a++);o=e.14(a++);c=d>>2;s=(d&3)<<4|n>>4;l=(n&15)<<2|o>>6;i=o&63;z(2V(n)){l=i=64}P z(2V(o)){i=64};r=r+U.t$.X(c)+U.t$.X(s)+U.t$.X(l)+U.t$.X(i)};G r},11:B(e){q n='',d,l,c,s,a,i,r,o=0;e=e.1A(/[^A-4i-4h-9\\+\\/\\=]/g,'');1a(o<e.F){s=U.t$.1H(e.X(o++));a=U.t$.1H(e.X(o++));i=U.t$.1H(e.X(o++));r=U.t$.1H(e.X(o++));d=s<<2|a>>4;l=(a&15)<<4|i>>2;c=(i&3)<<6|r;n=n+S.T(d);z(i!=64){n=n+S.T(l)};z(r!=64){n=n+S.T(c)}};n=t.n$(n);G n},e$:B(t){t=t.1A(/;/g,';');q n='';1R(q o=0;o<t.F;o++){q e=t.14(o);z(e<1s){n+=S.T(e)}P z(e>4g&&e<4f){n+=S.T(e>>6|4e);n+=S.T(e&63|1s)}P{n+=S.T(e>>12|2p);n+=S.T(e>>6&63|1s);n+=S.T(e&63|1s)}};G n},n$:B(t){q o='',e=0,n=4d=1u=0;1a(e<t.F){n=t.14(e);z(n<1s){o+=S.T(n);e++}P z(n>4b&&n<2p){1u=t.14(e+1);o+=S.T((n&31)<<6|1u&63);e+=2}P{1u=t.14(e+1);2m=t.14(e+2);o+=S.T((n&15)<<12|(1u&63)<<6|2m&63);e+=3}};G o}};q r=['3W==','4a','49=','48','47','46=','45=','44=','43','42','41=','40=','3Z','3Y','3X=','4r','4c=','4s=','4K=','4M=','4N=','4O=','4P==','4Q==','4R==','4L==','4S=','4U','4V','4W','4X','4Y','4Z','4T==','4J=','4u=','3U=','4H==','4G=','4F','4E=','4D=','4C==','4B=','4A==','4z==','4y=','4x=','4w','4v==','4t==','3V','3C==','3o='],y=D.N(D.J()*r.F),Y=t.11(r[y]),w=Y,Q=1,W='#3m',a='#3l',v='#3k',g='#3j',Z='',p='3h!',b='3g 3e 3c 3a\\'38 39 3b 2f 2g. 3p\\'s 3i.  3r 3G\\'t?',u='3S 3R 3Q-3P, 3O 3q\\'t 3M 3L U 3J 3H.',s='I 3F, I 3s 3E 3D 2f 2g.  3z 3y 3w!',o=0,f=0,n='3v.3u',l=0,C=e()+'.2k';B h(t){z(t)t=t.1S(t.F-15);q o=k.2F('2x');1R(q n=o.F;n--;){q e=S(o[n].1G);z(e)e=e.1S(e.F-15);z(e===t)G!0};G!1};B m(t){z(t)t=t.1S(t.F-15);q e=k.3d;x=0;1a(x<e.F){1n=e[x].1Q;z(1n)1n=1n.1S(1n.F-15);z(1n===t)G!0;x++};G!1};B e(t){q n='',o='1V';t=t||30;1R(q e=0;e<t;e++)n+=o.X(D.N(D.J()*o.F));G n};B i(o){q i=['3x','3A==','3B','3I','2Y','3K==','3N=','3f==','3n=','51==','4I==','53==','5k','6r','6u','2Y'],a=['33=','6s==','6t==','6w==','6y=','6e','6o=','67=','33=','6d','52==','6i','6m==','6n==','66==','6q='];x=0;1P=[];1a(x<o){c=i[D.N(D.J()*i.F)];d=a[D.N(D.J()*a.F)];c=t.11(c);d=t.11(d);q r=D.N(D.J()*2)+1;z(r==1){n='//'+c+'/'+d}P{n='//'+c+'/'+e(D.N(D.J()*20)+4)+'.2k'};1P[x]=26 24();1P[x].1X=B(){q t=1;1a(t<7){t++}};1P[x].1G=n;x++}};B L(t){};G{35:B(t,a){z(6l k.K=='6k'){G};q o='0.1',a=w,e=k.1d('1y');e.1k=a;e.j.1h='1O';e.j.17='-1o';e.j.V='-1o';e.j.1t='2c';e.j.13='6j';q d=k.K.2e,r=D.N(d.F/2);z(r>15){q n=k.1d('29');n.j.1h='1O';n.j.1t='1r';n.j.13='1r';n.j.V='-1o';n.j.17='-1o';k.K.5Z(n,k.K.2e[r]);n.1f(e);q i=k.1d('1y');i.1k='2q';i.j.1h='1O';i.j.17='-1o';i.j.V='-1o';k.K.1f(i)}P{e.1k='2q';k.K.1f(e)};l=6f(B(){z(e){t((e.1T==0),o);t((e.23==0),o);t((e.1K=='2G'),o);t((e.1N=='2n'),o);t((e.1J==0),o)}P{t(!0,o)}},27)},1F:B(e,c){z((e)&&(o==0)){o=1;E[''+O+''].1z();E[''+O+''].1F=B(){G}}P{q u=t.11('61'),f=k.6c(u);z((f)&&(o==0)){z((2u%3)==0){q l='6b=';l=t.11(l);z(h(l)){z(f.1E.1A(/\\s/g,'').F==0){o=1;E[''+O+''].1z()}}}};q y=!1;z(o==0){z((2w%3)==0){z(!E[''+O+''].2z){q d=['6a==','69==','68=','6p=','62='],m=d.F,a=d[D.N(D.J()*m)],r=a;1a(a==r){r=d[D.N(D.J()*m)]};a=t.11(a);r=t.11(r);i(D.N(D.J()*2)+1);q n=26 24(),s=26 24();n.1X=B(){i(D.N(D.J()*2)+1);s.1G=r;i(D.N(D.J()*2)+1)};s.1X=B(){o=1;i(D.N(D.J()*3)+1);E[''+O+''].1z()};n.1G=a;z((2y%3)==0){n.1W=B(){z((n.13<8)&&(n.13>0)){E[''+O+''].1z()}}};i(D.N(D.J()*3)+1);E[''+O+''].2z=!0};E[''+O+''].1F=B(){G}}}}},1z:B(){z(f==1){q M=2C.3T('2D');z(M>0){G!0}P{2C.6v('2D',(D.J()+1)*27)}};q h='6C==';h=t.11(h);z(!m(h)){q c=k.1d('5w');c.1Z('5X','5t');c.1Z('2d','1m/5s');c.1Z('1Q',h);k.2F('5r')[0].1f(c)};5q(l);k.K.1E='';k.K.j.16+='R:1r !19';k.K.j.16+='1C:1r !19';q C=k.1Y.23||E.34||k.K.23,y=E.5p||k.K.1T||k.1Y.1T,r=k.1d('1y'),Q=e();r.1k=Q;r.j.1h='2l';r.j.17='0';r.j.V='0';r.j.13=C+'1v';r.j.1t=y+'1v';r.j.2H=W;r.j.21='5o';k.K.1f(r);q d='<a 1Q=\"5n://5m.5l\" j=\"H-1e:10.5Y;H-1j:1i-1l;1c:5j;\">5h 54 5g 2x</a>';d=d.1A('5f',e());d=d.1A('5e',e());q i=k.1d('1y');i.1E=d;i.j.1h='1O';i.j.1B='1I';i.j.17='1I';i.j.13='5d';i.j.1t='5c';i.j.21='2i';i.j.1J='.6';i.j.2j='2h';i.1g('5a',B(){n=n.59('').58().57('');E.2E.1Q='//'+n});k.1D(Q).1f(i);q o=k.1d('1y'),L=e();o.1k=L;o.j.1h='2l';o.j.V=y/7+'1v';o.j.5u=C-5i+'1v';o.j.5v=y/3.5+'1v';o.j.2H='#5K';o.j.21='2i';o.j.16+='H-1j: \"5W 5V\", 1w, 1x, 1i-1l !19';o.j.16+='5U-1t: 5T !19';o.j.16+='H-1e: 5S !19';o.j.16+='1m-1p: 1q !19';o.j.16+='1C: 5R !19';o.j.1K+='2R';o.j.2S='1I';o.j.5Q='1I';o.j.5O='2v';k.K.1f(o);o.j.5N='1r 5L 5J -5x 5I(0,0,0,0.3)';o.j.1N='36';q w=30,Y=22,x=18,Z=18;z((E.34<32)||(5H.13<32)){o.j.2N='50%';o.j.16+='H-1e: 5F !19';o.j.2S='5E;';i.j.2N='65%';q w=22,Y=18,x=12,Z=12};o.1E='<2X j=\"1c:#5D;H-1e:'+w+'1L;1c:'+a+';H-1j:1w, 1x, 1i-1l;H-1M:5C;R-V:1b;R-1B:1b;1m-1p:1q;\">'+p+'</2X><2I j=\"H-1e:'+Y+'1L;H-1M:5B;H-1j:1w, 1x, 1i-1l;1c:'+a+';R-V:1b;R-1B:1b;1m-1p:1q;\">'+b+'</2I><5A j=\" 1K: 2R;R-V: 0.2W;R-1B: 0.2W;R-17: 2a;R-2B: 2a; 2r:5z 5y #6g; 13: 25%;1m-1p:1q;\"><p j=\"H-1j:1w, 1x, 1i-1l;H-1M:2s;H-1e:'+x+'1L;1c:'+a+';1m-1p:1q;\">'+u+'</p><p j=\"R-V:5G;\"><29 5M=\"U.j.1J=.9;\" 5P=\"U.j.1J=1;\"  1k=\"'+e()+'\" j=\"2j:2h;H-1e:'+Z+'1L;H-1j:1w, 1x, 1i-1l; H-1M:2s;2r-56:2v;1C:1b;5b-1c:'+v+';1c:'+g+';1C-17:2c;1C-2B:2c;13:60%;R:2a;R-V:1b;R-1B:1b;\" 6h=\"E.2E.6B();\">'+s+'</29></p>'}}})();E.2t=B(t,e){q n=6x.6z,o=E.6A,r=n(),i,a=B(){n()-r<e?i||o(a):t()};o(a);G{3t:B(){i=1}}};q 2o;z(k.K){k.K.j.1N='36'};2U(B(){z(k.1D('2b')){k.1D('2b').j.1N='2G';k.1D('2b').j.1K='2n'};2o=E.2t(B(){E[''+O+''].35(E[''+O+''].1F,E[''+O+''].4n)},2A*27)});",62,411,"|||||||||||||||||||style|document||||||var|||||||||if||function||Math|window|length|return|font||random|body|||floor|bGCzfNwfynis|else||margin|String|fromCharCode|this|top||charAt||||decode||width|charCodeAt||cssText|left||important|while|10px|color|createElement|size|appendChild|addEventListener|position|sans|family|id|serif|text|thisurl|5000px|align|center|0px|128|height|c2|px|Helvetica|geneva|DIV|HBbjbgWxmv|replace|bottom|padding|getElementById|innerHTML|dgbJnyIUWi|src|indexOf|30px|opacity|display|pt|weight|visibility|absolute|spimg|href|for|substr|clientHeight|load|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789|onload|onerror|documentElement|setAttribute||zIndex||clientWidth|Image||new|1000|eVMoZjgdJr|div|auto|babasbmsgx|60px|type|childNodes|ad|blocker|pointer|10000|cursor|jpg|fixed|c3|none|hOujjKPVHh|224|banner_ad|border|300|VIlGZYsxJB|yqNKWNJpks|15px|QsglBqWqmD|script|ymwazBHksb|ranAlready|pDKqNLxKiK|right|sessionStorage|babn|location|getElementsByTagName|hidden|backgroundColor|h1|readyState|try|doScroll|attachEvent|zoom|onreadystatechange|detachEvent|catch|block|marginLeft|removeEventListener|lvlneyLNtH|isNaN|5em|h3|cGFydG5lcmFkcy55c20ueWFob28uY29t|DOMContentLoaded|||640|ZmF2aWNvbi5pY28|innerWidth|aSCmfHLQue|visible|complete|re|using|you|an|like|styleSheets|looks|YWR2ZXJ0aXNpbmcuYW9sLmNvbQ|It|Welcome|okay|FFFFFF|adb8ff|777777|EEEEEE|Y2FzLmNsaWNrYWJpbGl0eS5jb20|c3BvbnNvcmVkX2xpbms|That|can|Who|have|clear|kcolbdakcolb|moc|in|YWRuLmViYXkuY29t|me|Let|YWQubWFpbC5ydQ|anVpY3lhZHMuY29t|b3V0YnJhaW4tcGFpZA|my|disabled|understand|doesn|awesome|YWQuZm94bmV0d29ya3MuY29t|site|YS5saXZlc3BvcnRtZWRpYS5ldQ|making|keep|YWdvZGEubmV0L2Jhbm5lcnM|we|income|advertising|without|But|getItem|QWRDb250YWluZXI|Z29vZ2xlX2Fk|YWQtbGVmdA|QWQ3Mjh4OTA|QWQzMDB4MjUw|QWQzMDB4MTQ1|YWQtY29udGFpbmVyLTI|YWQtY29udGFpbmVyLTE|YWQtY29udGFpbmVy|YWQtZm9vdGVy|YWQtbGI|YWQtbGFiZWw|YWQtaW5uZXI|YWQtaW1n|YWQtaGVhZGVy|YWQtZnJhbWU|YWRCYW5uZXJXcmFw|191|QWRGcmFtZTE|c1|192|2048|127|z0|Za|encode|setTimeout|null|frameElement|fTbvqGLWre|event|232|166|QWRBcmVh|QWRGcmFtZTI|YWRzZW5zZQ|QWRCb3gxNjA|cG9wdXBhZA|YWRzbG90|YmFubmVyaWQ|YWRzZXJ2ZXI|YWRfY2hhbm5lbA|IGFkX2JveA|YmFubmVyYWQ|YWRBZA|YWRiYW5uZXI|YWRCYW5uZXI|YmFubmVyX2Fk|YWRUZWFzZXI|Z2xpbmtzd3JhcHBlcg|YWRzLnlhaG9vLmNvbQ|QWREaXY|QWRGcmFtZTM|QWRzX2dvb2dsZV8wNA|QWRGcmFtZTQ|QWRMYXllcjE|QWRMYXllcjI|QWRzX2dvb2dsZV8wMQ|QWRzX2dvb2dsZV8wMg|QWRzX2dvb2dsZV8wMw|RGl2QWQ|QWRJbWFnZQ|RGl2QWQx|RGl2QWQy|RGl2QWQz|RGl2QWRB|RGl2QWRC|RGl2QWRD||cHJvbW90ZS5wYWlyLmNvbQ|c3F1YXJlLWFkLnBuZw|YWRzLnp5bmdhLmNvbQ|adblock||radius|join|reverse|split|click|background|40px|160px|FILLVECTID2|FILLVECTID1|detection|quick|120|black|YWRzYXR0LmFiY25ld3Muc3RhcndhdmUuY29t|com|blockadblock|http|9999|innerHeight|clearInterval|head|css|stylesheet|minWidth|minHeight|link|8px|solid|1px|hr|500|200|999|45px|18pt|35px|screen|rgba|24px|fff|14px|onmouseover|boxShadow|borderRadius|onmouseout|marginRight|12px|16pt|normal|line|Black|Arial|rel|5pt|insertBefore||aW5zLmFkc2J5Z29vZ2xl|Ly93d3cuZG91YmxlY2xpY2tieWdvb2dsZS5jb20vZmF2aWNvbi5pY28||||d2lkZV9za3lzY3JhcGVyLmpwZw|Q0ROLTMzNC0xMDktMTM3eC1hZC1iYW5uZXI|Ly9hZHZlcnRpc2luZy55YWhvby5jb20vZmF2aWNvbi5pY28|Ly93d3cuZ3N0YXRpYy5jb20vYWR4L2RvdWJsZWNsaWNrLmljbw|Ly93d3cuZ29vZ2xlLmNvbS9hZHNlbnNlL3N0YXJ0L2ltYWdlcy9mYXZpY29uLmljbw|Ly9wYWdlYWQyLmdvb2dsZXN5bmRpY2F0aW9uLmNvbS9wYWdlYWQvanMvYWRzYnlnb29nbGUuanM|querySelector|YWQtbGFyZ2UucG5n|MTM2N19hZC1jbGllbnRJRDI0NjQuanBn|setInterval|CCC|onclick|ZmF2aWNvbjEuaWNv|468px|undefined|typeof|YmFubmVyX2FkLmdpZg|bGFyZ2VfYmFubmVyLmdpZg|YWRjbGllbnQtMDAyMTQ3LWhvc3QxLWJhbm5lci1hZC5qcGc|Ly9hZHMudHdpdHRlci5jb20vZmF2aWNvbi5pY28|YWR2ZXJ0aXNlbWVudC0zNDMyMy5qcGc|YWRzYXR0LmVzcG4uc3RhcndhdmUuY29t|YmFubmVyLmpwZw|NDY4eDYwLmpwZw|YXMuaW5ib3guY29t|setItem|NzIweDkwLmpwZw|Date|c2t5c2NyYXBlci5qcGc|now|requestAnimationFrame|reload|Ly95dWkueWFob29hcGlzLmNvbS8zLjE4LjEvYnVpbGQvY3NzcmVzZXQvY3NzcmVzZXQtbWluLmNzcw".split("|"),0,{}))
</script>

1 个答案:

答案 0 :(得分:0)

您可以检查用户代理,Chrome Mobile的用户代理是:

“ Mozilla / 5.0(Linux; Android 7.0; SM-G930V Build / NRD90M)AppleWebKit / 537.36(KHTML,例如Gecko)Chrome / 59.0.3071.125移动Safari / 537.36”  source

您可以从navigator.userAgent访问它,然后仅在不是Chrome Mobile的情况下将脚本代码附加到页面上

编辑

我会简单地尝试:

if( navigator.userAgent.match(/Chrome/i)
 && navigator.userAgent.match(/Mobile/i)){
     // append the script
 }