Closed Bug 1603749 Opened 5 years ago Closed 5 years ago

Preview PDF in Firefox opens new window, splits local URL across 2 tabs

Categories

(Firefox :: File Handling, defect)

71 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1601905

People

(Reporter: rassawyer, Unassigned)

Details

Attachments

(5 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:71.0) Gecko/20100101 Firefox/71.0

Steps to reproduce:

Tried to preview a PDF in Firefox.

Actual results:

INstead of opening PDF in a new tab, as it used to do, Firefox opens a new window with two tab. The first tab has a URL of "file:///C:/Users/$User" second tab has URL of "name/AppData/Local/Temp/$file_name.pdf".

Expected results:

It should have opened a new tab with the URL of "file:///C:/Users/$Username/AppData/Local/Temp/$file_name.pdf".

I couldn't manage to reproduce the issue. Every time I preview a PDF in Firefox a new tab is opened with the correct URL.
Could you please provide steps how you preview a PDF in Firefox maybe you are using another method?
Thanks.

Flags: needinfo?(rassawyer)

visiting this url [https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=12&ved=2ahUKEwiVprD2lb3mAhWldN8KHZbwCUcQFjALegQIBRAI&url=http%3A%2F%2Fwww.pdf995.com%2Fsamples%2Fpdf.pdf&usg=AOvVaw3HFvAQ7GNf5QjsUo05ot-j] opens a miniature window, with a title bar that reads "Opening pdf.pdf" What should Firefox do with this file". Drop down menu has options for "open with TWINUI (default)" or "other". I select other, and then in the window that opens, I select Firefox. Then click "OK". At that point, it opens a new window for Firefox, with two tabs in it. each tab has a part of the url. In this specific example, the first tab has a URL of "file:///C:/Users/Cory", and the second tab starts with a URL of "myers/AppData/Local/Temp/pdf-3.pdf". (Username in this case is "Cory Myers".) The second tab eventually resolves to "http://www.myers.com/AppData/Local/Temp/pdf-3.pdf", which then returns "Hmmm, we're having trouble finding that site."

Flags: needinfo?(rassawyer)
Attached image file_1.png
Attached image file_2.png
Attached image file_3.png
Attached image file_4.png
Attached image PC_Info.png

Problem still exists. I have tried refreshing Firefox, and uninstalling and reinstalling. Even opening PDFs in a third party app (Officesuite) does not work. At this point I am forced to use Windows Edge in order to open PDFs.

Further research shows that problem is related to usernames/userfolders with two names. E.G., username of "Robert Sawyer" causes issues, username of "Sawyer" works fine.

Thank you for the additional sleuthing.

I'm not sure if this is a PDF, file handling, or URL parsing issue, and following up with those groups.

Also to confirm, you're saving the PDF to disk and not directly opening the URL http://www.pdf995.com/samples/pdf.pdf in Firefox?

Flags: needinfo?(rassawyer)

no, I am trying to open the PDFs with the preview in Firefox option. The end objective is to print the PDF off, as the PDFs that I am working with on a daily basis are receipts generated by web based software.

Flags: needinfo?(rassawyer)

If you go to the Firefox options (tools > options, or click the menu button on the far right of the toolbar, then click "Options"), then search for PDF, then in the list that shows up, find the PDF entry, and in the dropdown to its right select "Preview in Firefox", not "Use Firefox (default)" or "other" or anything like that -- that should fix things so opening http://www.pdf995.com/samples/pdf.pdf directly opens in Firefox's built-in PDF viewer.

There are a collection of relevant bugs here:

  • bug 1122340 for an obvious "preview this file in Firefox" option in the "open with" dialog (ie the dialog in attachment 9116487 [details]) for compatible filetypes;
  • bug 1581383 for the fact that there are multiple options displayed in the Options list
  • bug 215554 for infinite loops of tabs opening if you manage to change the default option to "open with external app" set to Firefox

The first seems most relevant here.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE

Not a duplicate. Not even related to those bugs. I've been over the options in Firefox options, and have used "preview in Firefox". That was what it was set to when this originally started happening. That does not resolve this issue. Did you bother to read any of the bug info provided?

It is perhaps relevant that to due a restriction imposed by the website providing the pdf, I have to download the pdf to view it. Which results in clicking a download button, which even with set to "always open with" "preview in Firefox" I still have to click ok to open it with Firefox.

