0% found this document useful (0 votes)
109 views

Auto Page Reload

This userscript detects common error pages and gateway timeout pages and automatically reloads the page after a set time. It checks the document title and H1 heading for error messages and reloads if a match is found.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views

Auto Page Reload

This userscript detects common error pages and gateway timeout pages and automatically reloads the page after a set time. It checks the document title and H1 heading for error messages and reloads if a match is found.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

// ==UserScript==

// @name Auto_Page_Reload_on_Error_and_Gateway_Problem_Fixer
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author @Itsmaarouf
// @match https://algeria.blsspainglobal.com/dza/home/index
// @match *://*.algeria.blsspainglobal.com/DZA/Account/LogIn?ReturnUrl=
%2FDZA%2FBls%2FVisaTypeVerification/*
// @match *://*.blsspainvisa.com/*
// @match *://*.blsspainglobal.com/*
// @icon
data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==

(function() {
'use strict';

console.log("code start")
var time = 1000;
const titles = ['504 Gateway Time-out','403 Forbidden', 'Problem loading
page','503 Service Temporarily Unavailable','Service Unavailable','500 Internal
Server Error','Database error','FastCGI Error','The connection has timed
out','Problemas al cargar la p?gina','Error 502 (Server Error)!!1'];
const HeadingText = ['502 Bad Gateway','Service Unavailable','403 ERROR','Error
503 Service Unavailable','404 Not Found','504 Gateway Time-out','This page isn�t
working'];
const myBody = ['Scheduled maintenance is under progress'];
var myTitle = document.title;

if(document.body.childElementCount <= 1 || titles.includes(myTitle)){


console.log("code here")
setTimeout(function() {
window.location.reload(true);
}, time);
}else if(( HeadingText.includes(document.getElementsByTagName('h1')
[0].innerText))){
setTimeout(function() {
window.location.reload(true);
}, time);
}
console.log("End of code")
})();

You might also like