Tuesday, 27 August 2013

How to prevent javascript timeout function?

How to prevent javascript timeout function?

A website that I frequent utilizes the following javascript
function
idle(){$(document).unbind('mousemove');$(document).unbind('keydown');$(document).one('mousemove',function(){resetTimebomb('keydown');});$(document).one('keydown',function(){resetTimebomb('mousemove');});setTimeout('idle();',60000);}
function
resetTimebomb(psUnbind){$(document).unbind(psUnbind);$.ajax({global:false,url:'/internal/reset_timebomb.php',success:function(sData){if($.trim(sData).length&&sData!='STILL_LOGGED_IN'){timeout();}}});}
function timeout(){var
sReturnTo='&return_to='+encodeURIComponent(window.location.pathname+window.location.search);var
sReturnToUser=typeof(iLoggedInUserID)!='undefined'?'&return_to_user='+iLoggedInUserID.toString():'';window.location='/index.php?message=TIMEOUT'+sReturnTo+sReturnToUser;}
And that js appears in the middle of a js file thousands of lines long.
This js causes an auto-logout after a fairly brief duration, and I would
like it if I did not get booted so quickly. The timeout of "60000" seems
to be 10 minutes. By whatever means necessary, I would like to either
1) Increase the timeout duration, or
2) eliminate the timeout functions altogether, or
3) simulate activity, even when the window is not in focus, to trigger the
timeout reset.
I would utilize something like NoScript, but I need to allow all other
scripts on the page. It is just these particular function, in the middle
of a massive file, that I need to subvert.
Thanks.
I would be most grateful if the solution involved utilizing my router,
which runs a variant of Tomato firmware, so that all of my devices, tablet
included, could benefit from the solution.

No comments:

Post a Comment