Open Bug 1484471 Opened 5 years ago Updated 1 month ago

Clicking PDF Viewer 'Current View' button does not work for PDFs accessed from local file (cannot link to file: protocol from the unprivileged `resource` PDF viewer page)


(Firefox :: PDF Viewer, defect, P3)




Tracking Status
firefox-esr91 --- wontfix
firefox96 --- wontfix
firefox97 --- wontfix
firefox98 --- fix-optional


(Reporter: idmfoundinhim, Unassigned)




(Keywords: regression, Whiteboard: [pdfjs-ux])


(4 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Build ID: 20180818100051

Steps to reproduce:

1.) Open a local PDF (must be stored on your computer) file in Firefox PDF viewer
There are then 3 issues, designated by a, b, and c:
2a.) Primary-click (Left-click) Current View button

2b.) Secondary-click (Right-click) Current View button
3b.) Click 'Open in New Tab'

2c.) Secondary-click Current View button
3c.) Click 'Open in New Window

I only put these in one bug because I suspect that there is an issue with the link that could fix all three buttons at a time.  If this is disproven, feel free to split up the issue.

Actual results:

a.) The button appears clicked until you click somewhere else, but nothing significant happens.

b.) A blank page appears in a new tab with a modified link to the PDF in the address bar.

c.) A new window appears showing about:blank.

Expected results:

a.) The link in the current tab changes to target the specific location in the PDF.

b.) A new tab appears showing the same location in the PDF as the original tab.

c.) A new window appears showing the same location in the PDF as the original window.
I'm unable to reproduce. Does this happen on a specific PDF or all PDFs?
Flags: needinfo?(ifihpublic)
Good catch. This bug only shows up when the open PDF is local (that is, stored on your computer).  It does work on all *local* PDFs, though.

Re-reproduced on Firefox Nightly 64.0a1 (2018-09-30) (64-bit)
Flags: needinfo?(ifihpublic)
Version: 63 Branch → Trunk
Attached image RegRange1484471.png
Regression Range

B: 2015-08-08
G: 2015-08-07

Issue with 2015-08-08: Attempting to open PDF would attempt to download it. I could not use the 'open file' option b/c it would open in my system nightly rather than mozregression nightly. Somehow I managed to circumvent this and find that the bug was present.

To open the PDF, I had to open a non-multiprocess window and open it in that window. The original window would only display a blank page.
This screenshot shows the build info for the skipped build. It seems to me that the way (local?) PDFs were handled was changed on 2015-08-08. In that build, opening the local PDF prompted behavior that typically happens when downloading a PDF. Then, this change was either reverted or revised. This was probably when the bug was introduced. I will try to narrow the range further if possible.
Flags: needinfo?(ifihpublic)
The 2015-08-08 build on mozilla-central does have the bug. Comment 3 was updated.
Has Regression Range: --- → yes
Flags: needinfo?(ifihpublic)
Priority: -- → P3
Whiteboard: [pdfjs-c-ux]

confirming: The bug still exists with Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:100.0) Gecko/20100101 Firefox/100.0

:gijs, about (b) and (c) would you have any idea on what's wrong ?

Flags: needinfo?(gijskruitbosch+bugs)

If I had to guess, security checks mean that resource://pdfjs/ cannot link to file:///blah.

But I cannot test this because I have no idea what the "current view" button is that this bug report mentions. I don't see a button with that tooltip in my pdf.js.

Flags: needinfo?(gijskruitbosch+bugs) → needinfo?(cdenizet)

Oh, I eventually figured it out. But my guess was correct:

Security Error: Content at resource://pdf.js/web/viewer.html may not load or link to file:///some/path/to/some.pdf#page=1&zoom=auto,-146,842.
OS: Unspecified → All
Hardware: Unspecified → Desktop
Summary: PDF Viewer 'Current View' button does not work → Clicking PDF Viewer 'Current View' button does not work for PDFs accessed from local file (cannot link to file: protocol from the unprivileged `resource` PDF viewer page)
Regressed by: 1184387
Attached image image.png

The Current View button is the fourth (from the left).

Flags: needinfo?(cdenizet)

Set release status flags based on info from the regressing bug 1184387

Whiteboard: [pdfjs-c-ux] → [pdfjs-ux]
Severity: normal → S3
Attached file 2022-11-30.mp4

This is still happening with the new PDF viewer. However, it does load after a refresh.

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