Reload on error message

Reload the page on an error message you set yourself

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Reload on error message
// @namespace   http://userscripts.org/users/23652
// @description Reload the page on an error message you set yourself
// @version     0.5
// @copyright   JoeSimmons, Nickel
// @grant       none
// @include     *
// ==/UserScript==

// Add your errors here to the pattern ///////////////
var errors = [];
errors[0] = /Too many connections. Please try again later./i;
errors[1] = /Mysql error, could not connectToo many connections/i;
errors[2] = /max_user_connections/i;
errors[3] = /502 Bad Gateway/i;
errors[4] = /504 Gateway Time-out/i;
errors[5] = /Something broke/i;
errors[6] = /Imgur is over capacity!/i;
errors[7] = /The database timed out running your query./i;
errors[8] = /we took too long to make this page for you/i;
//////////////////////////////////////////////////////

function check() {
	for(var i=0; i<errors.length; i++) {
		if( errors[i].test(document.body.textContent) ){
			window.location.reload();
		}
	}

}

setTimeout(check, 250);