Force browser to close after a delay?

M

Martin

Using javascript, I want to force a browser window to close after
about 30 minutes of non-use. Can someone point me to a script that can
do this?

I assume I could use the setTimeout function and keep re-setting it
whenever the mouse is moved.

Is there a better way?
 
T

Thomas 'PointedEars' Lahn

Martin said:
Using javascript, I want to force a browser window to close after
about 30 minutes of non-use. Can someone point me to a script that
can do this?

Write it yourself.
I assume I could use the setTimeout function and keep re-setting it
whenever the mouse is moved.

Your assumption is correct.
Is there a better way?

No.


PointedEars
 
J

Jonas Raoni

Thomas said:
Write it yourself.

\o/

(function(){
var timer;
(document.onmousemove = document.onkeydown = function(){
clearTimeout(timer), timer = setTimeout("window.close();", 1800000);
})();
})();
 
M

Martin

\o/

(function(){
var timer;
(document.onmousemove = document.onkeydown = function(){
clearTimeout(timer), timer = setTimeout("window.close();", 1800000);
})();
})();

Thank you, Jonas. It's good to see that some people, like you, are
here to actually help others.
 
J

Jonas Raoni

Martin said:
Thank you, Jonas. It's good to see that some people, like you, are
here to actually help others.

Hmmm, not at all, I'm here just to spend some free time, discuss and
expose my opinion about unuseful things, but I really try to help
sometimes, anyway thanks :]

I want to discuss with Mr. Spock again, maybe I can beat my off-topic
record of 100 msgs, but he is thousands stronger than me ='/
 
R

Randy Webb

Jonas Raoni said the following on 3/7/2006 9:49 PM:
Martin said:
Thank you, Jonas. It's good to see that some people, like you, are
here to actually help others.

Hmmm, not at all, I'm here just to spend some free time, discuss and
expose my opinion about unuseful things, but I really try to help
sometimes, anyway thanks :]

I want to discuss with Mr. Spock again, maybe I can beat my off-topic
record of 100 msgs, but he is thousands stronger than me ='/

LOL, we can do that if you want :)
 
J

Jonas Raoni

Randy said:
Jonas Raoni said the following on 3/7/2006 9:49 PM:

LOL, we can do that if you want :)

Not today, my aunt just died of a heart attack, I'll spend the rest of
my free time with my mom now =(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top