Advertisement
Guest User

asdsa

a guest
Jul 11th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Smotert-anime add blocker
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  Turns off smotret-anime adds
  6. // @author       Gjmrd
  7. // @match        https://smotret-anime.ru/*
  8. // @include      https://smotret-anime.ru/*
  9. // @include      https://shikimori.org/*
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14.     console.log(213);
  15.     if ( (/https:\/\/play.shikimori.org/.test(location.href)) ) {
  16.         var script = document.createElement('script');
  17.         script.innerHTML = `
  18. var watchedVideoToday = getCookieItem("watchedVideoToday");
  19. var expireTime = (new Date()).setTime((new Date()).getTime() + (1000 * 60 * 60));
  20. setCookieItem('watchedVideoToday', +watchedVideoToday+1, '/');
  21. setCookieItem('watchedPromoVideo', (new Date()).getTime(), expireTime, '/', '');
  22. `;
  23.         script.setAttribute('id', 'super_id_name');
  24.         document.body.appendChild(script);
  25.     }
  26.     console.log(21453433);
  27.     console.log(document.cookie);
  28.     var watchedVideoToday = getCookieItem("watchedVideoToday");
  29.     var expireTime = (new Date()).setTime((new Date()).getTime() + (10)); /* time in ms */
  30. //    setCookieItem('watchedVideoToday', +watchedVideoToday+1, '/');
  31. //    setCookieItem('watchedPromoVideo', (new Date()).getTime(), expireTime, '/');
  32.     setCookieItem('watchedVideoToday', +watchedVideoToday+1, '/');
  33.     setCookieItem('watchedPromoVideo', (new Date()).getTime(), expireTime, '/');
  34.     console.log(21453)
  35. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement