Mark
asked on
Prevent Firefox page from going to the background when clicking a spreadsheet link
I have the html code shown below. In Firefox, when I click the link to open the spreadsheet, it puts the current window (having the link) into the background. This is quite inconvenient as the user must click on the Firefox icon(s) in the taskbar to find their page when done with the spreadsheet. IE does not send the page to the background.
Note that this page is opened using
<span onclick="w=window.self;w1= window.ope n('tmp/myS preadsheet .csv','_bl ank');w.fo cus()">cli ck me</span>
but that ended up bringing into focus some apparently random page in the tab-list.
Is there a way to prevent this page from disappearing into the background when the spreadsheet link is clicked?
Note that this page is opened using
window.open('thisProgram.jsp','_blank','scrollbars=1,resizable=1,width=700,height=400,top=0')
and does not have a tab among the other Firefox tabs. Therefore, the user doesn't even have a tab to click on to get their page back to the foreground (nor is there a tab in IE).<div>
<a href="tmp/calcFAS701.csv" target="_blank">
<img alt="" style="vertical-align: middle; border:0" width="16" src="images/Excel.jpg">
get spreadsheet</a>
</div>
Instead of the above, I tried:<span onclick="w=window.self;w1=
but that ended up bringing into focus some apparently random page in the tab-list.
Is there a way to prevent this page from disappearing into the background when the spreadsheet link is clicked?
ASKER
You may be right on the top=0 thing, but that's not where I'm having the issue. The page containing the link does display, even if the 'top' parameter is wrong. It's the behavior when the spreadsheet link on that page is clicked.
So, maybe a bit of clarification ... I have a page we'll call "daddy". "daddy" contains a window.open() function (which has the 'top' parameter).
When the user clicks the button on "daddy" to trigger the window.open(), a new window, let's call it "boy" is opened. On "boy" is a link referencing a spreadsheet. When the user click the spreadsheet link on "boy" yet another new window opens which has the spreadsheet.
This all works as expected except when the spreadsheet link is clicked, "boy" disappears into the background. That's the problem I'm trying to solve, not the relative placement of "boy" via the 'top' parameter.
So, maybe a bit of clarification ... I have a page we'll call "daddy". "daddy" contains a window.open() function (which has the 'top' parameter).
When the user clicks the button on "daddy" to trigger the window.open(), a new window, let's call it "boy" is opened. On "boy" is a link referencing a spreadsheet. When the user click the spreadsheet link on "boy" yet another new window opens which has the spreadsheet.
This all works as expected except when the spreadsheet link is clicked, "boy" disappears into the background. That's the problem I'm trying to solve, not the relative placement of "boy" via the 'top' parameter.
A pop-up in a pop-up? You need to show us a demo that displays the problem.
I've put up a quick and simple demo of what I think you're trying to do here: http://www.yamiam.net/yamiam/JSNewWin/JSNewWindowOne.html
I think the issue here is that you're comparing IE behavior to Firefox behavior when clicking a link to open a spreadsheet. The first problem is that you cannot compare IE behavior to any other browser as IE lives on and in another complete realm of reasoning.
Is IE actually opening the spreadsheet in a browser window or tab? Since IE and Excel are both Microsoft applications as is likely the Windows operating system, it is not unexpected that IE could open the spreadsheet in a browser window. Firefox, on the other hand, is not a Microsoft product and must hand off the spreadsheet to the appropriate application for viewing it, more than likely Excel, which would take the focus of the operating system away from Firefox. Does this accurately describe the situation you're encountering?
Is IE actually opening the spreadsheet in a browser window or tab? Since IE and Excel are both Microsoft applications as is likely the Windows operating system, it is not unexpected that IE could open the spreadsheet in a browser window. Firefox, on the other hand, is not a Microsoft product and must hand off the spreadsheet to the appropriate application for viewing it, more than likely Excel, which would take the focus of the operating system away from Firefox. Does this accurately describe the situation you're encountering?
ASKER
Kim Walker: Both IE and Firefox open the spreadsheets in Excel. The difference is that with Firefox, the page containing the spreadsheet link disappears into the background while that does not happen with IE. Even though IE sucks in many ways, it does have the desired behavior in this case. Check out Dave Baldwin's demo.
Dave Baldwin: Yes, your demo exactly shows the problem. Your "JS New Windows 2" disappears into the background when the spreadsheet link on that page is clicked. To get back to it I have to hunt for it in my taskbar. You'll also notice that no tab is created for it in the tablist of other FireFox pages. If you try your demo with IE, it works as expected. The spreadsheet is opened and the "JS New Windows 2" remains visible.
Dave Baldwin: Yes, your demo exactly shows the problem. Your "JS New Windows 2" disappears into the background when the spreadsheet link on that page is clicked. To get back to it I have to hunt for it in my taskbar. You'll also notice that no tab is created for it in the tablist of other FireFox pages. If you try your demo with IE, it works as expected. The spreadsheet is opened and the "JS New Windows 2" remains visible.
ASKER
That's interesting. So, it's doable with Firefox. Perhaps a setting of some kind? Here's my screenshot with Dave's "Window 2" opened:
And after clicking on the spreadsheet link (I've moved it off to the side to show the Window Two is not underneath):I'm using Firefox 45.0.2. I'll update and see if that makes any difference.
And after clicking on the spreadsheet link (I've moved it off to the side to show the Window Two is not underneath):I'm using Firefox 45.0.2. I'll update and see if that makes any difference.
I have modified my demo page. You can open Page Two in the original small window or you can open it in a full page. When you open it in a full page, it does not disappear. Apparently the minimized pop-up window is the problem. The full page version works in Chrome also.
ASKER
My behavior does not change with Firefox 46.0.1.
dave Baldwin:
So, if you (Dave) and Kim do not show this disappearing window phenomenon in Firefox on WIN7, and I do, then it must have something to do with settings, right? Any idea what settings I could change? Nothing jumps out at me.
dave Baldwin:
Apparently the minimized pop-up window is the problem.Yes, not a problem with full page. However, I need a page as shown in your 1st demo.
So, if you (Dave) and Kim do not show this disappearing window phenomenon in Firefox on WIN7, and I do, then it must have something to do with settings, right? Any idea what settings I could change? Nothing jumps out at me.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Kim Walker: my Firefox settings are the same as yours. Testing with Firefox on Ubuntu does NOT cause the 2nd smaller window to get pushed to the background. This only happens for me with Firefox on WIN7.
So, I guess I just have to live with this, eh? Any other ideas?
So, I guess I just have to live with this, eh? Any other ideas?
It was happening for me in Chrome on both XP and Win 7. Opera 36 seems to work alright though.
Firefox on CentOS 6.7 hides page two when I click on the spreadsheet link. However... if I cancel the spreadsheet download, page two re-appears!
ASKER
OK thanks. Too bad the problem can't be solved on my office workstations :(
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open5