Last Comment Bug 654892 - New tabs appear in wrong window
: New tabs appear in wrong window
Status: UNCONFIRMED
:
Product: Firefox
Classification: Client Software
Component: Tabbed Browser (show other bugs)
: 8 Branch
: x86 Windows 7
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-05-04 16:59 PDT by WBT
Modified: 2011-11-10 06:57 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
possible testcase (141 bytes, text/html)
2011-05-06 10:44 PDT, Henrik Skupin (:whimboo)
no flags Details

Description WBT 2011-05-04 16:59:12 PDT
Steps to reproduce:
1. Go to a university or somewhere with JSTOR full text access (or VPN in) if you can.
2. Visit http://www.jstor.org/stable/3069399 as one example page.
3. Click View PDF, and indicate acceptance of the terms & conditions.  The PDF will open in a new window.  (in my case, it's with PDF X-Change Viewer.)  FF shows the tab bar with one tab, the toolbars, awesomebar, etc...it's a regular browser window.  
4. Open a new tab in that window.  Go to a page with links.
5. Middle click one of those links, or right click and Open In New Tab.  

Actual results:
6. The new tab will open as the LAST tab in whatever window you used most recently other than the window you're using right now.  That window won't activate the new tab or even scroll to it if you have a lot of tabs open (the right arrow will momentarily glow to indicate new tab opening), but the tab will be there.

Expected results:
7. The new tab opens in the same window as the one hosting the link that was clicked.
Comment 1 WBT 2011-05-04 17:03:46 PDT
Oops, this posted before I finished writing.
It doesn't matter if the original tab is closed, and you only have new, non-PDF tabs open.  There is something about that window that no new tabs will open in it.

Opening a second defective window (by the same procedure) and having the original "defective" window as the most recently used one doesn't cause new tabs to open in it then either; new tabs open in the most recently used non-funky window.
"Funky" or "defective" there mean "opened via the JSTOR View PDF link" but I'm sure there's something else about those windows that is what's causing the bug.

Any ideas on how these windows are not like the others?
Comment 2 Henrik Skupin (:whimboo) 2011-05-05 07:01:39 PDT
Reporter, can you please check how the new window gets opened when clicking on View PDF? Is it done via Javascript? You can select the text and then select view selected code from the context menu. I don't have full access to that site and can't test it on my own. Thanks.
Comment 3 WBT 2011-05-05 13:37:12 PDT
Here is the HTML element, copied from Firebug or View->source:
<a href="/stable/pdfplus/3069399.pdf" id="pdf" target="_blank" class="pdflink">View PDF</a>

so no, it looks like it's not done via Javascript, but the good old-fashioned _blank target. 

I do not observe this bug in 3.6.16; it seems to be a version 4 regression.
Comment 4 Henrik Skupin (:whimboo) 2011-05-06 10:44:54 PDT
Created attachment 530661 [details]
possible testcase

Is it reproducible with this testcase? Can you also please try in a fresh profile with all extensions and plugins disabled?
Comment 5 WBT 2011-05-07 07:04:06 PDT
The testcase opens the doc in a new tab in the same window.
I don't have enough time now to do all the setup etc. for a new profile, maybe later.
Comment 6 Henrik Skupin (:whimboo) 2011-05-13 03:43:04 PDT
WBT, have you had time to check in a fresh profile? Not only the minimized testcase but also with your original URL.
Comment 7 WBT 2011-05-13 10:37:42 PDT
Not yet; I'm still in crunch mode for another week or two.
*sigh...*
Comment 8 Wayne Mery (:wsmwk, NI for questions) 2011-10-04 13:55:56 PDT
(In reply to Henrik Skupin (:whimboo) from comment #6)
> WBT, have you had time to check in a fresh profile? Not only the minimized
> testcase but also with your original URL.

(In reply to WBT from comment #7)
> Not yet; I'm still in crunch mode for another week or two.
> *sigh...*
Comment 9 WBT 2011-11-10 06:57:21 PST
Aha!  After scouring the Internet to try to find a more public example, I have found one, and tested it with the latest release (8.0 as of this morning) in a fresh profile, and reproduced the bug again.
Here are another set of steps to reproduce:

Visit https://enr-apps.as.cmu.edu/open/SOC/SOCServlet?Formname=GET_CLASSES&SUBMIT=Retrieve+Schedule&SEMESTER=S12&GRAD_UNDER=All&MINI=NO&DEPT=EPP

Click on any of the courses listed there.  A new window will open with the course description.  

Optional: click on the "related URL" to get to a more interesting page with more links. 
Middle-click on any link, or right click and Open in New Tab - the new tab opens in the last window that you interacted with before this one.  That may be different than the window which launched the popup.

The latest version of FF will at least set that window as active (even if it's e. g. on another monitor), but it won't activate that tab - so even if you see the second-to-last-interacted-with-window becoming active, it might just be confusing, and it's possible to not see a new tab if you have many open.  ("Why is this other window coming up again?  And why isn't the link opening like I wanted to, in the window I was using?") 

Now that I have it on a public-facing URL with no authentication required, you can give it a try!  Note: That link might expire (stop working) around May 2013.

Note You need to log in before you can comment on or make changes to this bug.