I have 2 scripts that use 2 websites and communicate witch each-other. Basically: Website 1, web1 script, website 2, web2 script, and they go in loop like this: Web1 script> waits for new content on page1> sends it to website 2(changes website through window.location.href = website 2) And then after website 2 finishes job it goes back to website 1. This is how my script SHOULD work, but i have a few problems:
I am using Tampermonkey with Chrome. Every time my connection goes down, chrome changes my current website page to some custom page with no connection available error. This stops my script and it can't go back even when my internet's on again (Cause i cant @include this custom web page so i cant make script to go back to former webpage..) This script should work whole day without human interaction but it cant thanks to random 2-3 sec downtimes...
Is there a way to stop chrome from doing so OR make greasemonkey to work on custom chrome error pages OR eventually if firefox is capable of this?
I also made simple interval functin to resume my script if something's wrong and page doesn't refresh for too long, it goes like this:
function watchdog()
{
window.setInterval(function(){console.log('woof'); ninja_t('woof');set_number = 9; localStorage.setItem('set_number',9);set(set_number);},60000);
}
Will this function work if there's some SyntaxError? I mean do setInterval functions still work after syntax errors in other functions?