Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing how your browser closes windows - possible?

Status
Not open for further replies.

clarkin

Programmer
Dec 4, 2002
707
IE
Hi there,

I was looking at and was wondering if I could add the technique there to my browser. It looks like it would stop all annoying onunload popups. Basically i'd like my [x] button to run:

Code:
window.onload=window.onunload=window.onbeforeunload=null;
window.close();
Anyone know if it is possible to add this to your browser's behaviour? In my case its IE6 on W2K.

:)

Posting code? Wrap it with code tags: [ignore]
Code:
[/ignore][code]CodeHere
[ignore][/code][/ignore].
 
You could put it in a favourite.

IE6/W2K Method:
[ul]
[li]Bookmark any old page into your favorites[/li]
[li]Go 'Favorites -> Organize Favourites'[/li]
[li]Select your recently bookmarked entry[/li]
[li]Right click it, select 'Rename'[/li]
[li]Give the shortcut a useful name[/li]
[li]Right click it again, select 'Properties'[/li]
[li]Get rid of whatever is currently in the URL field[/li]
[li]Put the following text in the URL field:
[tt]javascript:window.onload=window.onunload=window.onbeforeunload=null;window.close();[/tt][/li]
[li]Change the icon to something memorable[/li]
[li]Click OK[/li]
[li]Ignore any warnings about "the protocol javascript not having a registered program" click 'Yes' if any appear[/li]
[/ul]

You should now be able to access the scriptlet from your favourites.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top