Closing Parent window without prompt for Firefox 2 and IE 7

Discussion in 'Javascript' started by Tony, Feb 21, 2007.

  1. Tony

    Tony Guest

    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

    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();
    {'','_parent',''); window.close();

    Tony, Feb 21, 2007
    1. Advertisements

  2. Tony

    Randy Webb Guest

    Tony said the following on 2/21/2007 3:11 PM:
    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.
    Randy Webb, Feb 21, 2007
    1. Advertisements

  3. Tony

    Tony Guest

    dang. Well we got it to work in IE 6 and Firefox 1.5
    Tony, Feb 22, 2007
  4. Tony

    <missing quote>
    Closing parent window
    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 Formby, Feb 22, 2007
  5. Tony

    Tony Guest

    It's for an internal website for an online learning course. So you
    wouldn't be visiting it anyways.
    Tony, Feb 22, 2007
  6. You didn't say that. Puts a whole different slant on the matter.
    Richard Formby, Feb 22, 2007
  7. Tony

    dd Guest

    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
    dd, Feb 22, 2007
  8. Tony

    dd Guest

    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 ;-)
    dd, Feb 22, 2007
  9. dd wrote

    [a site that opens a new window and then closes the parent]
    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.
    Richard Formby, Feb 22, 2007
  10. On Feb 22, 10:40 am, Richard Formby wrote:

    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 Cornford, Feb 22, 2007
  11. Tony

    Randy Webb Guest

    Richard Formby said the following on 2/22/2007 1:30 AM:
    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.
    Randy Webb, Feb 22, 2007
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.