reload scheduler

it does nothing but just schedule a page reload

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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);
  
}())