Advertisement
Guest User

Untitled

a guest
Aug 16th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Smotret-anime addblocker
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.4
  5. // @description Turns off smotret-anime adds
  6. // @author Gjmrd
  7. // @run-at document-end
  8. // @match https://smotret-anime.ru/*
  9. // @include https://smotret-anime.ru/*
  10. // @include https://play.shikimori.org/*
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. if(typeof(window.getCookieItem) == "function"){
  16. var watchedVideoToday = window.getCookieItem("watchedVideoToday");
  17. var lastDate = window.getCookieItem("lastDate");
  18. var dateTime = new Date();
  19. var today = dateTime.getDate(), now = dateTime.getTime();
  20. if ((isNaN(watchedVideoToday)) || (today != lastDate)){
  21. watchedVideoToday = 1;
  22. lastDate = today;
  23. }
  24. var expireTime = (new Date()).setTime(now + (1000 * 60 * 60));
  25. window.setCookieItem('watchedVideoToday', +watchedVideoToday+1, '/');
  26. window.setCookieItem('watchedPromoVideo', now, expireTime, '/');
  27. window.setCookieItem('lastDate', lastDate, '/');
  28. }
  29. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement