PluginProbe
Taboola / 3.0.2
Taboola v3.0.2
1.0.4 1.0.5 1.0.6 1.0.8 2.0.1 2.0.2 2.1.0 2.1.1 2.2.2 2.2.3 3.0.0 3.0.1 3.0.2 3.1.0 trunk 1.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.2 1.0.3
← All changes | js/js_inject.min.js +42 -59 2.0.23.0.2 View file →
@@ -1,62 +1,45 @@
1 -function insertAfter(e, t) {
2 - t.parentNode.insertBefore(e, t.nextSibling)
3 -}
1 +! function() {
2 + "use strict";
4 3
5 -function getElementByXPath(e, t) {
6 - if (!t) t = document;
7 - if (t.evaluate) return t.evaluate(e, document, null, 9, null).singleNodeValue;
8 - while (e.charAt(0) == "/") e = e.substr(1);
9 - var n = t;
10 - var r = e.split("/");
11 - for (var i = 0; i < r.length; i++) {
12 - var a = r[i].split(/(\w*)\[(\d*)\]/gi).filter(function(e) {
13 - return !(e == "" || e.match(/\s/gi))
14 - }, this);
15 - var l = a[0];
16 - var o = a[1] ? a[1] - 1 : 0;
17 - if (i < r.length - 1) n = n.getElementsByTagName(l)[o];
18 - else return n.getElementsByTagName(l)[o]
19 - }
20 -}
21 -if (!Array.prototype.filter) {
22 - Array.prototype.filter = function(e) {
23 - var t = this.length >>> 0;
24 - if (typeof e != "function") {
25 - throw new TypeError
26 - }
27 - var n = [];
28 - var r = arguments[1];
29 - for (var i = 0; i < t; i++) {
30 - if (i in this) {
31 - var a = this[i];
32 - if (e.call(r, a, i, this)) {
33 - n.push(a)
34 - }
35 - }
36 - }
37 - return n
38 - }
39 -}
4 + function e(e, t) {
5 + let n = t.parentNode;
6 + n.lastChild === t ? n.appendChild(e) : n.insertBefore(e, t.nextSibling)
7 + }
40 8
41 -function injectWidgetByXpath(e) {
42 - var t = getElementByXPath(e);
43 - if (t == null) {
44 - t = document.getElementById("tbdefault")
45 - }
46 - innerInject(t)
47 -}
9 + function t(e, t = document) {
10 + if (t.evaluate) return t.evaluate(e, t, null, 9, null).singleNodeValue;
11 + e = e.replace(/^\/+/, "");
12 + let n = e.split("/"),
13 + l = t;
14 + for (let i = 0, r = n.length; i < r && l; i += 1) {
15 + let a = /([^\[\]]+)(?:\[(\d+)\])?/.exec(n[i]);
16 + if (!a) return null;
17 + let [, u, o] = a, f = o ? o - 1 : 0;
18 + l = l.getElementsByTagName(u)[f] || null
19 + }
20 + return l
21 + }
48 22
49 -function injectWidgetByMarker(e) {
50 - var t = document.getElementById(e);
51 - innerInject(t.parentNode)
52 -}
53 -
54 -function innerInject(e) {
55 - var t = document.createElement("span");
56 - var n = document.createElement("script");
57 - var r = "if JS crashes here, the first innerHTML value should be enclosed with single quotes instead of double, go to the minified version and change it";
58 - t.innerHTML = "{{HTML}}";
59 - n.innerHTML = "{{SCRIPT}}";
60 - insertAfter(t, e);
61 - insertAfter(n, t)
62 -}
23 + function n(t) {
24 + if (!t) return;
25 + let n = document.createDocumentFragment(),
26 + l = document.createElement("span"),
27 + i = document.createElement("script");
28 + l.insertAdjacentHTML("beforeend", "{{HTML}}"), i.text = "{{SCRIPT}}", n.appendChild(l), n.appendChild(i), e(n, t)
29 + }
30 + Array.prototype.filter || (Array.prototype.filter = function(e, t) {
31 + if ("function" != typeof e) throw TypeError();
32 + let n = [];
33 + for (let l = 0, i = this.length >>> 0; l < i; l += 1)
34 + if (l in this) {
35 + let r = this[l];
36 + e.call(t, r, l, this) && n.push(r)
37 + } return n
38 + }), window.insertAfter = e, window.getElementByXPath = t, window.injectWidgetByXpath = function e(l) {
39 + let i = t(l) || document.getElementById("tbdefault");
40 + i && n(i)
41 + }, window.injectWidgetByMarker = function e(t) {
42 + let l = document.getElementById(t);
43 + l && l.parentNode && n(l.parentNode)
44 + }, window.innerInject = n
45 +}();