473,396 Members | 1,968 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 7151
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: Will Stuyvesant | last post by:
Here is a question for people who are more comfortable than I am with new Python stuff like generators. I am having fun implementing things from the Wizard book (Abelson, Sussman, "Structure and...
9
by: Graham | last post by:
What I currently have is a page that opens another browser at 800x600, once that is loaded I would like to close the orginal page down while keeping the page that it has just opened open (To make...
7
by: colin.steadman | last post by:
I have an ASP page setup for doing maintenance jobs in Oracle. Clicking a maintenance job spawns a new window (cut down to a small size with Javascript) and the jobs runs. Just before processing...
7
by: tma | last post by:
How can I force a file to be downloaded to the client when the click a link button, rather than show the file in the browser window (or another window). I want the user to be prompted to open or...
3
by: Eitan | last post by:
Hello, How can I close the aspx by force (with some commands) ? Thanks :)
3
by: dotnettester | last post by:
Hi, Is there a way, I can get a new sessionid without user closing the browser window? I have a webpage, which logs user input and sessionid. If the user does not close the browser and if...
1
by: Mark A | last post by:
DB2 ESE 8.2.3 (FP10) for Linux We are experiencing a connection hang of 10 - 15 minutes in the following HADR and automatic client reroute scenario: 01 server is primary database 02 server is...
0
by: jinnareddy | last post by:
Hi, I'm unable to download a file that is having a 2-byte char in its name (e.g.テ) using force download option. Though, am able to download file names involving ASCII chars. I have tried URL...
1
by: coolsti | last post by:
I am having a curious problem with Vista working on a Lenovo thinkpad. To test and demonstrate this problem, I have a PHP script that does not terminate. It enters an infinite loop where it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.