PageSourceSearch

https://nocutnews.co.kr/js/mobileh.js

js nocutnews.co.kr collected 2026-10-01 10:14:39 UTC 1,750 bytes, 66 lines download raw bytes

1/// <reference path="../jquery/jquery-latest.js" />
2/// <reference path="../jquery/jquery-extend.js" />
3
4function MobileHandler(m) {
5	var agent = navigator.userAgent;
6
7	// 모바일 정규식
8	var mrx = /iP(?:hone|od)|Android|SAMSUNG|LG\s+[A-Z]|BlackBerry|MOT|Nokia|Windows\s+CE|Symbian|SonyEricsson|UP\.Browser|webOS/;
9	if (!mrx.test(agent)) {
10		console.log("[MOBILEH] mrx");
11		return;
12	}
13
14	// 예외 정규식
15	var xrx = /Macintosh|SHW-M[13]80|MZ\d{3}|ESP_E2\d{2}/;
16	if (xrx.test(agent)) {
17		console.log("[MOBILEH] xrx");
18		return;
19	}
20
21	const isGoogleMobileBot = agent.includes("Googlebot");
22	if (isGoogleMobileBot) {
23		console.log("[MOBILEH] google bot");
24		return;
25	}
26
27	var pc = location.protocol + "//" + location.host;
28	m = m || "https://m.nocutnews.co.kr";
29
30	var mhost = new URL(m).host;
31
32	// PC보기 여부
33	var from = $.url.qstr("from");
34	var ref = document.referrer;
35	if (from === "mobile" && ref.indexOf(mhost) > -1) {
36		$.cookie.set("from", mhost);
37		console.log("[MOBILEH] from mobile 1");
38		return;
39	}
40	from = $.cookie.get("from");
41	if (from === mhost) {
42		console.log("[MOBILEH] from mobile 2");
43		return;
44	}
45
46	// 예외 URL
47	if (location.pathname.indexOf("/news/preview") > -1) {
48		console.log("[MOBILEH] preview")
49		return;
50	}
51	if (location.pathname.indexOf("/special/vote2022") > -1) {
52		console.log("[MOBILEH] vote2022")
53		return;
54	}
55
56	var url = location.toString().replace(pc, m);
57
58	// 메인 Default2024.aspx 패턴 예외 처리
59	const regex1 = location.pathname.match(/\//g).length === 1;
60	const defaultRegex = /2024\./gi;
61	if (regex1 && defaultRegex.test(url)) url = url.replace(defaultRegex, ".");
62	
63	console.log("[MOBILEH] " + url);
64
65	location = url;
66};

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.