473,372 Members | 1,055 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,372 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 7148
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.