PDF thumbnails not working when privacy.resistFingerprinting enabled
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
People
(Reporter: sr1.mozbugzilla, Unassigned)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(1 file)
(deleted),
image/png
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
- In about:preferences, under Applications, set action for PDF documents to "Open in Firefox".
- Enable privacy.resistFingerprinting.
- Navigate to a URL that returns a PDF document that can be displayed by Firefox. For example, navigate to https://web.pa.msu.edu/people/duxbury/courses/phy480/Cpp_refcard.pdf.
- Firefox may display a 'Allow pdf.js t use your HTML5 canvas image data?' dialog near the address bar. If displayed, ignore the prompt or click on [X] 'Close this message' in top-right corner of the dialog.
- If Sidebar is not visible, click on Toggle Sidebar button to display the sidebar.
Actual results:
Sidebar displays thumbnails of PDF document pages. Each thumbnail is a white rectangle hatched with a different colour. Thumbnails are not actual representations of the PDF pages.
Work-around:
- Allow HTML5 canvas for the specified URL.
- Refresh page.
Expected results:
Each thumbnail in the sidebar should be a faithful representation of the actual PDF document page, regardless of privacy.resistFingerprinting setting.
Firefox internal PDF viewer should not need to ask for canvas permissions.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Firefox::PDF Viewer' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
Yes; we should be able to allow these thumbnails through (I'm assuming that pdf JS can't read DOM data.)
It looks like this was discussed ~5 years ago on tor trac and on the pdf.js github, the conclusion then seems to be giving pdf.js an exemption from the canvas routines. My quick guess is that pdf.js's recent move to being an addon from an extension broke those special privileges and they need to be reinstated.
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Could find a regression range in using mozregression:
https://mozilla.github.io/mozregression/
Comment 5•3 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 6•3 years ago
|
||
While I really cannot claim to understand the following code https://searchfox.org/mozilla-central/rev/489e82dcc1e5afbe691ff3b1c982382914637e38/dom/canvas/CanvasUtils.cpp#82-87, I nonetheless cannot help thinking that the particular file-check used there isn't correct.
Note that the (thumbnail) canvases are not being created in that particular file, and the following search suggests that most call-sites (be it in C++ or JS code) are checking the principal or origin for "resource://pdf.js/web/viewer.html" respectively "resource://pdf.js".
Maybe the code in CanvasUtils.cpp could simply utilize this existing helper: https://searchfox.org/mozilla-central/rev/489e82dcc1e5afbe691ff3b1c982382914637e38/dom/base/nsContentUtils.cpp#6717-6725, unless I'm completely misunderstanding things?
Updated•3 years ago
|
Comment 7•3 years ago
|
||
The severity field is not set for this bug.
:lsalzman, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Description
•