<div dir="ltr"><div>That's quite strange.</div><div><br></div><div>Are you sure you're not somehow accidentally turning it off?</div><div><br></div><div>What do you see for the value of pdfjs.disabled when you go to about:config?</div><div><br></div><div>Mike<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 15, 2019 at 10:25 AM James Pearson <<a href="mailto:james-p@moving-picture.com">james-p@moving-picture.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This is really aimed at Mike Kaply ...<br>
<br>
Many years ago on this list, Mike provided the 'magic' to add a custom <br>
protocol handler in an autoconfig cfg file - the archives of this list <br>
don't go back to 2014, so I can't link to the original thread - but what <br>
is needed is something like this:<br>
<br>
const Cc = Components.classes;<br>
const Ci = Components.interfaces;<br>
var extProtocolSvc = <br>
Cc["@<a href="http://mozilla.org/uriloader/external-protocol-service;1" rel="noreferrer" target="_blank">mozilla.org/uriloader/external-protocol-service;1</a>"].getService(Ci.nsIExternalProtocolService);<br>
var handlerSvc = <br>
Cc["@<a href="http://mozilla.org/uriloader/handler-service;1" rel="noreferrer" target="_blank">mozilla.org/uriloader/handler-service;1</a>"].getService(Ci.nsIHandlerService);<br>
<br>
var handlerInfo = extProtocolSvc.getProtocolHandlerInfo("yourprotocol");<br>
<br>
var file = Cc["@<a href="http://mozilla.org/file/local;1" rel="noreferrer" target="_blank">mozilla.org/file/local;1</a>"].createInstance(Ci.nsIFile);<br>
// This should be the path to the .app file on Mac or the EXE on Windows<br>
file.initWithPath("/Applications/Preview.app");<br>
var localHandlerApp = <br>
Cc["@<a href="http://mozilla.org/uriloader/local-handler-app;1" rel="noreferrer" target="_blank">mozilla.org/uriloader/local-handler-app;1</a>"].createInstance(Ci.nsILocalHandlerApp);<br>
localHandlerApp.executable = file;<br>
// The name that will be shown in preferences.<br>
// Not used on Mac<br>
localHandlerApp.name = "Preview";<br>
handlerInfo.possibleApplicationHandlers.appendElement(localHandlerApp, <br>
false);<br>
handlerInfo.preferredAction = Ci.nsIHandlerInfo.useHelperApp;<br>
handlerInfo.preferredApplicationHandler = localHandlerApp;<br>
handlerInfo.alwaysAskBeforeHandling = false;<br>
handlerSvc.store(handlerInfo);<br>
<br>
This has worked fine ever since for us - and works with ESR 68 - <br>
however, it appears to 'break' the built-in PDF viewer<br>
<br>
If I create a new profile with a custom protocol handler defined in the <br>
autoconfig (as above), then the built-in PDF viewer isn't used - you're <br>
given the option to open the PDF file in an external viewer instead<br>
<br>
Looking at the Preference Setting for PDF, it is set to 'Always ask' - <br>
changing this to 'Preview in Firefox' just brings up a Save dialog when <br>
clicking on a link to a PDF file<br>
<br>
(The custom protocol handler works fine)<br>
<br>
However, if I create a new profile with an autoconfig that doesn't have <br>
a custom handler defined, start Firefox with that new profile, then quit <br>
Firefox. Then restart Firefox (using the same profile), but this time <br>
using an autoconfig that has the custom handler defined, then the <br>
built-in PDF viewer works as expected ... as does the custom protocol <br>
handler<br>
<br>
i.e. defining a custom protocol handler on the first run of Firefox <br>
appears to interfere with/break the built-it PDF viewer<br>
<br>
This is with Firefox ESR 68.1 on Linux<br>
<br>
Any idea what I can do to prevent this happening ?<br>
<br>
Thanks<br>
<br>
James Pearson<br>
_______________________________________________<br>
Enterprise mailing list<br>
<a href="mailto:Enterprise@mozilla.org" target="_blank">Enterprise@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/enterprise" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/enterprise</a><br>
<br>
To unsubscribe from this list, please visit <a href="https://mail.mozilla.org/listinfo/enterprise" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/enterprise</a> or send an email to <a href="mailto:enterprise-request@mozilla.org" target="_blank">enterprise-request@mozilla.org</a> with a subject of "unsubscribe"<br>
</blockquote></div>