Closing Parent window without prompt for Firefox 2 and IE 7

T

Tony

I need to know how to open a pop up and close the main window without
a prompt in Firefox 2 and IE 7. Anybody have any ideas on how to do
that.

I currently have this and it works in IE 6 and Firefox 1.5:

function windowClose()
{
if(navigator.appName=="Microsoft Internet Explorer")
{
this.focus();self.opener = this;self.close();
}
else
{
window.open('','_parent',''); window.close();
}
}

Thanks,
Tony
 
R

Randy Webb

Tony said the following on 2/21/2007 3:11 PM:
I need to know how to open a pop up and close the main window without
a prompt in Firefox 2 and IE 7.

You can't. The developers, thankfully, listened to the wish of users not
to have people closing windows they didn't open so now you can't.
 
R

Richard Formby

Tony

<missing quote>
Closing parent window
dang. Well we got it to work in IE 6 and Firefox 1.5

Well, you have just managed to loose my probably not inconsiderable browser
history, particularly the google page I had used to find your site. You
know, history, the stuff behind the back button.

Now I have to close your new window, open another window, tell google what I
was searching for and try to navigate back to where I was. And I have now
forgotton the various google searches I used to get to this point. They are
in the history you so conveniently trashed.

Please give me the URL of your site so I can add it to my list of sites
never to visit.
 
T

Tony

It's for an internal website for an online learning course. So you
wouldn't be visiting it anyways.
 
R

Richard Formby

Tony said:
It's for an internal website for an online learning course. So you
wouldn't be visiting it anyways.

You didn't say that. Puts a whole different slant on the matter.
 
D

dd

Well, you have just managed to loose my probably not inconsiderable browser
history, particularly the google page I had used to find your site. You
know, history, the stuff behind the back button.

Now I have to close your new window, open another window, tell google what I
was searching for and try to navigate back to where I was. And I have now
forgotton the various google searches I used to get to this point. They are
in the history you so conveniently trashed.

Please give me the URL of your site so I can add it to my list of sites
never to visit.

Richard, how did you manage to destroy your
history visiting his site when he didn't
post the URL to his site? I can't quite get
my head around this one. You even ask him
for the URL of his site at the end of your
post.
 
D

dd

It's for an internal website for an online learning course. So you
wouldn't be visiting it anyways.

I had to view your profile to see if the link to
your site (that Richard complained destroyed his
history). Do you always refer to yourself in the
third person? You know that's the first sign of
madness don't you ;-)
 
R

Richard Formby

dd wrote

[a site that opens a new window and then closes the parent]
Richard, how did you manage to destroy your
history visiting his site when he didn't
post the URL to his site? I can't quite get
my head around this one. You even ask him
for the URL of his site at the end of your
post.

I didn't need to visit the site. It was merely a thought exercise. Try it
for your self, manually:

Google, change the search argument, google, change, google..., visit a site,
follow a few links. Then a few more. You know how hperlinks work, you can
spend all night following them.

Then (as per the exercise) choose to open a link in a new window by leaning
on your Ctrl key or whatever.

Fine, you have your original window with all the history. All the hyperlinks
you used to get to here.

You also have a new window with a blank back button.

Now *you* close your original window. *You* have just thrown away all of
your history. All you have left is the newly opened window with no history
and a blank back button.

What about that other intersting link you saw a few sites ago (in your
original window), next to the one you clicked way back then, back in your
history. It's gone. Damn. You shouldn't have closed that first window[1].

Now, imagine a real live web site *doing this automatically for you* :-(

Some things that are possible simply should not be done in the WWW context.
Intranet is, of course, a possible exeption.

[1] I regularly have half a dozen or more browser windows open, some of them
displaying multiple tabs. When I close the wrong one accidently I get really
annoyed at myself. The cat abruptly flees the room.
 
R

Richard Cornford

On Feb 22, 10:40 am, Richard Formby wrote:
Some things that are possible simply should not be done in the
WWW context. Intranet is, of course, a possible exeption.
<snip>

In many cases it is the fact that things have been done in the WWW
context that should not have been done that has resulted in those
facilities being removed or restricted in web browsers. And once
removed the possibility also disappears in the Intranet context, where
it may have been better justified.

This is the OP's problem. It used to be possible to close windows not
opened by scripts in some browsers. If nobody had ever done that on
the Internet there would have been no reason to close the loophole
that allowed it. That did not happen, the loophole was closed, and now
the possibility is denied to those writing for Internets, were the
consequences of the closing of a first window would be the
responsibility of an employer.

Richard.
 
R

Randy Webb

Richard Formby said the following on 2/22/2007 1:30 AM:
You didn't say that. Puts a whole different slant on the matter.

That is what is always said after you tell them how dumb an idea it is.
Want a little proof? If it is an internal website then you control all
the browsers. Force them to use IE6 or FF1.5 and you have no issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top