close browser window

Discussion in 'Javascript' started by olga p., Jan 16, 2004.

  1. olga p.

    olga p. Guest

    Hi,

    I would like to close the browser window when I open the new one. Now I'm
    getting really irritation message: do I really want to close it, yes or no.
    I just want to close the browser without the message.

    Does anybody know the solution?

    greatings,

    Olga
     
    olga p., Jan 16, 2004
    #1
    1. Advertising

  2. olga p.

    Harag Guest

    On Fri, 16 Jan 2004 13:13:25 +0100, "olga p." <>
    wrote:

    >Hi,
    >
    >I would like to close the browser window when I open the new one. Now I'm
    >getting really irritation message: do I really want to close it, yes or no.
    >I just want to close the browser without the message.
    >
    >Does anybody know the solution?


    The only windows you can close via scripting are the windows that the
    scripting opens.

    you cannot close the original window that the user opens with a
    shortcut... (well you can but the user has the choice as you can see).


    HTH
    Al
     
    Harag, Jan 16, 2004
    #2
    1. Advertising

  3. olga p.

    Randy Webb Guest

    Harag wrote:

    > On Fri, 16 Jan 2004 13:13:25 +0100, "olga p." <>
    > wrote:
    >
    >
    >>Hi,
    >>
    >>I would like to close the browser window when I open the new one. Now I'm
    >>getting really irritation message: do I really want to close it, yes or no.
    >>I just want to close the browser without the message.
    >>
    >>Does anybody know the solution?

    >
    >
    > The only windows you can close via scripting are the windows that the
    > scripting opens.
    >
    > you cannot close the original window that the user opens with a
    > shortcut... (well you can but the user has the choice as you can see).


    I think, for the sake of doing it, I will keep my mouth (and fingers)
    shut this time, its been beaten to death.

    Needless to say, you *can* [1] close that window without a prompt.
    Search the archives.

    [1] In about 80% (??) of circumstances.

    P.S. The Unconditional Truth might surprise you.


    --
    Randy
     
    Randy Webb, Jan 16, 2004
    #3
  4. olga p.

    DJ WIce Guest

    : The only windows you can close via scripting are the windows that the
    : scripting opens.
    :
    : you cannot close the original window that the user opens with a
    : shortcut... (well you can but the user has the choice as you can see).
    In the past you could:

    - open a child
    - let the child replace the current location of the parent, not via parent..
    but via the name you gave the parent.
    - then try to close the parent via that name.

    I may hope this bug is fixed by now for all browsers.
    The browser (MSIE) just though the child became parent of it's parent.

    Wouter
     
    DJ WIce, Jan 16, 2004
    #4
  5. "DJ WIce" <> wrote in message
    news:bu8n36$8js$...
    <snip>
    >- open a child
    >- let the child replace the current location of the parent, not via
    >parent.. but via the name you gave the parent.
    > - then try to close the parent via that name.
    >
    >I may hope this bug is fixed by now for all browsers.
    >The browser (MSIE) just though the child became parent of it's parent.


    That is a very convoluted way of exploiting the bug that Randy alluded
    to, an probably less reliable than the usual[1] method.

    Richard.

    [1] Not usual in the sense that this is often done as it is a really
    *bad* idea to shut down someone else's software without asking them
    first, you never know what you might be destroying in the process.
     
    Richard Cornford, Jan 16, 2004
    #5
  6. olga p.

    Randy Webb Guest

    DJ WIce wrote:
    > : The only windows you can close via scripting are the windows that the
    > : scripting opens.
    > :
    > : you cannot close the original window that the user opens with a
    > : shortcut... (well you can but the user has the choice as you can see).
    > In the past you could:
    >
    > - open a child
    > - let the child replace the current location of the parent, not via parent..
    > but via the name you gave the parent.
    > - then try to close the parent via that name.
    >
    > I may hope this bug is fixed by now for all browsers.
    > The browser (MSIE) just though the child became parent of it's parent.


    Its not even that difficult. I can close the original page (In certain
    browsers), without opening a second window at all.


    --
    Randy
     
    Randy Webb, Jan 16, 2004
    #6
  7. olga p.

    Jim Ley Guest

    On Fri, 16 Jan 2004 13:06:22 -0500, Randy Webb
    <> wrote:


    >Its not even that difficult. I can close the original page (In certain
    >browsers), without opening a second window at all.


    Yeah, but that's not really being anti-social

    screen.bufferDepth=2

    now that's anti-social.

    Jim.
    --
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Jim Ley, Jan 16, 2004
    #7
  8. (Jim Ley) writes:
    > screen.bufferDepth=2
    > now that's anti-social.


    Damn.

    That's horrible.

    Somebody should have each bone in their hands broken with
    a hammer for specifying that.

    (but did you mean 1? msdn seems to say that 2 is equivalent to -1,
    and testing on IE6 verifies this)

    --
    Chris Jeris Apply (1 6 2 4)(3 7) to domain to reply.
     
    Christopher Jeris, Jan 16, 2004
    #8
  9. olga p.

    Randy Webb Guest

    Jim Ley wrote:

    > On Fri, 16 Jan 2004 13:06:22 -0500, Randy Webb
    > <> wrote:
    >
    >
    >
    >>Its not even that difficult. I can close the original page (In certain
    >>browsers), without opening a second window at all.

    >
    >
    > Yeah, but that's not really being anti-social
    >
    > screen.bufferDepth=2
    >
    > now that's anti-social.


    <g> aint it though?

    --
    Randy
     
    Randy Webb, Jan 17, 2004
    #9
  10. olga p.

    rf Guest

    "Jim Ley" <> wrote in message
    news:...
    > On Fri, 16 Jan 2004 13:06:22 -0500, Randy Webb
    > <> wrote:
    >
    >
    > >Its not even that difficult. I can close the original page (In certain
    > >browsers), without opening a second window at all.

    >
    > Yeah, but that's not really being anti-social
    >
    > screen.bufferDepth=2
    >
    > now that's anti-social.


    Stick it in your onUnload. Then the next site gets blamed :)

    Cheers
    Richard
     
    rf, Jan 17, 2004
    #10
  11. olga p.

    Jim Ley Guest

    On Fri, 16 Jan 2004 18:39:15 GMT, (Jim Ley) wrote:

    >On Fri, 16 Jan 2004 13:06:22 -0500, Randy Webb
    ><> wrote:
    >
    >
    >>Its not even that difficult. I can close the original page (In certain
    >>browsers), without opening a second window at all.

    >
    >Yeah, but that's not really being anti-social
    >
    >screen.bufferDepth=2


    Oops sorry, it looks like 2 isn't supported (no idea why) go for 1
    instead.

    Jim.
    --
    comp.lang.javascript FAQ - http://jibbering.com/faq/
     
    Jim Ley, Jan 17, 2004
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Denon
    Replies:
    1
    Views:
    605
    Saravana [MVP]
    Nov 14, 2003
  2. Replies:
    6
    Views:
    8,938
    sateeshranga
    Aug 7, 2008
  3. Iñaki Baz Castillo
    Replies:
    7
    Views:
    950
    Iñaki Baz Castillo
    Jan 12, 2010
  4. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    426
    Gérard Talbot
    Sep 2, 2005
  5. Replies:
    0
    Views:
    548
Loading...

Share This Page