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