Shoutbox

Help with a small GM script - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: Help with a small GM script (/showthread.php?tid=97413)

Help with a small GM script by matty on 04-19-2011 at 02:22 PM

So I am getting really frustrated with GM and it's inability for me to grasp what is happening LOL.

Here is the script in it's entirety:

js code:
(function () {
    for (var i in document.forms) {
        if (document.forms[i].name === 'lf') {
            getId('ttAuthUID').value = '';
            getId('ttAuthPWD').value = '';
            getId('submitButton').click();
        }
    }
    setInterval("isTimedOut()", 10000);
       
    function getId(id) { return document.getElementById(id); }
   
    function isTimedOut() {
        if (getId('overlaymessage').style.display == 'block')
            window.location.reload(false);
    }

})();

Basically the script auto logs me in to my works issue tracking software (works fine), now after a bit of time the software will auto log you out. The isTimedOut function simply checks to see if the popup message is displayed and should reload the page. However using setInterval I get isTimedOut() is not defined... I cannot seem to figure out why!

Ultimately it would be nice to gain access to the variable that deals with the timeouts but I cannot seem to figure out how. Still new to GM.

Thanks

Firefox 3.6.16
GM 0.9.2
RE: Help with a small GM script by Mike on 04-19-2011 at 02:46 PM

Try setInterval(function(){isTimedOut();}, 10000);

quote:
Originally posted by matty
Ultimately it would be nice to gain access to the variable that deals with the timeouts but I cannot seem to figure out how. Still new to GM.
unsafeWindow should work, but it's not recommended to use it. Using a location hack should work too.