Error Page Auto Reload

By the DtTvB Last update Jul 15, 2007 — Installed 557 times. Daily Installs: 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 0, 0, 1, 0, 1, 0
// ==UserScript==
// @name           Error Page Auto Reload
// @namespace      http://dttvb.yi.org/
// @include        *
// ==/UserScript==

function g(i) {
	return document.getElementById(i);
}

if (g('errorPageContainer') && g('errorTitle') && unsafeWindow.retryThis) {
	var rcd = 10;
	var ot = document.title;
	var oh = g('errorTitleText').innerHTML;
	function setTitle(x) {
		document.title = x + ' / ' + ot;
		g('errorTitleText').innerHTML = oh + '<br />' + x;
	}
	function cd() {
		if (rcd <= 0) {
			setTitle ('Reloading...');
			unsafeWindow.retryThis ();
		} else {
			setTitle ('Reload in ' + rcd + ' second' + (rcd == 1 ? '' : 's'));
			setTimeout (cd, 1000);
			rcd --;
		}
	}
	cd ();
}