Skip to content

Instantly share code, notes, and snippets.

@sean-clayton
Created June 19, 2019 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean-clayton/29b87910878826cce051edfb1de5d219 to your computer and use it in GitHub Desktop.
Save sean-clayton/29b87910878826cce051edfb1de5d219 to your computer and use it in GitHub Desktop.
function FingerprintWrapper(e) {
var t = null,
r = new n();
c.rebuildXMLHttpRequest(e.ajax_header), c.fetchAjaxHeaders(e);
var d = function(n) {
if (!t) {
t = n ? n.type : "manual/other";
var d = function(t) {
var r = a();
if (r) {
var n = encodeURIComponent(i(t, !0).replace(/[\s]+/g, ""));
(r.onreadystatechange = function() {
if (4 == r.readyState && 200 == r.status) {
h("DistilPostResponse");
try {
var e = r.getResponseHeader("X-UID");
} catch (t) {}
if (document.getElementById("distilIdentificationBlock")) {
var n = encodeURIComponent(
document.location.pathname + document.location.search
),
i = "/distil_identify_cookie.html?httpReferrer=" + n;
e && (i = i + "&uid=" + e),
document.location.hash && (i += document.location.hash),
document.location.replace(i);
} else if (document.getElementById("distil_ident_block")) {
var a =
"d_ref=" + document.location.pathname.replace(/&/, "%26");
(a +=
"&qs=" +
document.location.search +
document.location.hash),
e && (a = "uid=" + e + "&" + a),
document.location.replace(
"/distil_identify_cookie.html?" + a
);
} else
(document.getElementById("distil_ident_block_POST") ||
document.getElementById(
"distilIdentificationBlockPOST"
)) &&
(c.isSafariOrIOS()
? window.history.go(-1)
: window.location.reload());
}
}),
r.open("POST", e.path, !0),
h("DistilPostSent"),
r.send("p=" + n);
}
},
u = function(e, t) {
for (var r = {}, n = e.length, i = 0, a = e.length; a > i; ++i)
e[i](function(e) {
for (var i in e) e.hasOwnProperty(i) && (r[i] = e[i]);
(n -= 1), 0 === n && t(r);
});
};
u(
[
function(e) {
setTimeout(function() {
function t(e) {
for (
var t =
"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
r = "",
n = 0;
e > n;
++n
)
r += t.substr(Math.floor(Math.random() * t.length), 1);
return r;
}
h("DistilProofOfWorkStart");
var r = new o(),
n = new Date().getTime() + ":" + t(20);
r.mine(n, 8, function(t) {
h("DistilProofOfWorkStop"), e({ proof: t });
});
}, 1);
},
function(e) {
setTimeout(function() {
h("DistilFP2Start");
var t = new s();
t.interrogate(function(t) {
h("DistilFP2End"), e({ fp2: t });
});
}, 1);
},
function(e) {
setTimeout(function() {
setTimeout(function() {
h("DistilLegacyStart");
var t = r.get();
h("DistilLegacyEnd"), e(t);
}, 1);
}, 1);
}
],
function(e) {
d(e);
}
);
}
},
u = !1,
h = function(e) {},
g = document.getElementById("d__inj");
g &&
g.className &&
(g.className.indexOf("delayed") > -1 && (u = !0),
g.className.indexOf("perfmarks") > -1 &&
void 0 != performance &&
void 0 != performance.mark &&
(h = function(e) {
performance.mark(e);
})),
u
? window.document.readyState && "complete" == window.document.readyState
? d()
: window.addEventListener
? window.addEventListener("load", d, !1)
: window.document.attachEvent &&
window.document.attachEvent("onload", d)
: window.document.readyState && "loading" == window.document.readyState
? d()
: window.addEventListener
? (window.addEventListener("DOMContentLoaded", d, !1),
window.addEventListener("load", d, !1))
: window.document.attachEvent &&
(window.document.attachEvent("onreadystatechange", d),
window.document.attachEvent("onload", d));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment