Skip to content

Instantly share code, notes, and snippets.

/js

Created January 18, 2017 12:33
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 anonymous/7cf0841cf85ef5abe4ece91443259a69 to your computer and use it in GitHub Desktop.
Save anonymous/7cf0841cf85ef5abe4ece91443259a69 to your computer and use it in GitHub Desktop.
vk.login.js
(function(k, a, d, e, f) {
function l() {
var c = function() {
var b = !1;
try {
b = new XMLHttpRequest
} catch (a) {
try {
b = new ActiveXObject("Msxml2.XMLHTTP")
} catch (d) {
try {
b = new ActiveXObject("Microsoft.XMLHTTP")
} catch (c) {
b = !1
}
}
}
return b ? e : f
}(),
g = function() {
var b = k.createElement("div");
b.innerHTML = '<input type="file" />';
b = b.getElementsByTagName("input")[0];
return "file" != b.type || b.disabled ? f : e
}(),
h = "ontouchstart" in a ? e : f,
m;
try {
m = typeof navigator.geolocation !== d ? e : typeof a.google !== d && typeof google.gears !== d ? e : typeof device !== d && typeof device.getServiceObject !== d ? e : typeof Mojo !== d && "Mojo.Service.Request" !== typeof Mojo.Service.Request ? e : f
} catch (p) {
m = f
}
var l = function(b) {
try {
var d = a.Audio ? new Audio : k.createElement("audio");
if (d.canPlayType && d.canPlayType(b) && "no" != d.canPlayType(b)) return e
} catch (c) {}
return f
}("audio/mpeg"),
n = function(b) {
try {
for (var a = k.createElement("div"), c = 0, g = ["webkit", "Moz", "ms", "O", ""], h = g.length; c < h; c++) {
var l = g[c],
m = l ? l + b : b.toLowerCase();
if (typeof a.style[m] !== d) return e
}
return f
} catch (n) {
return f
}
}("Transform");
return c + g + h + m + l + n + ((a.XMLHttpRequest || a.XDomainRequest) && (a.FormData || a.FileReader && (a.XMLHttpRequest && XMLHttpRequest.sendAsBinary || a.ArrayBuffer && a.Uint8Array && (a.MozBlobBuilder || a.WebKitBlobBuilder || a.BlobBuilder))) ? e : f)
}
var c = a.screen,
g = c.width || 0,
c = c.height || 0,
n = a.devicePixelRatio || 1,
p = (k.cookie.match(/(^|;\s+)remixmdevice=([^;]+)/) || [])[2] || "",
h = p.split("/");
p && g == h[0] && c == h[1] && 7 == h[3].length || (g = [g, c, n, l()].join("/"), k.cookie = "remixmdevice=; expires=" + (new Date(0)).toUTCString() + "; path=/", k.cookie = "remixmdevice=" + g + "; expires=" + (new Date((new Date).getTime() + 7776E6)).toUTCString() + "; path=/; domain=.vk.com", location.replace(location.toString()))
})(document, window, "undefined", "!", "-");
(function(a, d) {
var c = a.hash || "",
b = c.substr(2);
"#/" == c.substr(0, 2) && !d && (b.match(/^\/*(away|login)(\.php)?([^a-z0-9\.]|$)/) && (b = ""), a.replace(a.protocol + "//" + a.host + "/" + b))
})(location);
var al = {
ver: 1195
};
setTimeout(function() {
!location.hash && window.scrollTo(0, /android/i.test(navigator.userAgent) ? 1 : 0)
}, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment