473,799 Members | 3,185 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7164
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.onmou semove = document.onkeyd own = function(){
clearTimeout(ti mer), timer = setTimeout("win dow.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********@gma il.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.onmou semove = document.onkeyd own = function(){
clearTimeout(ti mer), timer = setTimeout("win dow.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********@gma il.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=lnQTZxq xc10> =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********@gma il.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.javas cript 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=lnQTZxq xc10> =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
2478
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 Interpretation of Computer Programs") in Python. In chapter 3.5 it is about streams as delayed lists. Streams are interesting because they are to lists like xrange is to range. Could save a lot on memory and
9
3241
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 it more clear take a look at http://www.ithorizon.co.uk). I have inserted some code below to show what I currently have, but I don't have the knowledge to amend it, can somone please help. <SCRIPT LANGUAGE="JavaScript">
7
1332
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 starts I output a message to the user in this new window using a span (with an ID) using Response.Flush. This is to let the user know that processing has started. After the procedure has completed, I update the span message using its ID with...
7
1769
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 save the file associated with the link, not have it open automatically in their browser. Thanks.
3
4416
by: Eitan | last post by:
Hello, How can I close the aspx by force (with some commands) ? Thanks :)
3
2069
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 someone else uses the same browser window, I can not differentiate between different user inputs, because the sessionid is same. Is there a way, I can force a new sessionid, when a certain page is viewed?
1
3915
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 standby database a. applications connected to database on 01 server b. shutdown 01 server
0
2680
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 encoding too, but with no success. Can someone provide details on how to handle the 2-byte char URLs and download the files? Appreciate your suggestions/help in resolving it. Here is my code:
1
3215
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 repeatedly prints out a line of data, flushes output buffers (with appropriate PHP functions), then sleeps for a number of seconds. In other words, this represents a constant input stream to the browser which is requesting the script as a page. On my...
0
9538
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10470
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10247
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9067
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3751
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2935
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.