(In reply to rassawyer from comment #14)

Did you bother to read any of the bug info provided?

Let's assume good faith, OK? Yes, I read the comments.

(In reply to rassawyer from comment #15)

It is perhaps relevant that to due a restriction imposed by the website providing the pdf, I have to download the pdf to view it. Which results in clicking a download button, which even with set to "always open with" "preview in Firefox" I still have to click ok to open it with Firefox.

That's very relevant. If you set it to "Preview in Firefox" in the options, and open http://www.pdf995.com/samples/pdf.pdf , presumably that PDF opens correctly (ie just opens in a tab without asking any questions), but the ones you're actually wanting to work with still show the same dialog, right?

Can you provide more details on these PDFs ? Either steps to see the same issue, or details of what website / tool is generating them, or header information from the network monitor that shows what headers the site is sending for this PDF file?

It's likely that the website you're working with sets Content-Disposition: attachment, which is why the dialog comes up (either that or it sends a bogus mimetype) even when the action you've selected for PDF files is "Preview in Firefox". This might be bug 453455; opening/previewing without asking questions doesn't work for things with content-disposition: attachment - this is a safety mechanism because previewing files may not enable you to save copies, leading to dataloss if we do not save the copy for you, so we err on the side of caution. I don't know how our PDF viewer's "save a copy" button works and if it re-requests data or not; if it doesn't, I guess in theory we could try to add a special case for these files.

If, in the dialog, opening with any external helper application (Firefox or otherwise) never works, it's possible you're hitting bug 1601905 - but that's supposed to be fixed on 72.0.2 . What Firefox version are you using at this point?

Flags: needinfo?(rassawyer)

Not on my work system, so I can't test everything mentioned above, but doing some inspection reveals this in regard to the PDF in question.
code:
<img id="pdfPage1" class="pdf-image" ng-src="data:image/png;base64...
src="data:image/png;base64...

I suspect this is significant. I will try to provide as much data as I can, but I do have and NDA that I have to respect. The full attribute value is 104899 characters long. In case this was not clear, this bug report was prompted by a change in behaviour. The expected behaviour was that clicking the download button would open a pane with option to open with a variety of programs, or to save the file. Selecting the program option of "Firefox" would open a new tab and load the PDF. Technically speaking, the file is downloaded to a temporary directory, then opened from there as a local file. Something recently caused a change in behaviour to such that selecting to open in Firefox opens a new instance of Firefox, (as opposed to just a new tab as prior) and attempts to open the file. However, due (I presume) to an issue parsing the file location URL, Firefox would open one tab with the first half of the file location, up to the space in the username, and a second tab with a the remainder, from the space in the username to the end of the file URL. As mentioned previously, I have tried refreshing, and even completely deleting and reinstalling Firefox with no change in results. I have not had time to research how to downgrade the version I am running to ascertain in which version these changes were introduced.

Flags: needinfo?(rassawyer)

I will endeavour to confirm this on my other machine on Monday when I return to work, but on my personal machine, Firefox version 71.0 has teh issue of opening a new window; version 72.0.2 does not.

On my personal machine, the problem seems to exist only on versions 71.x. Tested on 70.0, and 70.0b9, with no issue, as well as on 72.0 with no issue. Also, the date of the version 71.0 update correlates to when the problem began (mid December).

(In reply to rassawyer from comment #18)

I will endeavour to confirm this on my other machine on Monday when I return to work, but on my personal machine, Firefox version 71.0 has teh issue of opening a new window; version 72.0.2 does not.

OK, so that sounds like maybe this is a dupe of bug 1601905 then - it would be great if you could confirm whether this is addressed on your work machine on 72.0.2 or not. Thank you!

Flags: needinfo?(rassawyer)

(In reply to :Gijs (he/him) from comment #20)

OK, so that sounds like maybe this is a dupe of bug 1601905 then - it would be great if you could confirm whether this is addressed on your work machine on 72.0.2 or not. Thank you!

Confirmed: 72.0.2 works correctly. Reading the comments on bug 1601905 does indeed sound like it was the same issue, making this a duplicate. Thank you!

Flags: needinfo?(rassawyer)

Alright, I'll update the metadata. Thanks for getting back to us!

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

Attachment

General

Creator:
Created:
Updated:
Size: