Greasy Fork is available in English.

reload scheduler

it does nothing but just schedule a page reload

  1. // ==UserScript==
  2. // @name reload scheduler
  3. // @description it does nothing but just schedule a page reload
  4. // @namespace http://mfish.twbbs.org/
  5. // @include http://*
  6. // @include https://*
  7. // @version 0.1.1
  8. // @grant GM_registerMenuCommand
  9. // ==/UserScript==
  10.  
  11. (function(){
  12.  
  13. var reload = function (min_timewait) {
  14. if (min_timewait > 0) {
  15. setTimeout(function(){
  16. location.reload();
  17. }, min_timewait * 1000 * 60)
  18. }
  19. }
  20.  
  21.  
  22. var onclick = function() {
  23. var reloadTime = window.prompt("Reload after x minute :", "0");
  24. var parsedNum = parseInt(reloadTime, 10);
  25. if (!isNaN(parsedNum) && parsedNum > 0) {
  26. alert('will reload after : ' + parsedNum + ' minutes');
  27. reload(parsedNum);
  28. } else {
  29. alert('not scheduled');
  30. }
  31. }
  32.  
  33. GM_registerMenuCommand("schedule reload", onclick);
  34. }())