By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,461 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,461 IT Pros & Developers. It's quick & easy.

Browser Close

P: n/a
Hi,
I was wondering anyone can help me? I am looking for a javascript
that can do such a thing? If the Mouse and keyboard sit and do nothing
for 5 to 10 minutes. The Internet Browser will close and return to the
PC desktop.

Thanks,
Chris
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can only close a window that you've created yourself.
On other windows, at least MIE will ask permission to close the window
<ho******@hal.humberc.on.ca> schreef in bericht
news:8b**************************@posting.google.c om...
Hi,
I was wondering anyone can help me? I am looking for a javascript
that can do such a thing? If the Mouse and keyboard sit and do nothing
for 5 to 10 minutes. The Internet Browser will close and return to the
PC desktop.

Thanks,
Chris

Jul 20 '05 #2

P: n/a
In article <10***************@halkan.kabelfoon.nl>, "Ang Talunin"
<pl************@no-reply.com> writes:
You can only close a window that you've created yourself.
On other windows, at least MIE will ask permission to close the window


While it is best not to, you can in fact close a window that you didn't open
yourself. Its exploiting a bug dating back to NN4.xx and IE5.0 (not sure about
IE4), but it can be done.

<script type="text/javascript">
window.opener = window;
window.close();
</script>

The only modern browser on a PC that I am aware of (there are undoubtedly
others) that will stop it is Mozilla. NS4/6/7 Opera 7, And MSIE all allow it to
close. The tabbed browsers close the active tab, not the browser itself though.

But being able to close a window that you didn't open via script won't solve
the OP's problem.
--
Randy
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.