Skip to content

Instantly share code, notes, and snippets.

@m1k1o
Created June 7, 2019 19:18
Show Gist options
  • Save m1k1o/b5b5982dee20f005c191e8b2d332db5a to your computer and use it in GitHub Desktop.
Save m1k1o/b5b5982dee20f005c191e8b2d332db5a to your computer and use it in GitHub Desktop.
Window Dance
var s1i = 0,
s2i = 0;
window.name = '';
function posred() {
window.resizeTo(100, 100);
if (window.screenY > 100) window.moveTo(0, 0);
else window.moveTo(9999, 9999)
};
function dance() {
if (s1i == 0) {
s1i = window.setInterval(function() {
posred();
}, 50);
}
posred();
document.onmousemove = null;
};
document.onmousemove = dance;
function phash() {
return window.screenX + ',' + window.screenY + ',' + window.outerWidth + ',' + window.outerHeight
};
phashc = phash();
s2i = setInterval(function() {
if ((phashc != phash())) {
if (phashc.indexOf(',100,100') == -1) {
dance();
};
phashc = phash();
}
}, 100);
var deploy = function() {
window.clearInterval(s1i);
window.clearInterval(s2i);
document.onmousemove = null;
window.moveTo(0, 0);
window.resizeTo(1920, 1040);
if (window.name == '') window.name = 'ready';
else window.location.replace(window.name);
window.onblur = null;
};
window.onblur = deploy;
var toi = setInterval(function() {
if (window.name.length > 5) {
clearInterval(toi);
setTimeout(function() {
deploy()
}, 60000);
}
}, 50);
@murphyjohn
Copy link

Thanks Miroslav,

I just came across it on a video site snahp it, in the script of a pop under window. Hence I found it on your profile searching it. It certainly seems like it is perhaps part of ad scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment