Advertisement
Guest User

Untitled

a guest
May 31st, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.60 KB | None | 0 0
  1. var g;
  2. if (!window.__idm_init__) {
  3. var u = function() {
  4. var a = window.self === window.top;
  5. this.D = (this.O = a) ? 0 : null;
  6. this.c = !1;
  7. this.s = this.l = null;
  8. this.J = [];
  9. this.L = this.h = !1;
  10. this.C = this.B = -1;
  11. this.N = 1;
  12. this.g = {};
  13. this.G = [];
  14. var b = chrome.runtime.connect({
  15. name: a ? "top" : "sub"
  16. });
  17. this.a = b;
  18. this.K = b.id || b.portId_ || Math.ceil(1048575 * Math.random());
  19. b.onMessage.addListener(this.onMessage.bind(this));
  20. b.onDisconnect.addListener(this.R.bind(this));
  21. this.b(window, "scroll", this.da);
  22. this.b(window, "blur", this.$);
  23. this.b(window, "keydown", this.H, !0);
  24. this.b(window, "keyup", this.H, !0);
  25. this.b(window, "mousedown", this.aa, !0);
  26. this.b(window, "mouseup", this.ba, !0);
  27. this.b(document, "beforeload", this.Y, !0);
  28. this.b(document, "DOMContentLoaded", this.Z);
  29. a && this.b(window, "resize", this.ca)
  30. };
  31. window.__idm_init__ = !0;
  32. 0 < navigator.userAgent.indexOf("Edge/") && (chrome = browser);
  33. var x = {
  34. 16: !0,
  35. 17: !0,
  36. 18: !0,
  37. 45: !0,
  38. 46: !0
  39. }
  40. , C = ["VIDEO", "AUDIO", "OBJECT", "EMBED"]
  41. , D = new RegExp(atob("eXRwbGF5ZXJcLmNvbmZpZ1xzKj1ccypcew=="))
  42. , E = new RegExp(atob("XCI/dmlkZW9EYXRhXCI/XHMqOlxzKlxbXHs="))
  43. , F = new RegExp(atob("InByb2dyZXNzaXZlIjpccypcWw=="));
  44. g = u.prototype;
  45. g.U = function(a, b, d, f) {
  46. try {
  47. var c = document.activeElement
  48. , l = c && 0 <= C.indexOf(c.tagName) ? c : null;
  49. l || (l = (c = document.elementFromPoint(this.B, this.C)) && 0 <= C.indexOf(c.tagName) ? c : null);
  50. for (var m = 0, n, p, q, h, k = 0; k < C.length; k++) {
  51. for (var e = document.getElementsByTagName(C[k]), r = 0; r < e.length; r++)
  52. if (c = e[r],
  53. 3 != k || "application/x-shockwave-flash" == c.type.toLowerCase()) {
  54. var t = c.src || c.data;
  55. if (t && (t == a || t == b)) {
  56. n = c;
  57. break
  58. }
  59. if (!l && !p)
  60. if (!t || t != d && t != f) {
  61. var v = c.clientWidth
  62. , w = c.clientHeight;
  63. if (v && w) {
  64. var y = c.getBoundingClientRect();
  65. if (!(0 >= y.right + window.scrollX || 0 >= y.bottom + window.scrollY)) {
  66. var z = window.getComputedStyle(c);
  67. if (!z || "hidden" != z.visibility) {
  68. var A = v * w;
  69. A > m && 1.35 * v > w && v < 3 * w && (m = A,
  70. q = c);
  71. h || (h = c)
  72. }
  73. }
  74. }
  75. } else
  76. p = c
  77. }
  78. if (n)
  79. break
  80. }
  81. a = n || l || p || q || h;
  82. if (!a)
  83. return null;
  84. if ("EMBED" == a.tagName && !a.clientWidth && !a.clientHeight) {
  85. var B = a.parentElement;
  86. "OBJECT" == B.tagName && (a = B)
  87. }
  88. return this.o(a)
  89. } catch (G) {}
  90. }
  91. ;
  92. g.T = function(a, b, d) {
  93. try {
  94. for (var f = [], c, f = Array.prototype.concat.apply(f, document.getElementsByTagName("FRAME")), f = Array.prototype.concat.apply(f, document.getElementsByTagName("IFRAME")), l = 0; l < f.length; l++) {
  95. var m = f[l];
  96. if (parseInt(m.getAttribute("__idm_frm__")) == a) {
  97. c = m;
  98. break
  99. }
  100. if (!c) {
  101. var n = m.src;
  102. !n || n != b && n != d || (c = m)
  103. }
  104. }
  105. return this.o(c)
  106. } catch (p) {}
  107. }
  108. ;
  109. g.A = function() {
  110. var a = window.devicePixelRatio
  111. , b = document.width
  112. , d = document.body.scrollWidth;
  113. b && d && (a = b == d ? 0 : b / d);
  114. return a
  115. }
  116. ;
  117. g.v = function(a) {
  118. try {
  119. var b = a.getBoundingClientRect()
  120. , d = Math.round(b.width)
  121. , f = Math.round(b.height);
  122. if (15 > d || 15 > f)
  123. return null;
  124. var c = document.documentElement
  125. , l = c.scrollHeight || c.clientHeight
  126. , m = Math.round(b.left) + a.clientLeft
  127. , n = Math.round(b.top) + a.clientTop;
  128. return m >= (c.scrollWidth || c.clientWidth) || n >= l ? null : {
  129. left: m,
  130. top: n,
  131. right: m + d,
  132. bottom: n + f,
  133. zoom: this.A()
  134. }
  135. } catch (p) {}
  136. }
  137. ;
  138. g.w = function() {
  139. this.a.postMessage([21, window.location.href])
  140. }
  141. ;
  142. g.m = function(a) {
  143. if (a) {
  144. if (!this.P) {
  145. this.P = !0;
  146. this.b(window, "message", this.ea);
  147. var b = document.createElement("script");
  148. b.src = chrome.extension.getURL("document.js");
  149. b.onload = function() {
  150. b.parentNode.removeChild(b)
  151. }
  152. ;
  153. document.documentElement.appendChild(b)
  154. }
  155. this.i(a) && window.postMessage([1], "/")
  156. } else if ("loading" == document.readyState)
  157. this.M = !0;
  158. else if (this.i()) {
  159. this.M = !1;
  160. a = document.getElementsByTagName("SCRIPT");
  161. for (var d = 0; d < a.length; d++) {
  162. b = a[d];
  163. if (!b.src && D.test(b.innerText)) {
  164. a = this.f();
  165. a = [34, a, -1, b.outerHTML];
  166. this.a.postMessage(a);
  167. break
  168. }
  169. if (!b.src && E.test(b.innerText)) {
  170. a = this.f();
  171. a = [34, a, -2, b.outerHTML];
  172. this.a.postMessage(a);
  173. break
  174. }
  175. if (!b.src && F.test(b.innerText)) {
  176. a = this.f();
  177. a = [34, a, -2, b.outerHTML];
  178. this.a.postMessage(a);
  179. break
  180. }
  181. }
  182. }
  183. }
  184. ;
  185. g.ea = function(a) {
  186. var b = a.data;
  187. Array.isArray(b) && a.origin == (document.origin || location.origin) && 2 == b[0] && this.a.postMessage([34, b[1], -1, b[2]])
  188. }
  189. ;
  190. g.X = function(a) {
  191. var b = a[2] || this.T(a[3], a[4], a[5])
  192. , d = b && this.g[b]
  193. , d = d && this.v(d);
  194. this.a.postMessage([22, a[1], a[3], b, d])
  195. }
  196. ;
  197. g.W = function(a) {
  198. if (this.i(a)) {
  199. var b = !a[2]
  200. , d = a[2] || this.U(a[3], a[4], a[5], a[6]);
  201. a = [23, a[1], d, !1];
  202. var f = d && this.g[d];
  203. if (f) {
  204. var c = this.v(f);
  205. c && (a[4] = c);
  206. b ? (a[5] = f.tagName,
  207. a[6] = f.src || f.data,
  208. a[7] = this.f()) : c || document.contains(f) || (a[3] = !0,
  209. delete this.g[d])
  210. }
  211. this.a.postMessage(a)
  212. }
  213. }
  214. ;
  215. g.o = function(a) {
  216. try {
  217. var b = parseInt(a.getAttribute("__idm_id__"));
  218. b || (b = this.K << 10 | this.N++,
  219. a.setAttribute("__idm_id__", b));
  220. this.g[b] = a;
  221. return b
  222. } catch (d) {
  223. return null
  224. }
  225. }
  226. ;
  227. g.f = function(a) {
  228. if (!a || this.i(a)) {
  229. var b;
  230. try {
  231. b = window.top.document.title
  232. } catch (d) {}
  233. if (b)
  234. if (b = b.replace(/[ \t\r\n\u25B6]+/g, " ").trim(),
  235. a)
  236. this.a.postMessage([24, a, b]);
  237. else
  238. return b
  239. }
  240. }
  241. ;
  242. g.j = function(a) {
  243. if (!this.F) {
  244. var b = "\\b\\w+://(?:[%T]*(?::[%T]*)?@)?[%H.]+\\.[%H]+(?::\\d+)?(?:/(?:(?: +(?!\\w+:))?[%T/~;])*)?(?:\\?[%Q]*)?(?:#[%T]*)?".replace(/%\w/g, function(a) {
  245. return this[a]
  246. }
  247. .bind({
  248. "%H": "\\w\\-\u00a0-\ufeff",
  249. "%T": "\\w\\-.+*()$!,%\u00a0-\ufeff",
  250. "%Q": "^\\s\\[\\]{}()"
  251. }));
  252. this.F = new RegExp(b,"gi")
  253. }
  254. for (var d = []; b = this.F.exec(a); )
  255. d.push(b.shift());
  256. return d
  257. }
  258. ;
  259. g.u = function(a, b, d) {
  260. var f = [], c = {}, l = "", m = "", n = !d, p;
  261. if (d && (p = a.getSelection(),
  262. !p || p.isCollapsed))
  263. return f;
  264. var q = a.getElementsByTagName("A");
  265. if (q)
  266. for (var h = 0; h < q.length; h++) {
  267. var k = q[h];
  268. if (k && (n || p.containsNode(k, !0)))
  269. try {
  270. var e = k.href;
  271. e && !c[e] && b.test(e) && (c[e] = f.push([e, 2, k.innerText || k.title]));
  272. d && c[e] && (l += k.innerText,
  273. l += "\n")
  274. } catch (r) {}
  275. }
  276. if (q = a.getElementsByTagName("AREA"))
  277. for (h = 0; h < q.length; h++)
  278. if ((k = q[h]) && (n || p.containsNode(k, !0)))
  279. try {
  280. (e = k.href) && !c[e] && b.test(e) && (c[e] = f.push([e, 2, k.alt]))
  281. } catch (r) {}
  282. if (q = n && a.getElementsByTagName("IFRAME"))
  283. for (h = 0; h < q.length; h++)
  284. if ((k = q[h]) && (n || p.containsNode(k, !0)))
  285. try {
  286. (e = k.src) && !c[e] && b.test(e) && (c[e] = f.push([e, 4]))
  287. } catch (r) {}
  288. if (h = d && p.toString())
  289. for (k = this.j(h),
  290. l = this.j(l),
  291. h = 0; h < k.length; h++)
  292. (e = k[h]) && !c[e] && b.test(e) && 0 > l.indexOf(e) && (c[e] = f.push([e, 1]));
  293. if (l = (n || !f.length) && a.getElementsByTagName("IMG"))
  294. for (h = 0; h < l.length; h++)
  295. if ((k = l[h]) && (n || p.containsNode(k, !0)))
  296. try {
  297. (e = k.src) && !c[e] && b.test(e) && (c[e] = f.push([e, 3, "<<<=IDMTRANSMITIMGPREFIX=>>>" + k.alt])),
  298. n && k.onclick && (m += k.onclick,
  299. m += "\n")
  300. } catch (r) {}
  301. if (e = n && a.getElementsByTagName("SCRIPT")) {
  302. for (h = 0; h < e.length; h++)
  303. m += e[h].innerText,
  304. m += "\n";
  305. for (m = this.j(m); m.length; )
  306. (e = m.shift()) && !c[e] && b.test(e) && (c[e] = f.push([e, 5]))
  307. }
  308. return f
  309. }
  310. ;
  311. g.V = function(a, b) {
  312. for (var d = this.u(document, a, b), f = document.getElementsByTagName("IFRAME"), c = Array.prototype.push, l = 0; l < f.length; l++)
  313. try {
  314. var m = f[l]
  315. , n = m.contentDocument;
  316. n && !m.src && c.apply(d, this.u(n, a, b))
  317. } catch (p) {}
  318. return d
  319. }
  320. ;
  321. g.H = function(a) {
  322. x[a.keyCode] && this.a.postMessage([31, a.keyCode, "keydown" == a.type])
  323. }
  324. ;
  325. g.aa = function(a) {
  326. this.L && this.a.postMessage([28]);
  327. if (0 == a.button) {
  328. var b = a.view.getSelection();
  329. this.h = b && b.isCollapsed;
  330. this.a.postMessage([32, a.button, !0])
  331. }
  332. }
  333. ;
  334. g.ba = function(a) {
  335. if (0 == a.button && (this.B = a.clientX,
  336. this.C = a.clientY,
  337. this.a.postMessage([32, a.button, !1]),
  338. this.h)) {
  339. this.h = !1;
  340. var b = a.view.getSelection();
  341. b && !b.isCollapsed && this.a.postMessage([26, a.clientX, a.clientY, this.A()])
  342. }
  343. }
  344. ;
  345. g.$ = function() {
  346. this.h = !1;
  347. this.a.postMessage([33])
  348. }
  349. ;
  350. g.da = function() {
  351. this.a.postMessage([29])
  352. }
  353. ;
  354. g.ca = function(a) {
  355. a = a.target;
  356. this.a.postMessage([30, a.innerWidth, a.innerHeight])
  357. }
  358. ;
  359. g.Y = function(a) {
  360. var b = a.target
  361. , d = b.tagName;
  362. 0 <= C.indexOf(d) && a.url && (b = this.o(b),
  363. this.a.postMessage([25, b, d, a.url]))
  364. }
  365. ;
  366. g.Z = function() {
  367. this.c = !0;
  368. var a;
  369. try {
  370. a = window.top.document.getElementsByTagName("title")[0]
  371. } catch (d) {}
  372. if (a) {
  373. var b = this.l;
  374. b || (this.l = b = new MutationObserver(this.I.bind(this)));
  375. b.observe(a, {
  376. childList: !0
  377. })
  378. }
  379. this.M && this.m()
  380. }
  381. ;
  382. g.I = function(a) {
  383. this.c = !0;
  384. a && (window.clearTimeout(this.s),
  385. this.s = null);
  386. a = this.J;
  387. for (var b; b = a.shift(); )
  388. b.shift().apply(this, b)
  389. }
  390. ;
  391. g.S = function() {
  392. this.l && this.c && (this.c = !1,
  393. this.s = window.setTimeout(this.I.bind(this, !1), 3E3))
  394. }
  395. ;
  396. g.i = function() {
  397. if (this.c)
  398. return !0;
  399. var a = Array.prototype.slice.call(arguments);
  400. a.unshift(arguments.callee.caller);
  401. this.J.push(a);
  402. return !1
  403. }
  404. ;
  405. g.onMessage = function(a) {
  406. switch (a[0]) {
  407. case 11:
  408. var b = a[2];
  409. if (b) {
  410. this.D = b;
  411. try {
  412. window.frameElement && window.frameElement.setAttribute("__idm_frm__", b)
  413. } catch (f) {}
  414. }
  415. a[3] && this.w();
  416. a[4] && this.m();
  417. break;
  418. case 17:
  419. this.S();
  420. a[1] && this.w();
  421. a[2] && this.m(!0);
  422. break;
  423. case 12:
  424. var b = this.V(a[4] ? new RegExp(a[4],"i") : null, a[2])
  425. , d = [27, a[1], this.D, b.length];
  426. a[3] || (d[4] = b,
  427. d[5] = window.location.href,
  428. this.O && (d[6] = window.location.href,
  429. d[7] = document.title));
  430. this.a.postMessage(d);
  431. break;
  432. case 13:
  433. this.L = a[1];
  434. break;
  435. case 14:
  436. this.f(a[1]);
  437. break;
  438. case 15:
  439. this.W(a);
  440. break;
  441. case 16:
  442. this.X(a)
  443. }
  444. }
  445. ;
  446. g.b = function(a) {
  447. var b = Array.prototype.slice.call(arguments);
  448. b[2] = b[2].bind(this);
  449. this.G.push(b);
  450. a.addEventListener.apply(a, b.slice(1))
  451. }
  452. ;
  453. g.R = function() {
  454. for (var a; a = this.G.shift(); ) {
  455. var b = a.shift();
  456. b.removeEventListener.apply(b, a)
  457. }
  458. this.a = this.K = null;
  459. window.__idm_init__ = !1
  460. }
  461. ;
  462. new u
  463. }
  464. !0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement