469,364 Members | 2,332 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,364 developers. It's quick & easy.

Force browser to close after a delay?

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?
Mar 7 '06 #1
6 7010
Martin wrote:
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
Mar 7 '06 #2
Thomas 'PointedEars' Lahn wrote:
Martin wrote:
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.


\o/

(function(){
var timer;
(document.onmousemove = document.onkeydown = function(){
clearTimeout(timer), timer = setTimeout("window.close();", 1800000);
})();
})();
--
Jonas Raoni Soares Silva
http://www.jsfromhell.com
Mar 7 '06 #3
On Tue, 07 Mar 2006 17:44:42 -0300, Jonas Raoni <jo********@gmail.com>
wrote:
Thomas 'PointedEars' Lahn wrote:
Martin wrote:
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.


\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.
Mar 8 '06 #4
Martin wrote:
On Tue, 07 Mar 2006 17:44:42 -0300, Jonas Raoni <jo********@gmail.com>
wrote:
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 ='/
--
Now with alcohol <URL:http://youtube.com/watch?v=lnQTZxqxc10> =X
Jonas Raoni Soares Silva
http://www.jsfromhell.com

Mar 8 '06 #5
Jonas Raoni said the following on 3/7/2006 9:49 PM:
Martin wrote:
On Tue, 07 Mar 2006 17:44:42 -0300, Jonas Raoni <jo********@gmail.com>
wrote:
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 :)

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 8 '06 #6
Randy Webb wrote:
Jonas Raoni said the following on 3/7/2006 9:49 PM:
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 :)


Not today, my aunt just died of a heart attack, I'll spend the rest of
my free time with my mom now =(
--
Now with alcohol <URL:http://youtube.com/watch?v=lnQTZxqxc10> =X
Jonas Raoni Soares Silva
http://www.jsfromhell.com

Mar 8 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

17 posts views Thread by Will Stuyvesant | last post: by
9 posts views Thread by Graham | last post: by
7 posts views Thread by tma | last post: by
3 posts views Thread by Eitan | last post: by
3 posts views Thread by dotnettester | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.