Open
Bug 1133062
Opened 10 years ago
Updated 3 years ago
Issue when loading a PDF file into an already opened window using an external PDF viewer
Categories
(Firefox :: File Handling, defect)
Tracking
()
NEW
People
(Reporter: cito, Unassigned)
Details
Attachments
(1 file, 1 obsolete file)
576 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0
Build ID: 20150122214805
Steps to reproduce:
I'm using Firefox 35.0.1 on Win 7 64 bit, configured to load PDF files with an external PDF viewer.
Load the attached test.html file. It has two links that open a PDF file in a window created with window.open(), in two different manners.
The first link ("onestep") loads the PDF file directly in the window.open() command.
The second link ("twostep") first opens an empty window with window.open() and then loads the PDF into that window by setting the location property of the window.
Actual results:
In the first case ("onestep"), an empty browser window opens, but then immediately closes again and the PDF is loaded in another window of the external PDF viewer.
In the second case ("twostep"), the empty browser window opens, the PDF is loaded in another window of the external PDF viewer, just like in the first case. However, the empty window does not close automatically like in the first case.
Expected results:
I would expect that the two ways of loading the PDF would behave the same, i.e. that the empty window either always closes automatically or always stays open. Automatically closing the window is the preferred behavior, however.
Why am I making an issue out of this? Well, sometimes you need to open PDFs in two steps, because you need to perform some server-side task and wait for it to happen before opening the PDF file. This can only be done asynchronously and not in the click event function of the "show PDF" button. On the other hand, you must open the window already in the click event, because otherwise the popup blocker will hit you. So if you use this two-step trick, and the browser has been configured to use an external PDF viewer, an empty browser window stays open which is irritating to the user. It's also not possible to close the window programmatically via JavaScript since it's not possible to find out when the PDF file has been fully loaded, and if you close the browser window too early, then the PDF viewer will also close. The load or unload Events work only when the PDF is loaded inline into the browser window, not when the PDF is shown in an external viewer.
![]() |
||
Updated•10 years ago
|
Summary: Issue when loading a PDF file into an already opened window → Issue when loading a PDF file into an already opened window using an external PDF viewer
Comment 1•10 years ago
|
||
Hi Christoph,
I have tested your issue on latest Firefox release (43.0.3) and latest Nightly (46.0a1) and now the behavior from "twostep" occurs for both links. The blank window remains opened and the file is loaded in a new window of the external PDF viewer. So now it meets your expected behavior.
Can you please confirm this by testing with the latest Firefox release (43.0.3) or latest Nightly (46.0a1)? If the behavior on your end is satisfying too, we will update this issue as resolved.
Thanks,
Cosmin.
Flags: needinfo?(cito)
Reporter | ||
Comment 2•10 years ago
|
||
Hi Cosmin, thanks for looking into this.
I have tested with 43.0.3, 45.0a2 and 46.0a1 (Nightly). I can confirm that the behavior changed in 46.0a1; the window now stays open in the first case as well. The behavior is still the same for the older versions.
The consistent behavior is an improvement, but I think it would be even better if the window automatically closes in both cases, since an empty windows can irritate users and it is difficult or impossible to find out whether and when to close the window via JavaScript (see the description of the problem above).
Flags: needinfo?(cito)
Comment 3•9 years ago
|
||
Firefox: 46.0.1, Build ID: 20160502172042
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
I have retested this issue on the latest Firefox release (46.0.1) and latest Nightly (49.0a1 - Build ID: 20160526082509) build.
In the release version of Firefox, clicking the first link "onestep" opens a new blank window, downloads the PDF and the file is loaded in a new window of the external PDF viewer, but previously opened blank window automatically closes. When clicking the second link "twostep" opens a new blank window, downloads the PDF and the file is loaded in a new window of the external PDF viewer, but previously opened blank window is not automatically closed.
In the Nightly version, both links "onestep" and "twostep", have the same behavior:
a new blank window is open, the PDF is downloaded and the file is loaded in a new window of the external PDF viewer, but previously opened blank window is not automatically closed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Reporter | ||
Comment 4•4 years ago
|
||
The PDF in the old test page was not available any more, now using a different one.
Attachment #8564345 -
Attachment is obsolete: true
Reporter | ||
Comment 5•4 years ago
|
||
I have retested this with the latest Firefox release (88.0.1) and the latest Nightly (90.0a1), and with both of them, the behavior is still (or again) the same as it was 6 years ago when I opened this issue.
If you want to verify: Open the test.html page (I have uploaded a new version with a valid PDF link), and click on the "onestep" and "twostep" links. In the first case, the opened window closes, in the second case it stays open (it may be hidden behind the browser window, so check carefully).
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•