Not rendering online PDFs in <embed> and <object> tags
Categories
(Firefox :: PDF Viewer, defect)
Tracking
()
People
(Reporter: kb, Assigned: nika, NeedInfo)
References
(Regressed 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(8 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0
Steps to reproduce:
I’ve noticed that Firefox Nightly 136.0a1 no longer renders PDFs when hosted online. My online banking PDFs stopped showing up since 3-4 weeks, which led me to investigate.
I created a minimal test case here: https://a0a6.com/pdf-debug/
Actual results:
Running the example locally by file, both the <embed> and <object> tags work fine, but when hosted on a web server (calling my URL from above), neither works in Nightly.
Expected results:
However, in regular Firefox 134, both methods work as expected, both online and offline.
Updated•1 month ago
|
Comment 1•1 month ago
|
||
Moved to the PDF Viewer
component to be triaged.
Klaus, thanks for the report. I was unable to reproduce this in nightly 136.0a1. The PDF renders correctly for me.
If you are willing to try, you could use mozregression to narrow down which recent change introduced this
https://mozilla.github.io/mozregression/quickstart.html
Comment 2•1 month ago
|
||
Comment 3•1 month ago
|
||
Did you disable PDF.js by any chance? (the pdfjs.disabled pref in about:config)
(In reply to Marco Castelluccio [:marco] from comment #3)
Did you disable PDF.js by any chance? (the pdfjs.disabled pref in about:config)
pdfjs.disabled is false. ( I usually do not tinker around in those settings as I prefer vanilla :) )
(In reply to Donal Meehan [:dmeehan] from comment #1)
Moved to the
PDF Viewer
component to be triaged.Klaus, thanks for the report. I was unable to reproduce this in nightly 136.0a1. The PDF renders correctly for me.
If you are willing to try, you could use mozregression to narrow down which recent change introduced this
https://mozilla.github.io/mozregression/quickstart.html
When I use the latest build without my profile, it works. When I use it with my profile, I still have the same issue of not rendering.
So I removed my profile ( I have a backup) and created a new one. Now everything works (again). I just found it suspicious that it broke on two different computers at the same time. Let me know if I should try something out on my other one.
Comment 8•1 month ago
|
||
Are using sync between these two profiles? Or have the same extensions? Would you mind attaching your about:support information?
Reporter | ||
Comment 10•20 days ago
|
||
The bug came again. 136.0a1 (2025-02-02) (aarch64)
Reporter | ||
Comment 11•19 days ago
|
||
deleted the profile, pdfs are displayed.
Immediatly after syncing my bookmarks and everything via mozilla account, the issue is back again.
Comment 12•19 days ago
|
||
Maybe there's some pref in your profile that is causing this.
Comment 13•19 days ago
|
||
Hello! Thank you for submitting this issue I have tried to reproduce the issue on my end but unfortunately I wasn't able to with firefox 136.0a1(2025-02-03) on Ubuntu 22.04
Could you please answer the following questions in order to further investigate this issue?
- Does this issue happen with a new profile? Here is a link on how to create one: https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles
- Does this issue happen in the latest nightly? Here is a link from where you can download it: https://www.mozilla.org/en-US/firefox/channel/desktop/
- Do you have any addons installed? If yes could you please list them?
Reporter | ||
Comment 14•19 days ago
|
||
(In reply to Marco Castelluccio [:marco] from comment #12)
Maybe there's some pref in your profile that is causing this.
I had created a new profile previously. I now create a new profile without deleting the old one (including the profile.ini). Lets see, what happens..
Reporter | ||
Comment 15•19 days ago
|
||
(In reply to Negritas Sergiu, Desktop QA from comment #13)
Hello! Thank you for submitting this issue I have tried to reproduce the issue on my end but unfortunately I wasn't able to with firefox 136.0a1(2025-02-03) on Ubuntu 22.04
Could you please answer the following questions in order to further investigate this issue?
- Does this issue happen with a new profile? Here is a link on how to create one: https://support.mozilla.org/en-US/kb/profile-manager-create-remove-switch-firefox-profiles
- Does this issue happen in the latest nightly? Here is a link from where you can download it: https://www.mozilla.org/en-US/firefox/channel/desktop/
- Do you have any addons installed? If yes could you please list them?
- I have deleted my profile completly on one of the computers (including the profile.ini). Now I am trying with a new profile without deleting the old one.
- yes.
- My Extensions:
1Password – Passwort-Manager extension 8.10.58.41 true {d634138d-c276-4fc8-924b-40a0ea21d284}
Add-ons Search Detection extension 2.0.0 true addons-search-detection@mozilla.com
Facebook Container extension 2.3.11 true @contain-facebook
Firefox Multi-Account Containers extension 8.2.0 true @testpilot-containers
Google Analytics Debugger extension 2.8.2 true {ca6be013-d122-41e1-a41e-98092dfff1e3}
Grammarly: AI Writing and Grammar Checker App extension 8.927.0 true 87677a2c52b84ad3a151a4a72f5bd3c4@jetpack
LetyShops — Cashback Service extension 5.0.3 true cashback_letyshops@LetyShops
Open bookmark in Container Tab menu item extension 1.3 true bookmark-menu-container@robwu.nl
Temporary Containers extension 1.9.2 true {c607c8df-14a7-4f28-894f-29e8722976af}
To Google Translate extension 4.2.0 true jid1-93WyvpgvxzGATw@jetpack
Wappalyzer - Technology profiler extension 6.10.77 true wappalyzer@crunchlabz.com
Dunkel theme 1.3.2 true firefox-compact-dark@mozilla.org
uBlock Origin extension 1.62.0 false uBlock0@raymondhill.net
Firefox Alpenglow theme 1.5 false firefox-alpenglow@mozilla.org
Hell theme 1.3 false firefox-compact-light@mozilla.org
System-Theme – automatisch theme 1.4.1 false default-theme@mozilla.org
Comment 16•17 days ago
|
||
Comment 17•17 days ago
|
||
Comment 18•17 days ago
|
||
I can confirm this issue and we are now getting multiple reports that corroborate this, see https://github.com/paperless-ngx/paperless-ngx/discussions/9022#discussioncomment-12071021
Here you can see the issue being re-created using the link posted by Klaus above, tested using BrowserStack:
https://bugzilla.mozilla.org/attachment.cgi?id=9464097
vs
https://bugzilla.mozilla.org/attachment.cgi?id=9464098
Comment 19•17 days ago
|
||
Comment 20•17 days ago
|
||
Comment 21•17 days ago
|
||
:Klaus, what's the default pdf handler you set in your settings (in the hamburger menu (top right button), then Settings
, then section Files and Applications
) ?
Comment 22•17 days ago
|
||
Getting this on a new Firefox profile with Arch linux after upgrading to Firefox 135.0. Firefox 134.0.2 works fine.
I see "NS_ERROR_WONT_HANDLE_CONTENT" in the transferred column on the network tab.
Comment 23•17 days ago
|
||
:bytesized, were there any changes on your side about the pdf handler which could explain this behavior ?
Comment 25•17 days ago
|
||
:bytesized, where is the pdf handler value stored ? I'm not able to find it in about:config
.
If it's outside Firefox, would it be possible that it has been reset to another value by the OS or something else ?
Comment 26•17 days ago
|
||
I'm not sure what you mean by "the pdf handler value". Could you elaborate?
Reporter | ||
Comment 27•17 days ago
|
||
(In reply to Calixte Denizet (:calixte) from comment #21)
:Klaus, what's the default pdf handler you set in your settings (in the hamburger menu (top right button), then
Settings
, then sectionFiles and Applications
) ?
OH. This is the issue!
If I make it "save file," it will not display the pdf on the example website.
If I "display in nightly," it will show the pdf on the example websites.
Comment 28•16 days ago
|
||
:bytesized, I meant the name of the pdf handler or whatever stuff used to open it in case of downloading a pdf, sorry about the confusion (I hope I'm more clear, else ping me on slack or element).
Comment 29•16 days ago
|
||
Part of why I'm struggling here is that I can think of two different things you could be referring to: The setting that controls what Firefox does when it opens a PDF, and the setting that the operating system uses to control what the operating system does with a PDF when the user requests one be opened.
The former is stored somewhere in Firefox. That's not really my team's wheelhouse, but glancing through the code, it looks like it's being stored in a JSON file in the profile directory.
The latter is stored somewhere in the operating system. I'm not sure exactly where and I'm sure it varies from OS to OS.
Comment 30•10 days ago
|
||
Hey all, the new firefox update hit me and now I am also experiencing this exact issue on two windows devices (one firefox and one librewolf).
User agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:135.0) Gecko/20100101 Firefox/135.0
I can confirm the embed issue is fixed when PDFs are set to Open in Firefox.
When set to any other option (Always ask, Save file, Use Windows default application, Use other...) the embed issue comes back.
I can confirm this issue happened as soon as I restarted the browser to update to v135.0 (firefox) and v135.0-1 (librewolf).
Comment 31•10 days ago
|
||
The workaround I use for now is setting "Open In FIrefox" for PDFs under the Applications section in the preferences, then in about:config
, set browser.download.force_save_internally_handled_attachments
to true
. This lets me view embedded pdfs and gives me my download popup window back when clicking pdf links. I suppose this won't work for you if you preferred the "Always Ask" dialog, which gives more options.
Updated•10 days ago
|
Comment 32•3 days ago
|
||
In running mozregression, I got this pushlog:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=d4ec9196086de2d1cc004539c31231d486898444&tochange=d982fe6e55c8b6703bef92cd9ab1bc24a84800d8
So I'd say it's because of:
https://bugzilla.mozilla.org/show_bug.cgi?id=1918167
:nika, could you have a look please ?
Assignee | ||
Comment 33•3 days ago
|
||
It appears that my changes revealed an old bug in the stream converter logic for pdf.js. Specifically, the pdf.js converter logic would fail in the case where we load a pdf.js file in an object/embed element if it is happening in the parent process. This would be interpreted as an error, so we wouldn't process-switch, and then because we always succeeded in the content process, we'd render it inline in the content process.
My change made it more consistent between the two processes how we want to handle the network request, meaning that we now fail to load across the board in that case.
The easiest fix here is probably to add a check in PdfStreamConverter.sys.mjs
to always allow the stream converter to run for object/embed loads.
Assignee | ||
Comment 34•3 days ago
|
||
Before the regressing change, we were accidentally enabling pdf.js for
object/embed loads due to the parent process thinking the load has
failed, and the content process coming to a different conclusion.
This check ensures that we always enable pdf.js within object/embed
elements so that the pdfs are rendered as expected.
This does not impact pdfs loaded in other places which could otherwise
be handled externally, such as in iframes.
Updated•3 days ago
|
Updated•3 days ago
|
Updated•3 days ago
|
Comment 36•3 days ago
|
||
Set release status flags based on info from the regressing bug 1918167
Updated•3 days ago
|
Comment 38•3 days ago
|
||
Tracking for the releases in flight. This bug should have a priority and severity set.
Comment 39•3 days ago
|
||
Given the number of duplicates in the relatively short timeframe, it seems frequent enough to warrant S2.
Updated•2 days ago
|
Comment 40•2 days ago
|
||
Comment 41•2 days ago
|
||
bugherder |
Comment 42•1 day ago
|
||
:nike could you add an uplift request on this when you have a moment? We could include it in 136.0 RC1 depending on the risk
Description
•