How to disable pdf.js programatically (in HTML/JS)?

Discussion about official Mozilla Firefox builds
TheVisitor
Posts: 5469
Joined: May 13th, 2012, 10:43 am

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by TheVisitor »

phuzi0n wrote:
JayhawksRock wrote:I doubt anyone from Mozilla will see your Rant here.. Why dont you express your great displeasure here > http://support.mozilla.org/en-US/produc ... =inproduct

Is that a joke? The page you linked is basically a beginners FAQ that ironically links back to mozillazine. I know how to submit to mozilla and I know that it most often gets lost in the noise, ignored, or disagreed with. I also know that many devs do read and post on these forums so there is a chance it will be seen. Regardless, things like this usually don't change until after mozilla get major backlash in the media.


He should have been directed to 'Help -> Submit Feedback'

If enough noise is made from dissatisfied users on 19beta's before they ship 19 (mozilla) can always pref it off again before it goes live and continue to polish the feature. Myself, I use Nightly builds exclusively and once it hit I pref'd it off and never looked at it again.
User avatar
Grantius
Posts: 1545
Joined: June 28th, 2011, 4:14 pm
Contact:

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by Grantius »

[quote="Rodze"
There's no "to each their own" (unless you have a machine that was tailor made to make pdf.js faster than Adobe). Pdf.js doesn't lock up to open itself, yes, but it takes its sweet time to render the actual PDF (when it renders). Adobe is pretty much instant after it's loaded.

I never looked into metrics or know if Mozilla has them, I guess 99.9% of the users open only one PDF document once a month, so maybe that's what motivated them.[/quote]

It's designed for people who don't have Adobe installed, and I have never seen it take over as the default viewer - if anything I get annoyed every time there is an Adobe update and it decides to take over as the default viewer without asking.
Micro gaming box: AMD A10-7800 APU, 8gb RAM M350 ITX case (size of a book), Windows 10/Ubuntu
Tablet/Laptop: Asus Transformer T100, Intel Atom 2GB RAM, Windows 10 x86
Mobile:Xiaomi Redmi Note 3 Pro
phuzi0n
Posts: 517
Joined: June 23rd, 2010, 5:48 pm

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by phuzi0n »

Rodze wrote:Can't you just force the user to not open the PDF in the browser at all? I don't know the code (MIME whatever), but I click PDF links that ask me to save/open with instead of opening directly in Firefox.

No, nightly uses pdf.js for both object/embed and for <a href=> style links with a clean profile. It opens in the browser and gives a notification bar with a button to open it with another viewer which causes the file to be saved to your downloads directory. The behavior you have is only achievable by going to tools->options->applications->type "pdf"->change the action to "always ask" which does not have any option to actually open the file with another viewer, just to open it with FF (pdf.js) or save it to disk, and it does not apply to object/embed since those are embedding the file into the page.
Rodze
Posts: 602
Joined: October 5th, 2006, 2:54 pm

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by Rodze »

One week later answer, but I found another example of a PDF that forces me to download it instead of opening in the browser: http://phx.corporate-ir.net/External.Fi ... lwZT0z&t=1

So, possible it is, just don't ask me how. =P
GSam
Posts: 24
Joined: June 7th, 2012, 11:56 pm

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by GSam »

Rodze wrote:One week later answer, but I found another example of a PDF that forces me to download it instead of opening in the browser: http://phx.corporate-ir.net/External.Fi ... lwZT0z&t=1

So, possible it is, just don't ask me how. =P


I had that same problem back when I used the Adobe plugin. Some pdfs just do that from my experience.
User avatar
Gingerbread Man
Posts: 7735
Joined: January 30th, 2007, 10:55 am

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by Gingerbread Man »

phuzi0n wrote:No, nightly uses pdf.js for both object/embed and for <a href=> style links with a clean profile.

You're saying this is actually fixed, but no one bothered to mark it as such?
https://bugzilla.mozilla.org/show_bug.cgi?id=738967
Rodze wrote:Can't you just force the user to not open the PDF in the browser at all? I don't know the code (MIME whatever), but I click PDF links that ask me to save/open with instead of opening directly in Firefox.

You can force a download prompt by sending Content-Disposition: attachment. Some servers will go the extra mile to annoy users and also send Content-Type: application/octet-stream.
phuzi0n
Posts: 517
Joined: June 23rd, 2010, 5:48 pm

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by phuzi0n »

Gingerbread Man wrote:
phuzi0n wrote:No, nightly uses pdf.js for both object/embed and for <a href=> style links with a clean profile.

You're saying this is actually fixed, but no one bothered to mark it as such?
https://bugzilla.mozilla.org/show_bug.cgi?id=738967

Hmmm, I thought I had found an embed that loaded in pdf.js before but now I'm not so sure. I just created a simple test case with an embed tag and a separate object tag, the object loads pdf.js but the embed loads with adobe viewer.

Code: Select all

<embed src="http://www.irs.gov/pub/irs-pdf/f1040ez.pdf" type="application/pdf" height="40%" width="90%">
<object data="http://www.irs.gov/pub/irs-pdf/f1040ez.pdf" type="application/pdf" height="40%" width="90%"></object>
talv
Posts: 1
Joined: February 20th, 2013, 5:44 am

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by talv »

I've been using PDF's with embdded javascript to automatically fire off the print dialog when the pdf is loaded in on of my company's core applications that is accessed by 1000's of clients.

using Embed or Object doesn't revert back to adobe for me, infact on Ubuntu I get a find plugin dialog come up that never finds anything.

Is there an alternative programatic way to revert back to the default PDF viewer OR Is there a way to get PDF.js to autoprint in certain instances?

I too can not believe this is forced upon the user without asking or giving them choice by default (I know its configurable in the browser options but its not the point here).

Thanks in advance guys.
VikkiO
Posts: 1
Joined: March 7th, 2013, 1:06 am

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by VikkiO »

@ _Alexander: absolutely agreed.

@phuzi0n: ""To each their own" doesn't seem to fit with Mozilla hijacking the mime-type from adobe reader or other pdf apps which the user explicitly installed on their system to read pdf's with. It doesn't even ask you whether you want to use it by default or not, it only gives the notification button that saves the file so that you can then go and open it with another app. The default behavior should either be as a fallback if nothing else is handling the mime-type, or to ask whether you want to use it as the default or not, it shouldn't be hijacking the mime-type and making you dig through options to disable it."

- My sentiments exactly. I am extremely offended that Firefox has decided to change a behavior I chose to implement. Turning off a user's preferred choice without even asking them in an application is just wrong. Always has been, always will be. Totally unintuitive and not user friendly at all.
Vinit
Posts: 1
Joined: March 11th, 2013, 1:49 pm

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by Vinit »

In my experience (FF 19 on Windows 7) FF uses the native pdf.js if you use the object tag, when embed is used, FF uses the browser plugin (Adobe in my case).
xunxun1982
Posts: 311
Joined: June 20th, 2011, 10:37 am

Re: How to disable pdf.js programatically (in HTML/JS)?

Post by xunxun1982 »

You can enter to <source>\browser\branding

Modify all firefox-branding.js

Add a line : pref("pdfjs.disabled", true);
Post Reply