PageSourceSearch

https://wwp-static.wenweipo.com/minici/drift.js

js wenweipo.com collected 2026-09-24 17:13:21 UTC 34,355 bytes, 1,112 lines download raw bytes

1//域名
2let hname = window.location.host;
3let serveruri = "https://tkww-static.tkww.hk"
4var canUseMiniCi = false;
5const white_list = [
6	"wenweipo",
7	"tkww",
8	"dotdotnews",
9	"lionrockdaily",
10]
11
12if(hname){
13	if(hname.indexOf("wenweipo") >= 0){
14		serveruri = "https://wwp-static.wenweipo.com"
15	}else if(hname.indexOf("dotdotnews") >= 0){
16		serveruri = "https://dotnews-static.dotdotnews.com"
17	}
18	//检查白名单,只有这些名单的内容可以使用脚本上报至minici
19	for(let i in white_list){
20		if(hname.indexOf(white_list[i]) >= 0){
21			canUseMiniCi = true;
22			break;
23		}
24	}
25}
26
27//浏览器唯一签名
28var fingerprintjs2IsLoaded = false;
29//全局变量 localStorage
30var browserInfo = localStorage.getItem('browserInfo') ? JSON.parse(localStorage.getItem('browserInfo')) : {};//浏览器信息对象
31var fingerprint = "";//浏览器指纹
32var deviceName = getDeviceType();
33var systemVersion = detectOS();
34var userAgent =  navigator.userAgent;
35if(browserInfo && browserInfo.fingerprint){
36	fingerprint = browserInfo.fingerprint;
37	fingerprintjs2IsLoaded = true;
38}
39
40// script.src="https://cdn.staticfile.org/fingerprintjs2/2.1.0/fingerprint2.min.js";
41driftLoadJs(serveruri+"/minici/fingrtprprint2.min.js",function(){
42	setFingerprint();
43})
44
45
46//json处理工具对象
47if (!this.JSON2) {
48	this.JSON2 = {}
49}
50(function() {
51	function f(n) {
52		return n < 10 ? "0" + n: n
53	}
54	function objectToJSON(value, key) {
55		var objectType = Object.prototype.toString.apply(value);
56		if (objectType === "[object Date]") {
57			return isFinite(value.valueOf()) ? value.getUTCFullYear() + "-" + f(value.getUTCMonth() + 1) + "-" + f(value.getUTCDate()) + "T" + f(value.getUTCHours()) + ":" + f(value.getUTCMinutes()) + ":" + f(value.getUTCSeconds()) + "Z": null
58		}
59		if (objectType === "[object String]" || objectType === "[object Number]" || objectType === "[object Boolean]") {
60			return value.valueOf()
61		}
62		if (objectType !== "[object Array]" && typeof value.toJSON === "function") {
63			return value.toJSON(key)
64		}
65		return value
66	}
67	var cx = new RegExp("[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]", "g"),
68	pattern = '\\\\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]',
69	escapable = new RegExp("[" + pattern, "g"),
70	gap,
71	indent,
72	meta = {
73		"\b": "\\b",
74		"\t": "\\t",
75		"\n": "\\n",
76		"\f": "\\f",
77		"\r": "\\r",
78		'"': '\\"',
79		"\\": "\\\\"
80	},
81	rep;
82	function quote(string) {
83		escapable.lastIndex = 0;
84		return escapable.test(string) ? '"' + string.replace(escapable,
85		function(a) {
86			var c = meta[a];
87			return typeof c === "string" ? c: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
88		}) + '"': '"' + string + '"'
89	}
90	function str(key, holder) {
91		var i, k, v, length, mind = gap,
92		partial, value = holder[key];
93		if (value && typeof value === "object") {
94			value = objectToJSON(value, key)
95		}
96		if (typeof rep === "function") {
97			value = rep.call(holder, key, value)
98		}
99		switch (typeof value) {
100		case "string":
101			return quote(value);
102		case "number":
103			return isFinite(value) ? String(value) : "null";
104		case "boolean":
105		case "null":
106			return String(value);
107		case "object":
108			if (!value) {
109				return "null"
110			}
111			gap += indent;
112			partial = [];
113			if (Object.prototype.toString.apply(value) === "[object Array]") {
114				length = value.length;
115				for (i = 0; i < length; i += 1) {
116					partial[i] = str(i, value) || "null"
117				}
118				v = partial.length === 0 ? "[]": gap ? "[\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "]": "[" + partial.join(",") + "]";
119				gap = mind;
120				return v
121			}
122			if (rep && typeof rep === "object") {
123				length = rep.length;
124				for (i = 0; i < length; i += 1) {
125					if (typeof rep[i] === "string") {
126						k = rep[i];
127						v = str(k, value);
128						if (v) {
129							partial.push(quote(k) + (gap ? ": ": ":") + v)
130						}
131					}
132				}
133			} else {
134				for (k in value) {
135					if (Object.prototype.hasOwnProperty.call(value, k)) {
136						v = str(k, value);
137						if (v) {
138							partial.push(quote(k) + (gap ? ": ": ":") + v)
139						}
140					}
141				}
142			}
143			v = partial.length === 0 ? "{}": gap ? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}": "{" + partial.join(",") + "}";
144			gap = mind;
145			return v
146		}
147	}
148	if (typeof JSON2.stringify !== "function") {
149		JSON2.stringify = function(value, replacer, space) {
150			var i;
151			gap = "";
152			indent = "";
153			if (typeof space === "number") {
154				for (i = 0; i < space; i += 1) {
155					indent += " "
156				}
157			} else {
158				if (typeof space === "string") {
159					indent = space
160				}
161			}
162			rep = replacer;
163			if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
164				throw new Error("JSON.stringify")
165			}
166			return str("", {
167				"": value
168			})
169		}
170	}
171	if (typeof JSON2.parse !== "function") {
172		JSON2.parse = function(text, reviver) {
173			var j;
174			function walk(holder, key) {
175				var k, v, value = holder[key];
176				if (value && typeof value === "object") {
177					for (k in value) {
178						if (Object.prototype.hasOwnProperty.call(value, k)) {
179							v = walk(value, k);
180							if (v !== undefined) {
181								value[k] = v
182							} else {
183								delete value[k]
184							}
185						}
186					}
187				}
188				return reviver.call(holder, key, value)
189			}
190			text = String(text);
191			cx.lastIndex = 0;
192			if (cx.test(text)) {
193				text = text.replace(cx,
194				function(a) {
195					return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice( - 4)
196				})
197			}
198			if ((new RegExp("^[\\],:{}\\s]*$")).test(text.replace(new RegExp('\\\\(?:["\\\\/bfnrt]|u[0-9a-fA-F]{4})', "g"), "@").replace(new RegExp('"[^"\\\\\n\r]*"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?', "g"), "]").replace(new RegExp("(?:^|:|,)(?:\\s*\\[)+", "g"), ""))) {
199				j = eval("(" + text + ")");
200				return typeof reviver === "function" ? walk({
201					"": j
202				},
203				"") : j
204			}
205			throw new SyntaxError("JSON.parse")
206		}
207	}
208} ());
209
210//统计上报工具对象
211var mini_paq = mini_paq || [],
212MINI_UBM = MINI_UBM || (function() {
213	var expireDateTime, plugins = {},
214	documentAlias = document,
215	navigatorAlias = navigator,
216	screenAlias = screen,
217	windowAlias = window,
218	urlProtocol = ("https:" == documentAlias.location.protocol ? "https://": "http://"),
219	hasLoaded = false,
220	registeredOnLoadHandlers = [],
221	encodeWrapper = windowAlias.encodeURIComponent,
222	decodeWrapper = windowAlias.decodeURIComponent,
223	urldecode = unescape,
224	asyncTracker,
225	i;
226	function isDefined(property) {
227		var propertyType = typeof property;
228		return propertyType !== "undefined"
229	}
230	function isFunction(property) {
231		return typeof property === "function"
232	}
233	function isObject(property) {
234		return typeof property === "object"
235	}
236	function isString(property) {
237		return typeof property === "string" || property instanceof String
238	}
239	function apply() {
240		var i, f, parameterArray;
241		for (i = 0; i < arguments.length; i += 1) {
242			parameterArray = arguments[i];
243			f = parameterArray.shift();
244			if (isString(f)) {
245				return asyncTracker[f].apply(asyncTracker, parameterArray)
246			} else {
247				return f.apply(asyncTracker, parameterArray)
248			}
249		}
250	}
251	function addEventListener(element, eventType, eventHandler, useCapture) {
252		if (element.addEventListener) {
253			element.addEventListener(eventType, eventHandler, useCapture);
254			return true
255		}
256		if (element.attachEvent) {
257			return element.attachEvent("on" + eventType, eventHandler)
258		}
259		element["on" + eventType] = eventHandler
260	}
261	function executePluginMethod(methodName, callback) {
262		var result = {},
263		i, pluginMethod;
264		for (i in plugins) {
265			if (Object.prototype.hasOwnProperty.call(plugins, i)) {
266				pluginMethod = plugins[i][methodName];
267				if (isFunction(pluginMethod)) {
268					var pluginResult = pluginMethod(callback);
269					if (pluginResult != undefined && pluginResult != null) {
270						for (var p in pluginResult) {
271							result[p] = pluginResult[p]
272						}
273					}
274				}
275			}
276		}
277		return result
278	}
279	function beforeUnloadHandler() {
280		var now;
281		executePluginMethod("unload");
282		if (expireDateTime) {
283			do {
284				now = new Date()
285			} while ( now . getTimeAlias () < expireDateTime)
286		}
287	}
288	function loadHandler() {
289		var i;
290		if (!hasLoaded) {
291			hasLoaded = true;
292			executePluginMethod("load");
293			for (i = 0; i < registeredOnLoadHandlers.length; i++) {
294				registeredOnLoadHandlers[i]()
295			}
296		}
297		return true
298	}
299	function addReadyListener() {
300		var _timer;
301		if (documentAlias.addEventListener) {
302			addEventListener(documentAlias, "DOMContentLoaded",
303			function ready() {
304				documentAlias.removeEventListener("DOMContentLoaded", ready, false);
305				loadHandler()
306			})
307		} else {
308			if (documentAlias.attachEvent) {
309				documentAlias.attachEvent("onreadystatechange",
310				function ready() {
311					if (documentAlias.readyState === "complete") {
312						documentAlias.detachEvent("onreadystatechange", ready);
313						loadHandler()
314					}
315				});
316				if (documentAlias.documentElement.doScroll && windowAlias === windowAlias.top) { (function ready() {
317						if (!hasLoaded) {
318							try {
319								documentAlias.documentElement.doScroll("left")
320							} catch(error) {
321								setTimeout(ready, 0);
322								return
323							}
324							loadHandler()
325						}
326					} ())
327				}
328			}
329		}
330		if ((new RegExp("WebKit")).test(navigatorAlias.userAgent)) {
331			_timer = setInterval(function() {
332				if (hasLoaded || /loaded|complete/.test(documentAlias.readyState)) {
333					clearInterval(_timer);
334					loadHandler()
335				}
336			},
337			10)
338		}
339		addEventListener(windowAlias, "load", loadHandler, false)
340	}
341	function getReferrer() {
342		var referrer = "";
343		try {
344			referrer = windowAlias.top.document.referrer
345		} catch(e) {
346			if (windowAlias.parent) {
347				try {
348					referrer = windowAlias.parent.document.referrer
349				} catch(e2) {
350					referrer = ""
351				}
352			}
353		}
354		if (referrer === "") {
355			referrer = documentAlias.referrer
356		}
357		return referrer
358	}
359	function getProtocolScheme(url) {
360		var e = new RegExp("^([a-z]+):"),
361		matches = e.exec(url);
362		return matches ? matches[1] : null
363	}
364	function getHostName(url) {
365		var e = new RegExp("^(?:(?:https?|ftp):)/*(?:[^@]+@)?([^:/#]+)"),
366		matches = e.exec(url);
367		return matches ? matches[1] : url
368	}
369	function getParameter(url, name) {
370		var e = new RegExp("^(?:https?|ftp)(?::/*(?:[^?]+)[?])([^#]+)"),
371		matches = e.exec(url),
372		f = new RegExp("(?:^|&)" + name + "=([^&]*)"),
373		result = matches ? f.exec(matches[1]) : 0;
374		return result ? decodeWrapper(result[1]) : ""
375	}
376	function utf8_encode(argString) {
377		return urldecode(encodeWrapper(argString))
378	}
379	function sha1(str) {
380		var rotate_left = function(n, s) {
381			return (n << s) | (n >>> (32 - s))
382		},
383		cvt_hex = function(val) {
384			var str = "",
385			i, v;
386			for (i = 7; i >= 0; i--) {
387				v = (val >>> (i * 4)) & 15;
388				str += v.toString(16)
389			}
390			return str
391		},
392		blockstart,
393		i,
394		j,
395		W = [],
396		H0 = 1732584193,
397		H1 = 4023233417,
398		H2 = 2562383102,
399		H3 = 271733878,
400		H4 = 3285377520,
401		A,
402		B,
403		C,
404		D,
405		E,
406		temp,
407		str_len,
408		word_array = [];
409		str = utf8_encode(str);
410		str_len = str.length;
411		for (i = 0; i < str_len - 3; i += 4) {
412			j = str.charCodeAt(i) << 24 | str.charCodeAt(i + 1) << 16 | str.charCodeAt(i + 2) << 8 | str.charCodeAt(i + 3);
413			word_array.push(j)
414		}
415		switch (str_len & 3) {
416		case 0:
417			i = 2147483648;
418			break;
419		case 1:
420			i = str.charCodeAt(str_len - 1) << 24 | 8388608;
421			break;
422		case 2:
423			i = str.charCodeAt(str_len - 2) << 24 | str.charCodeAt(str_len - 1) << 16 | 32768;
424			break;
425		case 3:
426			i = str.charCodeAt(str_len - 3) << 24 | str.charCodeAt(str_len - 2) << 16 | str.charCodeAt(str_len - 1) << 8 | 128;
427			break
428		}
429		word_array.push(i);
430		while ((word_array.length & 15) !== 14) {
431			word_array.push(0)
432		}
433		word_array.push(str_len >>> 29);
434		word_array.push((str_len << 3) & 4294967295);
435		for (blockstart = 0; blockstart < word_array.length; blockstart += 16) {
436			for (i = 0; i < 16; i++) {
437				W[i] = word_array[blockstart + i]
438			}
439			for (i = 16; i <= 79; i++) {
440				W[i] = rotate_left(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1)
441			}
442			A = H0;
443			B = H1;
444			C = H2;
445			D = H3;
446			E = H4;
447			for (i = 0; i <= 19; i++) {
448				temp = (rotate_left(A, 5) + ((B & C) | (~B & D)) + E + W[i] + 1518500249) & 4294967295;
449				E = D;
450				D = C;
451				C = rotate_left(B, 30);
452				B = A;
453				A = temp
454			}
455			for (i = 20; i <= 39; i++) {
456				temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 1859775393) & 4294967295;
457				E = D;
458				D = C;
459				C = rotate_left(B, 30);
460				B = A;
461				A = temp
462			}
463			for (i = 40; i <= 59; i++) {
464				temp = (rotate_left(A, 5) + ((B & C) | (B & D) | (C & D)) + E + W[i] + 2400959708) & 4294967295;
465				E = D;
466				D = C;
467				C = rotate_left(B, 30);
468				B = A;
469				A = temp
470			}
471			for (i = 60; i <= 79; i++) {
472				temp = (rotate_left(A, 5) + (B ^ C ^ D) + E + W[i] + 3395469782) & 4294967295;
473				E = D;
474				D = C;
475				C = rotate_left(B, 30);
476				B = A;
477				A = temp
478			}
479			H0 = (H0 + A) & 4294967295;
480			H1 = (H1 + B) & 4294967295;
481			H2 = (H2 + C) & 4294967295;
482			H3 = (H3 + D) & 4294967295;
483			H4 = (H4 + E) & 4294967295
484		}
485		temp = cvt_hex(H0) + cvt_hex(H1) + cvt_hex(H2) + cvt_hex(H3) + cvt_hex(H4);
486		return temp.toLowerCase()
487	}
488	function urlFixup(hostName, href, referrer) {
489		if (hostName === "translate.googleusercontent.com") {
490			if (referrer === "") {
491				referrer = href
492			}
493			href = getParameter(href, "u");
494			hostName = getHostName(href)
495		} else {
496			if (hostName === "cc.bingj.com" || hostName === "webcache.googleusercontent.com" || hostName.slice(0, 5) === "74.6.") {
497				href = documentAlias.links[0].href;
498				hostName = getHostName(href)
499			}
500		}
501		return [hostName, href, referrer]
502	}
503	function domainFixup(domain) {
504		var dl = domain.length;
505		if (domain.charAt(--dl) === ".") {
506			domain = domain.slice(0, dl)
507		}
508		if (domain.slice(0, 2) === "*.") {
509			domain = domain.slice(1)
510		}
511		return domain
512	}
513	function titleFixup(title) {
514		if (!isString(title)) {
515			title = title.text || "";
516			var tmp = documentAlias.getElementsByTagName("title");
517			if (tmp && isDefined(tmp[0])) {
518				title = tmp[0].text
519			}
520		}
521		return title
522    }
523    // 暴露出去的上报对象
524	function Tracker(siteId, trackerUrl) {
525		var configCountPreRendered,
526		configTrackerUrl,
527		configItemUrl,
528		domainHash,visitorUUID, hash = sha1,
529		locationArray = urlFixup(documentAlias.domain, windowAlias.location.href, getReferrer()),
530		locationHrefAlias = locationArray[1], 
531		configReferrerUrl = locationArray[2],
532		configUserId = "",
533		configDoNotTrack = !canUseMiniCi,
534		configTrackerPause = 500,
535		configDiscardHashTag,
536		configConversionAttributionFirstReferrer, 
537		configCampaignNameParameters = ["pk_campaign", "ubm_campaign", "utm_campaign", "utm_source", "utm_medium"], 
538		configCampaignKeywordParameters = ["pk_kwd", "ubm_kwd", "utm_term"],
539		configTitle = documentAlias.title, 
540		configTrackerTraceId = siteId || "",
541		configRequestMethod = "GET",
542		configInFrame =windowAlias.location  !== windowAlias.top.location,
543		configEnableInFrameTrack = true;
544		function purify(url) {
545            var targetPattern;
546            if (configDiscardHashTag) {
547                targetPattern = new RegExp("#.*");
548                return url.replace(targetPattern, "")
549            }
550            return url
551        }
552		function prefixPropertyName(prefix, propertyName) {
553            if (prefix !== "") {
554                return prefix + propertyName.charAt(0).toUpperCase() + propertyName.slice(1)
555            }
556            return propertyName
557        }
558		function trackCallback(callback) {
559			var isPreRendered, i, prefixes = ["", "webkit", "ms", "moz"],
560			prefix;
561			if (!configCountPreRendered) {
562				for (i = 0; i < prefixes.length; i++) {
563					prefix = prefixes[i];
564					if (Object.prototype.hasOwnProperty.call(documentAlias, prefixPropertyName(prefix, "hidden"))) {
565						if (documentAlias[prefixPropertyName(prefix, "visibilityState")] === "prerender") {
566							isPreRendered = true
567						}
568						break
569					}
570				}
571			}
572			if (isPreRendered) {
573				addEventListener(documentAlias, prefix + "visibilitychange",
574				function ready() {
575					documentAlias.removeEventListener(prefix + "visibilitychange", ready, false);
576					callback()
577				});
578				return
579			}
580			callback()
581		}
582		async function logEventCustom(eventId, attributes, value ) {
583			var requestExt = {};
584			if (eventId != undefined && eventId != "") {
585				//参数部分封装
586				requestExt.actionType = eventId;
587				requestExt.actionExt = attributes || {};
588				if(navigator){
589					// requestExt.actionExt.navigatorAppName = navigator.appName;
590					// requestExt.actionExt.navigatorAppCodeName = navigator.appCodeName;
591					// requestExt.actionExt.navigatorAppVersion = navigator.appVersion;
592				}
593				requestExt.actionPrice = requestExt.actionExt.price ? parseFloat(requestExt.actionExt.price) : 0;
594				requestExt.actionNum = value || 0;
595				requestExt.itemId = requestExt.actionExt.itemId;
596
597				if(!fingerprint){
598					fingerprint = await awitFingerprint();
599				}
600				sendRequest(getRequest(requestExt ), configTrackerPause)
601			}
602		}
603		// 封装数据用的
604		function getRequest(request , pluginMethod, currentEcommerceOrderTs) {
605			var i, 
606			currentUrl = locationHrefAlias;
607            if (configDoNotTrack) {
608                return ""
609			}
610
611            if (!isDefined(currentEcommerceOrderTs)) {
612                currentEcommerceOrderTs = ""
613			}
614			//默认数据封装
615            request.traceId = configTrackerTraceId;
616            request.userId = configUserId;
617            request.fig = fingerprint;
618			request.url = purify(currentUrl);
619			request.deviceName = deviceName;
620            request.userAgent = userAgent;
621			request.systemVersion = systemVersion;
622
623            if (configReferrerUrl.length) {
624                request.referer = purify(configReferrerUrl)
625            }
626            var pluginResult = executePluginMethod(pluginMethod);
627            if (pluginResult != undefined && pluginResult != null) {
628                for (var p in pluginResult) {
629                    request[p] = pluginResult[p]
630                }
631			}
632            return request
633        }
634		function getImage(request) {
635			var image = new Image(1, 1);
636			image.onload = function() {};
637			image.src = configTrackerUrl + (configTrackerUrl.indexOf("?") < 0 ? "?": "&") + request
638		}
639		function sendXmlHttpRequest(request) {
640			try {
641				var xhr = windowAlias.XMLHttpRequest ? new windowAlias.XMLHttpRequest() : windowAlias.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : null;
642				xhr.open("POST", configTrackerUrl, true);
643				xhr.onreadystatechange = function() {
644					if (this.readyState === 4 && this.status !== 200) {
645						getImage(request)
646					}
647				};
648				xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
649				xhr.send(request)
650			} catch(e) {
651				getImage(request)
652			}
653		}
654		function sendPostHttpRequest(data) {
655			try {
656				var xhr = windowAlias.XMLHttpRequest ? new windowAlias.XMLHttpRequest() : windowAlias.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP") : null;
657				xhr.open("POST", data.requestUrl, true);
658				xhr.onreadystatechange = function() {
659					// if (this.readyState === 4 && this.status !== 200) {
660					// 	getImage(request)
661					// }
662				};
663				xhr.setRequestHeader("Content-Type", "application/json; charset=UTF-8");
664				xhr.send(JSON.stringify(data))
665			} catch(e) {
666				// getImage(request)
667			}
668		}
669		function sendRequest(request, delay) {
670			var now = new Date();
671			if (!configDoNotTrack && (configInFrame ? configEnableInFrameTrack: true)) {
672				if (configRequestMethod === "POST") {
673					sendXmlHttpRequest("trackinfo=" + encodeWrapper(JSON2.stringify(request)))
674				} else {
675					getImage("trackinfo=" + encodeWrapper(JSON2.stringify(request)))
676				}
677				expireDateTime = now.getTime() + delay
678			}
679		}
680
681		return {
682			setTrackerUrl: function(trackerUrl) {
683                configTrackerUrl = trackerUrl
684			},
685			setTrackerItemUrl: function(itemUrl) {
686				configItemUrl = itemUrl
687			},		
688			setTraceId: function(traceId) {
689				configTrackerTraceId = traceId
690			},
691			setUserId: function(userId) {
692				configUserId = userId
693			},
694			setNotTrack: function(isTrack) {
695				//是否关闭上报 false 上报 true关闭上报
696				configDoNotTrack = isTrack;
697			},
698			eventBrowse: function(itemId, attributes) {
699				trackCallback(function() {
700					var eventId = "view";
701                    var attr = attributes || {};
702					if (isObject(attr) && isDefined(itemId)) {
703						attr.itemId = itemId;
704						logEventCustom(eventId, attr, 1)
705					}
706					if(typeof $ != 'undefined' && $.cookie && !$.cookie('open_app')){
707						//如果是第一次访问上报一个启动事件
708						mini_paq.push(["eventOpen", "open_app", {}]);
709						$.cookie('open_app', 'true');
710					}
711				})
712			},
713			eventOpen: function(itemId, attributes) {
714				trackCallback(function() {
715					var eventId = "open";
716                    var attr = attributes || {};
717					if (isObject(attr) && isDefined(itemId)) {
718						attr.itemId = itemId;
719						logEventCustom(eventId, attr, 1)
720					}
721				})
722			},
723			eventCart: function(itemId, price, attributes, value) {
724				trackCallback(function() {
725					var eventId = "cart";
726					var attr = attributes || {};
727					if (isObject(attr) && isDefined(itemId) && isDefined(price)) {
728						attr.itemId = itemId;
729						attr.price = price;
730						logEventCustom(eventId, attr, value)
731					}
732				})
733			},
734			eventBuy: function(itemId, price, attributes, value) {
735				trackCallback(function() {
736					var eventId = "buy";
737					var attr = attributes || {};
738					if (isObject(attr) && isDefined(itemId) && isDefined(price)) {
739						attr.itemId = itemId;
740						attr.price = price;
741						logEventCustom(eventId, attr, value)
742					}
743				})
744			},
745			eventShare: function(itemId, channel, attributes) {
746				trackCallback(function() {
747					var eventId = "share";
748					var attr = attributes || {};
749					if (isObject(attr) && isDefined(itemId) && isDefined(channel)) {
750						attr.itemId = itemId;
751						attr.channel = channel;
752						logEventCustom(eventId, attr, 1)
753					}
754				})
755			},
756			eventDownload: function(itemId, attributes) {
757				trackCallback(function() {
758					var eventId = "download";
759					var attr = attributes || {};
760					if (isObject(attr) && isDefined(itemId)) {
761						attr.itemId = itemId;
762						logEventCustom(eventId, attr, 1)
763					}
764				})
765			},
766			eventFavorite: function(itemId, attributes) {
767				trackCallback(function() {
768					var eventId = "favorite";
769					var attr = attributes || {};
770					if (isObject(attr) && isDefined(itemId)) {
771						attr.itemId = itemId;
772						logEventCustom(eventId, attr, 1)
773					}
774				})
775			},
776			eventSearch: function(itemId, keywords, attributes) {
777				trackCallback(function() {
778					var eventId = "search";
779					var attr = attributes || {};
780					if (isObject(attr) && isDefined(itemId) && isDefined(keywords)) {
781						attr.itemId = itemId;
782						attr.keywords = keywords;
783						logEventCustom(eventId, attr, 1 )
784					}
785				})
786			},
787			eventRec: function(itemId, attributes) {
788				trackCallback(function() {
789					var eventId = "rec_click";
790					var attr = attributes || {};
791					if (isObject(attr) && isDefined(itemId)) {
792						attr.itemId = itemId;
793						logEventCustom(eventId, attr, 1 )
794					}
795				})
796			},
797			eventLike: function(itemId, attributes) {
798				trackCallback(function() {
799					var eventId = "like";
800					var attr = attributes || {};
801					if (isObject(attr) && isDefined(itemId)) {
802						attr.itemId = itemId;
803						logEventCustom(eventId, attr, 1 )
804					}
805				})
806			},
807			eventDislike: function(itemId, attributes) {
808				trackCallback(function() {
809					var eventId = "dislikes";
810					var attr = attributes || {};
811					if (isObject(attr) && isDefined(itemId)) {
812						attr.itemId = itemId;
813						logEventCustom(eventId, attr, 1 )
814					}
815				})
816			},
817			eventSubscribe:function(itemId, attributes) {
818				trackCallback(function() {
819					var eventId = "subscribe";
820					var attr = attributes || {};
821					if (isObject(attr) && isDefined(itemId)) {
822						attr.itemId = itemId;
823						logEventCustom(eventId, attr, 1 )
824					}
825				})
826			},
827			eventComment:function(itemId, attributes) {
828				trackCallback(function() {
829					var eventId = "comment";
830					var attr = attributes || {};
831					if (isObject(attr) && isDefined(itemId)) {
832						attr.itemId = itemId;
833						logEventCustom(eventId, attr, 1 )
834					}
835				})
836			},
837			eventShow:function(itemId, attributes) {
838				trackCallback(function() {
839					var eventId = "show";
840					var attr = attributes || {};
841					if (isObject(attr) && isDefined(itemId)) {
842						attr.itemId = itemId;
843						logEventCustom(eventId, attr, 1 )
844					}
845				})
846			},
847			reportItem:function(data) {
848				if(!data.uuid){
849					return;
850				}
851				var tags = [];
852				if(data.tags){
853					tags = data.tags.split("#tags#");
854				}
855				var item = {
856					"itemId": data.uuid,//物品id
857					"traceId": configTrackerTraceId,//统计id
858					"modifyTime": data.modifyTime,//最后修改时间
859					"price": data.price,//ä»·æ ¼
860					"publishTime":data.publishTime,//发布时间
861					"score":data.score,//热度
862					"author": data.author,//作者
863					"categoryId": data.categoryId,//栏目
864					"content": data.content,//物品正文
865					"extData": data.extData,//扩展属性json结构
866					"tags": JSON.stringify(tags),
867					"title": data.title,//标题
868					"type": data.type,//item 大类别。如:0文章,1商品、
869					"url": data.url,//物品地址
870				}
871				item.requestUrl = configItemUrl;
872				sendPostHttpRequest(item);
873			},
874			
875		}
876	}
877	function TrackerProxy() {
878		return {
879			push: apply
880		}
881	}
882	addEventListener(windowAlias, "message",
883        function(e) {
884            if (e.data == "GET-SCREEN-PARAMS") {
885                var _w = documentAlias.documentElement.scrollWidth || documentAlias.body.scrollWidth;
886                var _h = documentAlias.documentElement.scrollHeight || documentAlias.body.scrollHeight;
887                window.top.postMessage(_w + "-" + _h, "*")
888            }
889        },
890	false);
891	addEventListener(windowAlias, "beforeunload", beforeUnloadHandler, false);
892	addReadyListener();
893	Date.prototype.getTimeAlias = Date.prototype.getTime;
894	asyncTracker = new Tracker();
895	for (i = 0; i < mini_paq.length; i++) {
896		if (mini_paq[i][0] === "setTrackerUrl" || mini_paq[i][0] === "setSiteId") {
897			apply(mini_paq[i]);
898			delete mini_paq[i]
899		}
900	}
901	for (i = 0; i < mini_paq.length; i++) {
902		if (mini_paq[i]) {
903			if (mini_paq[i][0] === "setVisitorId" || mini_paq[i][0] === "setUserInfo") {
904				apply(mini_paq[i]);
905				delete mini_paq[i]
906			}
907		}
908	}
909	var isTrackPageView = false;
910	for (i = 0; i < mini_paq.length; i++) {
911		if (mini_paq[i]) {
912			if (mini_paq[i][0] === "trackPageView") {
913				isTrackPageView = true
914			}
915			apply(mini_paq[i])
916		}
917	}
918	mini_paq = new TrackerProxy();
919	return {
920		addPlugin: function(pluginName, pluginObj) {
921			plugins[pluginName] = pluginObj
922		},
923		getTracker: function(siteId, ubmUrl) {
924			return new Tracker(siteId, ubmUrl)
925		},
926		getAsyncTracker: function() {
927			return asyncTracker
928		}
929	}
930} ());
931
932function getElementID(e) {
933	var b = hashCode(convert(e.outerHTML));
934	var a = e.getAttribute("href", 2);
935	var c = $(document).find("[href='" + a + "']");
936	if (c.length > 1) {
937		for (var d = 0; d < c.length; d++) {
938			if (c[d] == e) {
939				b += "," + d;
940				break
941			}
942		}
943	}
944	return b
945}
946function convert(a) {
947	return sort(a.replace(/[^0-9a-zA-Z]/g, "").toLowerCase())
948}
949function sort(a) {
950	return a.split("").sort().join("")
951}
952function hashCode(g) {
953	var d = 0,
954	f = 0;
955	var a = g.length;
956	var b = -2147483648,
957	e = 2147483647;
958	for (var c = 0; c < a; c++) {
959		d = 31 * d + g.charCodeAt(f++);
960		while (d > e) {
961			d += b * 2
962		}
963		while (d < b) {
964			d += e * 2
965		}
966	}
967	return d
968}
969//获取浏览器签名指纹
970function setFingerprint() {
971	let options = {};
972	Fingerprint2.get(options, function (components) {
973		// 参数
974		const values = components.map(function (component) {
975			return component.value
976		});
977		// 指纹
978		const murmur = Fingerprint2.x64hash128(values.join(''), 31);
979		fingerprint = murmur;
980		browserInfo.fingerprint = fingerprint;
981		localStorage.setItem("browserInfo",JSON.stringify(browserInfo));
982		fingerprintjs2IsLoaded = true;
983		return murmur;
984	});
985}
986
987async function awitFingerprint() {
988	//等待js加载完成 等待时间 1000ms 每20ms一次轮询
989	let times = 0;
990	while(!fingerprintjs2IsLoaded && times < 51){
991		 await new Promise(resolve => {
992	         setTimeout(() => {
993	             resolve()
994	         }, 20)
995	     })
996		 times++;
997	}
998	return  fingerprint;
999}
1000
1001// 获取设备类型
1002function getDeviceType() { 
1003	var deviceType;
1004	var sUserAgent = navigator.userAgent.toLowerCase();
1005	var bIsIpad = sUserAgent.match(/(ipad)/i) == "ipad";
1006	var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
1007	var bIsMidp = sUserAgent.match(/midp/i) == "midp";
1008	var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
1009	var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
1010	var bIsAndroid = sUserAgent.match(/android/i) == "android";
1011	var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
1012	var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
1013
1014	if (!(bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM)) {
1015		deviceType = 'PC'; //pc
1016	} else if (bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
1017		deviceType = 'phone'; //phone
1018	} else if (bIsIpad) {
1019		deviceType = 'ipad'; //ipad
1020	} else {
1021		deviceType = '未知';
1022	}
1023	return deviceType;
1024}
1025//获取系统版本
1026function detectOS() {
1027	var sUserAgent = navigator.userAgent;
1028	var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows");
1029	var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel");
1030	if (isMac) return "Mac";
1031	var isUnix = (navigator.platform == "X11") && !isWin && !isMac;
1032	if (isUnix) return "Unix";
1033	var isLinux = (String(navigator.platform).indexOf("Linux") > -1);
1034
1035	var bIsAndroid = sUserAgent.toLowerCase().match(/android/i) == "android";
1036	if (isLinux) {
1037		if(bIsAndroid) return "Android";
1038		else return "Linux";
1039	}
1040	if (isWin) {
1041		var isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1 || sUserAgent.indexOf("Windows 2000") > -1;
1042		if (isWin2K) return "Win2000";
1043		var isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1 ||
1044			sUserAgent.indexOf("Windows XP") > -1;
1045		if (isWinXP) return "WinXP";
1046		var isWin2003 = sUserAgent.indexOf("Windows NT 5.2") > -1 || sUserAgent.indexOf("Windows 2003") > -1;
1047		if (isWin2003) return "Win2003";
1048		var isWinVista= sUserAgent.indexOf("Windows NT 6.0") > -1 || sUserAgent.indexOf("Windows Vista") > -1;
1049		if (isWinVista) return "WinVista";
1050		var isWin7 = sUserAgent.indexOf("Windows NT 6.1") > -1 || sUserAgent.indexOf("Windows 7") > -1;
1051		if (isWin7) return "Win7";
1052		// var isWin10 = sUserAgent.indexOf("Windows NT 6.3") > -1 || sUserAgent.indexOf("Windows 7") >-1;
1053		// if (isWin10) return "Win10";
1054	}
1055	return "Win10";
1056}
1057//获取访问者设备信息
1058function xxx() {
1059	document.write("userAgent: " + navigator.userAgent + "<br><br>"); //浏览器的用户代理字符串
1060	document.write("appName: " + navigator.appName + "<br><br>");  //完整的浏览器名称
1061	document.write("appCodeName: " + navigator.appCodeName + "<br><br>"); //浏览器名称
1062	document.write("appVersion: " + navigator.appVersion + "<br><br>");//浏览器版本
1063	document.write("appMinorVersion: " + navigator.appMinorVersion + "<br><br>"); //次版本信息
1064	document.write("platform: " + navigator.platform + "<br><br>");//浏览器所在的系统平台
1065	document.write("cookieEnabled: " + navigator.cookieEnabled + "<br><br>");//表示cookie是否启用
1066	document.write("onLine: " + navigator.onLine + "<br><br>");//浏览器是否连接了因特网
1067	document.write("userLanguage: " + navigator.language + "<br><br>");//浏览器的主语言
1068	document.write("mimeTypes.description: " + navigator.mimeTypes[1].description + "<br><br>");//注册的MIME类型数组
1069	document.write("mimeTypes.type: " + navigator.mimeTypes[1].type + "<br><br>");//
1070	document.write("plugins.description: " + navigator.plugins[3].description + "<br><br>");//插件信息的数组
1071
1072}
1073// 获取网络状态           (电脑为啥是4g网络呢,我认为的原因:取到的是实际网络速度)
1074function getNetWork() { 
1075	var netWork;
1076	switch (navigator.connection.effectiveType) {
1077		case 'wifi':
1078			netWork = 'wifi'; // wifi
1079			break;
1080		case '4g':
1081			netWork = '4G'; // 4g
1082			break;
1083		case '2g':
1084			netWork = '2G'; // 2g
1085			break;
1086		case  '3g':
1087			netWork = '3G'; // 3g
1088			break;
1089		case  'ethernet':
1090			netWork = '以太网'; // ethernet
1091			break;
1092		case  'default':
1093			netWork = '未知'; // 未知
1094			break;
1095	}
1096	return netWork;
1097}
1098
1099// 加载js
1100function driftLoadJs(url, success) {
1101	var domScript = document.createElement('script');
1102	domScript.type="text/javascript";
1103    domScript.src = url;
1104	success = success || function(){};
1105	domScript.onload = domScript.onreadystatechange = function() {
1106		if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState){
1107			success();
1108		}
1109	}
1110	document.getElementsByTagName('head')[0].appendChild(domScript);
1111}
1112

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.