browser opens new windows or tabs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrew Poulos

    browser opens new windows or tabs

    Is there a way for javascript to know if a browser has been set to open
    new windows in tabs? I'm trying to fix some code that allows a user to
    close a window that javascript opened and it seems to get confused what
    window to close when a new tab is opened. (The user clicks a link in the
    opened window which which opens a new window and close the current one.)

    Andrew Poulos
  • SAM

    #2
    Re: browser opens new windows or tabs

    Andrew Poulos a écrit :
    Is there a way for javascript to know if a browser has been set to open
    new windows in tabs? I'm trying to fix some code that allows a user to
    close a window that javascript opened and it seems to get confused what
    window to close when a new tab is opened. (The user clicks a link in the
    opened window which which opens a new window and close the current one.)
    How do you do to close an opener ?
    (supposed to be a main window which is not closable by JS)

    Tabs react exactly as normal windows (in my Fx at least)

    If the popup opened in a tab has a button to close it, it closes this
    tab and you jump back to the tab of its opener.

    --
    sm

    Comment

    • Joost Diepenmaat

      #3
      Re: browser opens new windows or tabs

      SAM <stephanemoriau x.NoAdmin@wanad oo.fr.invalidwr ites:
      Andrew Poulos a écrit :
      >Is there a way for javascript to know if a browser has been set to
      >open new windows in tabs? I'm trying to fix some code that allows a
      >user to close a window that javascript opened and it seems to get
      >confused what window to close when a new tab is opened. (The user
      >clicks a link in the opened window which which opens a new window
      >and close the current one.)
      >
      How do you do to close an opener ?
      (supposed to be a main window which is not closable by JS)
      >
      Tabs react exactly as normal windows (in my Fx at least)
      >
      If the popup opened in a tab has a button to close it, it closes this
      tab and you jump back to the tab of its opener.
      Not to mention that opening unrequested new windows is one of the most
      annoying things you can do. Just don't do it; use plain links and let
      the user sort things out to his/her preference.

      --
      Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

      Comment

      • Andrew Poulos

        #4
        Re: browser opens new windows or tabs

        SAM wrote:
        Andrew Poulos a écrit :
        >Is there a way for javascript to know if a browser has been set to
        >open new windows in tabs? I'm trying to fix some code that allows a
        >user to close a window that javascript opened and it seems to get
        >confused what window to close when a new tab is opened. (The user
        >clicks a link in the opened window which which opens a new window and
        >close the current one.)
        >
        How do you do to close an opener ?
        (supposed to be a main window which is not closable by JS)
        >
        Tabs react exactly as normal windows (in my Fx at least)
        >
        If the popup opened in a tab has a button to close it, it closes this
        tab and you jump back to the tab of its opener.
        >
        I'll check what is happening again but the window that is opened by
        javascript which in turn opens a new window is supposed to close when
        the new window is opened. Instead the new window is closing.

        This is only happening in IE 7 that is set to open windows in tabs.

        Andrew Poulos

        Comment

        • Andrew Poulos

          #5
          Re: browser opens new windows or tabs

          Joost Diepenmaat wrote:
          SAM <stephanemoriau x.NoAdmin@wanad oo.fr.invalidwr ites:
          >
          >Andrew Poulos a écrit :
          >>Is there a way for javascript to know if a browser has been set to
          >>open new windows in tabs? I'm trying to fix some code that allows a
          >>user to close a window that javascript opened and it seems to get
          >>confused what window to close when a new tab is opened. (The user
          >>clicks a link in the opened window which which opens a new window
          >>and close the current one.)
          >How do you do to close an opener ?
          >(supposed to be a main window which is not closable by JS)
          >>
          >Tabs react exactly as normal windows (in my Fx at least)
          >>
          >If the popup opened in a tab has a button to close it, it closes this
          >tab and you jump back to the tab of its opener.
          >
          Not to mention that opening unrequested new windows is one of the most
          annoying things you can do. Just don't do it; use plain links and let
          the user sort things out to his/her preference.
          1. You don't know what I'm coding.
          2. You don't know who I'm coding for
          3. You don't know the window is not requested.
          4. I was not asking for usability advice

          It is typical (so much so that the behaviour is expected) for an LMS to
          automatically launch a SCO in a new window.

          Andrew Poulos

          Comment

          • The Natural Philosopher

            #6
            Re: browser opens new windows or tabs

            Andrew Poulos wrote:
            SAM wrote:
            >Andrew Poulos a écrit :
            >>Is there a way for javascript to know if a browser has been set to
            >>open new windows in tabs? I'm trying to fix some code that allows a
            >>user to close a window that javascript opened and it seems to get
            >>confused what window to close when a new tab is opened. (The user
            >>clicks a link in the opened window which which opens a new window and
            >>close the current one.)
            >>
            >How do you do to close an opener ?
            >(supposed to be a main window which is not closable by JS)
            >>
            >Tabs react exactly as normal windows (in my Fx at least)
            >>
            >If the popup opened in a tab has a button to close it, it closes this
            >tab and you jump back to the tab of its opener.
            >>
            I'll check what is happening again but the window that is opened by
            javascript which in turn opens a new window is supposed to close when
            the new window is opened. Instead the new window is closing.
            >
            This is only happening in IE 7 that is set to open windows in tabs.
            >
            Andrew Poulos
            I am fairly sure I have this working..any chance of sample code of your
            window.open() stuff?

            If you track the object that this returns, you can always close the
            correct window.



            Closing the original window is surely simply a URL jump..or did you mean
            you want to open a NEW briowser window altogthere and close the earlier
            window in a tabbed session?

            Comment

            • SAM

              #7
              Re: browser opens new windows or tabs

              Andrew Poulos a écrit :
              SAM wrote:
              >Andrew Poulos a écrit :
              >>Is there a way for javascript to know if a browser has been set to
              >>open new windows in tabs? I'm trying to fix some code that allows a
              >>user to close a window that javascript opened and it seems to get
              >>confused what window to close when a new tab is opened. (The user
              >>clicks a link in the opened window which which opens a new window and
              >>close the current one.)
              >>
              >How do you do to close an opener ?
              >(supposed to be a main window which is not closable by JS)
              >>
              >Tabs react exactly as normal windows (in my Fx at least)
              >>
              >If the popup opened in a tab has a button to close it, it closes this
              >tab and you jump back to the tab of its opener.
              >>
              I'll check what is happening again but the window that is opened by
              javascript which in turn opens a new window is supposed to close when
              the new window is opened. Instead the new window is closing.
              >
              This is only happening in IE 7 that is set to open windows in tabs.

              I haven't IE and following example works fine in my Fx using tabs :
              (works too in iCab.3 and Opera.9)

              file 'mother.htm' :
              <html>mother :
              <a href="#" onclick="daught er_1=window.ope n('daughter_1.h tm');
              return false;">popup 1</a>
              </html>

              file 'daughter_1.htm ' :
              <html>daughter_ 1 :
              <a href="#"
              onclick="opener .daughter_2=dau ghter_2=window. open('daughter_ 2.htm');
              return false;">popup 2</a>
              </html>

              file 'daughter_2.htm ' :
              <html>
              <body onload="mother= opener.opener;o pener.close();" >
              daughter_2 :
              <a href="#" onclick="mother .daughter_2.clo se();
              return false;">complex self close</a>
              </html>

              the popup 2 on loading closes the popup 1
              closing the popup 2 (using any way) -back to mother

              --
              sm

              Comment

              • Joost Diepenmaat

                #8
                Re: browser opens new windows or tabs

                Andrew Poulos <ap_prog@hotmai l.comwrites:
                1. You don't know what I'm coding.
                Ok.
                2. You don't know who I'm coding for
                Do you? I don't know. I don't even know what you're coding.
                3. You don't know the window is not requested.
                If I don't expect a full-size new window, I don't want it. For one
                thing, my window manager does not size windows like you probably
                expect. It sure as hell doesn't size windows the way you request. And
                full-size windows are easy to request, just use a target.
                4. I was not asking for usability advice
                Feel free to ignore me.
                It is typical (so much so that the behaviour is expected) for an LMS
                to automatically launch a SCO in a new window.
                What's an LMS? What's an SCO (besides that highly suspect Unix vendor)?

                --
                Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

                Comment

                Working...