reload scheduler

it does nothing but just schedule a page reload

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(У мене вже є менеджер скриптів, дайте мені встановити його!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        reload scheduler
// @description it does nothing but just schedule a page reload
// @namespace   http://mfish.twbbs.org/
// @include     http://*
// @include     https://*
// @version     0.1.1
// @grant       GM_registerMenuCommand 
// ==/UserScript==

(function(){

var reload = function (min_timewait) {
  if (min_timewait > 0) {
    setTimeout(function(){
      location.reload();
    }, min_timewait * 1000 * 60)
  }
}


var onclick = function() {
  var reloadTime = window.prompt("Reload after x minute :", "0");
  var parsedNum = parseInt(reloadTime, 10);
  if (!isNaN(parsedNum) && parsedNum > 0) {
    alert('will reload after : ' + parsedNum + ' minutes');
    reload(parsedNum);
  } else {
    alert('not scheduled');
  }
}

GM_registerMenuCommand("schedule reload", onclick);
  
}())