Closed Bug 866634 Opened 11 years ago Closed 4 years ago

PDFs don't load in PDF Viewer - When JavaScript is disabled/turned off completely using javascript.enabled

Categories

(Firefox :: PDF Viewer, defect, P4)

20 Branch
x86
Windows XP
defect

Tracking

()

RESOLVED FIXED
Firefox 77
Tracking Status
firefox77 --- fixed

People

(Reporter: development.spark, Assigned: emilio)

References

Details

(Whiteboard: [pdfjs-c-integration])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:20.0) Gecko/20100101 Firefox/20.0
Build ID: 20130409194949

Steps to reproduce:

Our websites need to work with scripts turned off for those who choose to turn off scripts (accessibility/personal preference etc).

I tried to load a PDF in firefox from our websites (with scripts off)
This is not down to our particular website, even a UK Government website is the same:
https://www.gov.uk/dvlaforms 
(not our site, just shown as an example) - there are PDF links near the bottom of the page (remember to have scripts off)



Actual results:

When javascript is turned off , clicking on any PDF link within firefox 19 and 20, the PDF viewer interface loads but no PDF is loaded.




Expected results:

The PDF should load when scripts are off.

I believe the PDF viewer works using javascript, therefore this might be why the PDF doesn't load when scripts are off. I know users can go into settings to open the PDF in Adobe, but the majority of users won't know to do this so there should be a way that Firefox doesn't use PDF viewer when scripts are turned off (in this case it would load using adobe).
This is related to issues like bug 738627, where font customisations are applied incorrectly to PDF documents as well as web page content.

The fundamental problem is that the PDF Viewer acts like a web page instead of a built-in part of the browser. It should really just do whatever it needs to do, regardless of any content options the user has set.
Component: Untriaged → PDF Viewer
Note that "Enable JavaScript" option itself will be removed by bug 851702. So the majority of users are unlikely to visit the site with JavaScript disabled.
(In reply to Masatoshi Kimura [:emk] from comment #2)
I guess more people disable JavaScript using NoScript. :P
Fortunately, PDF.js is not affected by NoScript :)
NoScript is whitelisting resource:// URLs by default.
Ah, thanks.
Summary: PDFs don't load in PDF Viewer - When Scripts are turned off → PDFs don't load in PDF Viewer - When JavaScript is disabled/turned off completely using javascript.enabled
The native HTML5 video player had its controls removed when JS was turned off (in Firefox itself or via an add-on like NS), but Mozilla fixed this in bug 449358 (and by enabling XBL scopes).

Is it possible to do a similar thing with PDF.js?
Since the preference has been removed, we're going to mark this as low priority.
Priority: -- → P4
Whiteboard: [pdfjs-c-integration]
Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 Firefox/29.0
Reproduced on latest Nightly with javascript.enabled - false, marking as New.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 810815
Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c042c1ea60ab
Exempt pdf.js principal from script policy. r=ckerschb
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 77
QA Whiteboard: [qa-77b-p2]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: