Force browser to close after a delay?

Discussion in 'Javascript' started by Martin, Mar 7, 2006.

  1. Martin

    Martin Guest

    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?
     
    Martin, Mar 7, 2006
    #1
    1. Advertising

  2. 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
     
    Thomas 'PointedEars' Lahn, Mar 7, 2006
    #2
    1. Advertising

  3. Martin

    Jonas Raoni Guest

    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
     
    Jonas Raoni, Mar 7, 2006
    #3
  4. Martin

    Martin Guest

    On Tue, 07 Mar 2006 17:44:42 -0300, Jonas Raoni <>
    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.
     
    Martin, Mar 8, 2006
    #4
  5. Martin

    Jonas Raoni Guest

    Martin wrote:
    > On Tue, 07 Mar 2006 17:44:42 -0300, Jonas Raoni <>
    > 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
     
    Jonas Raoni, Mar 8, 2006
    #5
  6. Martin

    Randy Webb Guest

    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 <>
    >> 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/
     
    Randy Webb, Mar 8, 2006
    #6
  7. Martin

    Jonas Raoni Guest

    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
     
    Jonas Raoni, Mar 8, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Denon
    Replies:
    1
    Views:
    587
    Saravana [MVP]
    Nov 14, 2003
  2. Will Stuyvesant

    delay and force in Python

    Will Stuyvesant, Jan 19, 2005, in forum: Python
    Replies:
    17
    Views:
    817
    Nick Coghlan
    Jan 26, 2005
  3. Iñaki Baz Castillo
    Replies:
    7
    Views:
    896
    Iñaki Baz Castillo
    Jan 12, 2010
  4. Lasse Reichstein Nielsen

    Force reload after user changes browser size

    Lasse Reichstein Nielsen, Oct 15, 2003, in forum: Javascript
    Replies:
    3
    Views:
    161
    Thomas 'PointedEars' Lahn
    Nov 6, 2003
  5. Replies:
    0
    Views:
    516
Loading...

Share This Page