防劫持
优质
小牛编辑
124浏览
2023-12-01
说明
函数说明:
防劫持代码,分为两部分,一部分是放在页头,别一部分放在页尾
顶部脚本
<script>window.onerror=function(){return!0};var _liantong_report=function(){function n(n){o("fucklt","",n)}function o(n,o,a){var i={act:"/event",pro:"content_hijack",dty:"pas",__yafm:"i",eid:n,eid_desc:o||"",mid:a||""},r=t(i);e(r)}function t(n){var o=a;for(var t in n)o+=t+"="+encodeURIComponent(n[t])+"&";return o+=(new Date).getTime()+parseInt(1e3*Math.random())}function e(n){var o=new Image(1,1);o.onload=function(){o=null},o.onerror=function(){o=null},o.src=n}var a="http://stat.game.yy.com/data.do?",i={report:function(o){n(o)}};return i}();!function(){function n(n,o){var t;for(var e in n){var a=n[e].split("="),i=a[0].replace(" ","");i==o&&(t=a[1])}return t}var o=window.document.write,t=!1;window.document.write=function(n){var e,a,i=[[/duowan\.com\/s\/huodong\/anti_brush\/anti-min\.js/gi,"http://gamesz.yy.com/s/huodong/anti_brush/anti-min"],[/duowan\.com\/s\/lobby\/sdk\/js\/extern\.js/gi,"http://gamesz.yy.com/s/lobby/sdk/js/extern_bak"],[/duowan\.com\/s\/lobby\/sdk\/js\/yy_install\.js/gi,"http://gamesz.yy.com/s/lobby/sdk/js/yy_install_bak"],[/duowan\.com\/nav\/js\/getGameInfoConfig\.js/gi,"http://gamesz.yy.com/nav/js/getGameInfoConfig_backup"],[/\/jquery\.js/gi,"http://gamesz.yy.com/s/jquery/jquery_bak"],[/\/jquery\.mc\.js/gi,"http://gamesz.yy.com/s/jquery/jquery_bak_mc"],[/duowan\.com\/s\/ya\/ya\.1\.3\.1-min\.js/gi,"http://gamesz.yy.com/s/ya/ya.1.3.1-min_bak"],[/duowan\.com\/s\/lobby_web\/js\/YYgame_Nav_V3\.js/gi,"http://gamesz.yy.com/s/lobby_web/js/YYgame_Nav_V3_bak"],[/duowan\.com\/lobbyjs\/lobby\.js/gi,"http://gamesz.yy.com/lobbyjs/lobby_bak"],[/duowan\.com\/s\/lobby\/sdk\/yygameSdk\.js/gi,"http://gamesz.yy.com/s/lobby/sdk/yygameSdk_bak"],[/duowan\.com\/udblogin\/web-client\.js/gi,"http://gamesz.yy.com/s/lobby/sdk/web-client_bak"]];for(e in i)if(i.hasOwnProperty(e)){var r=i[e][0];if(r.test(n)){t=!0,a=document.createElement("script"),a.src=i[e][1];try{document.head?document.head.appendChild(a):document.body.insertBefore(a)}catch(s){}return!0}}return o.apply&&o.apply(this,arguments),!0};var e="";if(window.external&&"undefined"!=typeof window.external.getPlayerLoginInfo){var a=window.external.getPlayerLoginInfo().split("&");e=n(a,"account")}else{var i=document.cookie?document.cookie:"";e=n(i.split(";"),"yyuid")}window.setTimeout(function(){t&&_liantong_report.report(e)},7500)}();</script>
底部脚本
<!--[if gt IE 6]><!-->
<script type="text/javascript">window.onerror=function(){return !0};!function(t){t.loadScript(["http://szhuodong.yy.com/s/rp/fequality/yy-f2e-quality.min.js","http://szhuodong.yy.com/s/rp/fequality/cf.js"])}(function(){function t(e,a){var n=a[e];if(n){e++;var o=document.createElement("script");o.type="text/javascript",o.setAttribute("async","async"),o.onload=o.onreadystatechange=function(){return o.readyState&&"complete"!==o.readyState&&"loaded"!==o.readyState?!1:(o.onload=o.onreadystatechange=null,void t(e,a))};var c=new Date;c.setSeconds(0),c.setMilliseconds(0),c=c.getTime(),o.async=!0,o.src=n+"?_="+c,document.getElementsByTagName("head")[0].appendChild(o)}}return{loadScript:function(e){e&&e.length&&e instanceof Array&&t(0,e)}}}());</script>
<!--<![endif]-->