X
Tap here to go to the mobile version of the site.

Support Forum

pdfjs.defaultZoomValue in autoconfig.js not applying as expected.

Posted

On a central file server repository we have a firefox autoconfig.js text file that we use a GPO to copy over top of the existing autoconfig.js file. We've used this before and can verify in about:config a few of our custom values are shown.

I wanted to add a new one today so the line I added to the end of the file is: pref("pdfjs.defaultZoomValue", page-width);

I ran gpupdate /force and sure enough the file updated at this path on my PC: C:\Program Files\Mozilla Firefox\defaults\pref

I opened firefox and under about:config to pdfjs.defaultZoomValue it was still showing the default value which is blank.

Any idea how I can get this preference distributed? We need PDFs to default open to page-width, not some zoom level. Its taking many extra clicks to get work done.

On a central file server repository we have a firefox autoconfig.js text file that we use a GPO to copy over top of the existing autoconfig.js file. We've used this before and can verify in about:config a few of our custom values are shown. I wanted to add a new one today so the line I added to the end of the file is: pref("pdfjs.defaultZoomValue", page-width); I ran gpupdate /force and sure enough the file updated at this path on my PC: C:\Program Files\Mozilla Firefox\defaults\pref I opened firefox and under about:config to pdfjs.defaultZoomValue it was still showing the default value which is blank. Any idea how I can get this preference distributed? We need PDFs to default open to page-width, not some zoom level. Its taking many extra clicks to get work done.

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36

More Information

Question owner

I forgot to mention we are using and maintaining Firefox Quantum 60.5.2esr (64-bit) company wide.

Thanks.

I forgot to mention we are using and maintaining Firefox Quantum 60.5.2esr (64-bit) company wide. Thanks.
jscher2000
  • Top 10 Contributor
8637 solutions 70648 answers

Helpful Reply

Since it is a string value, could you try quoting it?

pref("pdfjs.defaultZoomValue", "page-width");

Since it is a string value, could you try quoting it? pref("pdfjs.defaultZoomValue", "page-width");

Question owner

No it still shows default status with no value.

This is really weird.

No it still shows default status with no value. This is really weird.
jscher2000
  • Top 10 Contributor
8637 solutions 70648 answers

kjstech said

I ran gpupdate /force and sure enough the file updated at this path on my PC:
C:\Program Files\Mozilla Firefox\defaults\pref

Hmm, I overlooked this before. According to the documentation, the individual preferences you want to change go into the file listed on the first line of the autoconfig.js file, not directly into the autoconfig.js file itself.

Customizing Firefox Using AutoConfig

''kjstech [[#question-1252547|said]]'' <blockquote>I ran gpupdate /force and sure enough the file updated at this path on my PC:<br> C:\Program Files\Mozilla Firefox\defaults\pref</blockquote> Hmm, I overlooked this before. According to the documentation, the individual preferences you want to change go into the file listed on the first line of the autoconfig.js file, not directly into the autoconfig.js file itself. [[Customizing Firefox Using AutoConfig]]

Question owner

Yes I saw that but other elements in this file are working just fine.

Are you saying there is a 7 line limit to what can be set in autoconfig.js, and if i need to setup more prefs than that I need to do it in another file that autoconfig.js references?

Here is our current file, with our domain name changed.

pref("general.config.filename", "cck2.cfg"); pref("security.enterprise_roots.enabled", true); pref("network.automatic-ntlm-auth.trusted-uris", .ourdomainname.com); pref("network.negotiate-auth.trusted-uris", ourdomainname.com); pref("browser.shell.checkDefaultBrowser", false); pref("accessibility.force_disabled", 1); pref("security.pki.distrust_ca_policy", 0); pref("pdfjs.defaultZoomValue", "page-width");

Yes I saw that but other elements in this file are working just fine. Are you saying there is a 7 line limit to what can be set in autoconfig.js, and if i need to setup more prefs than that I need to do it in another file that autoconfig.js references? Here is our current file, with our domain name changed. pref("general.config.filename", "cck2.cfg"); pref("security.enterprise_roots.enabled", true); pref("network.automatic-ntlm-auth.trusted-uris", .ourdomainname.com); pref("network.negotiate-auth.trusted-uris", ourdomainname.com); pref("browser.shell.checkDefaultBrowser", false); pref("accessibility.force_disabled", 1); pref("security.pki.distrust_ca_policy", 0); pref("pdfjs.defaultZoomValue", "page-width");
jscher2000
  • Top 10 Contributor
8637 solutions 70648 answers

I'm not an expert on Autoconfig files, so if there is or isn't a limit, I couldn't tell you. However, by convention, the individual preferences would be set in the cck2.cfg file.

I'm not an expert on Autoconfig files, so if there is or isn't a limit, I couldn't tell you. However, by convention, the individual preferences would be set in the cck2.cfg file.
cor-el
  • Top 10 Contributor
  • Moderator
17416 solutions 157342 answers

You shouldn't place these extra lines in the autoconfig.js, but in a file named autoconfig.cfg (or in cck2.cfg in your case that looks like a leftover from using CCK2 in the past) that is specified via general.config.filename in the main Firefox program folder. Note that both autoconfig.js and autoconfig.cfg need to start with a comment line (//) because the first line is skipped for security reason.

You are missing quotes around the two network prefs and that throws an exception and abort this file. Those question marks were also missing in the first mentioning of the PDF pref, but show in the later listing that you corrected these after jscher2000 pointed this out.

pref("pdfjs.defaultZoomValue", "page-width"); 
pref("network.automatic-ntlm-auth.trusted-uris", .ourdomainname.com);
pref("network.negotiate-auth.trusted-uris", ourdomainname.com); 

Should be:

pref("network.automatic-ntlm-auth.trusted-uris", ".ourdomainname.com");
pref("network.negotiate-auth.trusted-uris", "ourdomainname.com");
You shouldn't place these extra lines in the autoconfig.js, but in a file named autoconfig.cfg (or in cck2.cfg in your case that looks like a leftover from using CCK2 in the past) that is specified via general.config.filename in the main Firefox program folder. Note that both autoconfig.js and autoconfig.cfg need to start with a comment line (//) because the first line is skipped for security reason. You are missing quotes around the two network prefs and that throws an exception and abort this file. Those question marks were also missing in the first mentioning of the PDF pref, but show in the later listing that you corrected these after jscher2000 pointed this out. pref("pdfjs.defaultZoomValue", "page-width"); pref("network.automatic-ntlm-auth.trusted-uris", .ourdomainname.com); pref("network.negotiate-auth.trusted-uris", ourdomainname.com); Should be: pref("network.automatic-ntlm-auth.trusted-uris", ".ourdomainname.com"); pref("network.negotiate-auth.trusted-uris", "ourdomainname.com");

Modified by cor-el

Question owner

I tried splitting up the settings like so but I get a firefox error "Failed to reach the configuration file. Please contact your system administrator." I am the administrator, so I'm posting here as a hail mary.


autoconfig.js // Firefox autoconfig.js 3-11-2019 pref("general.config.filename", "firefox.cfg"); pref("general.config.obscure_value", 0);

autoconfig.cfg //Firefox autoconfig.cfg 3-11-2019 pref("pdfjs.defaultZoomValue", "page-width"); pref("security.enterprise_roots.enabled", true); pref("network.automatic-ntlm-auth.trusted-uris", ".ourdomain.com"); pref("network.negotiate-auth.trusted-uris", "ourdomain.com"); pref("browser.shell.checkDefaultBrowser", false); pref("accessibility.force_disabled", 1); pref("security.pki.distrust_ca_policy", 0);


Any ideas? I had to revert the files back before group policy refresh would copy these nonworking files above to end users computers.

I tried splitting up the settings like so but I get a firefox error "Failed to reach the configuration file. Please contact your system administrator." I am the administrator, so I'm posting here as a hail mary. autoconfig.js // Firefox autoconfig.js 3-11-2019 pref("general.config.filename", "firefox.cfg"); pref("general.config.obscure_value", 0); autoconfig.cfg //Firefox autoconfig.cfg 3-11-2019 pref("pdfjs.defaultZoomValue", "page-width"); pref("security.enterprise_roots.enabled", true); pref("network.automatic-ntlm-auth.trusted-uris", ".ourdomain.com"); pref("network.negotiate-auth.trusted-uris", "ourdomain.com"); pref("browser.shell.checkDefaultBrowser", false); pref("accessibility.force_disabled", 1); pref("security.pki.distrust_ca_policy", 0); Any ideas? I had to revert the files back before group policy refresh would copy these nonworking files above to end users computers.

Helpful Reply

Nevermind above. In autoconfig.js I copy and pasted from the Firefox example page which used the filename firefox.cfg. I changed it to autoconfig.cfg which is what my config file is really called and then did gpupdate / force to get the files copied over top on my test machine. Now all the prefs appear loaded, INCLUDING pdfjs.defaultZoomValue.

Thanks for the help. It seems redundant to have a file specify yet another file for configuration. Though GPO keeps these files updated, I may look into storing the .cfg file in a network share and reference it with the file:// path like in the documentation. Though I'm not dead set on it just in case there's an issue with the file path or file share in the future.

Nevermind above. In autoconfig.js I copy and pasted from the Firefox example page which used the filename firefox.cfg. I changed it to autoconfig.cfg which is what my config file is really called and then did gpupdate / force to get the files copied over top on my test machine. Now all the prefs appear loaded, INCLUDING pdfjs.defaultZoomValue. Thanks for the help. It seems redundant to have a file specify yet another file for configuration. Though GPO keeps these files updated, I may look into storing the .cfg file in a network share and reference it with the file:// path like in the documentation. Though I'm not dead set on it just in case there's an issue with the file path or file share in the future.

Question owner

Thanks to clarifying the seperation of preferences into its own file, referenced by autoconfig.js. Because of this we now have a few more settings we've been wanting to nail down for some time, such as the new tab page and eliminating all the firefox tour madness. This is all great stuff for home users, but being that we are a business we just wanted to clean things up a bit.


Here is our new autoconfig.cfg file

//Firefox autoconfig.cfg 3-11-2019 pref("pdfjs.defaultZoomValue", "page-width"); pref("security.enterprise_roots.enabled", true); pref("network.automatic-ntlm-auth.trusted-uris", ".ourdomain.com"); pref("network.negotiate-auth.trusted-uris", "ourdomain.com"); pref("browser.shell.checkDefaultBrowser", false); pref("accessibility.force_disabled", 1); pref("security.pki.distrust_ca_policy", 0); pref("datareporting.policy.firstRunURL", ""); pref("browser.newtabpage.activity-stream.disableSnippets", true); pref("browser.newtabpage.activity-stream.feeds.favicon", false); pref("browser.newtabpage.activity-stream.feeds.migration", false); pref("browser.newtabpage.activity-stream.feeds.newtabinit", false); pref("browser.newtabpage.activity-stream.feeds.places", false); pref("browser.newtabpage.activity-stream.feeds.prefs", false); pref("browser.newtabpage.activity-stream.feeds.section.highlights", false); pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); pref("browser.newtabpage.activity-stream.feeds.section.topstories.options", ""); pref("browser.newtabpage.activity-stream.feeds.sections", false); pref("browser.newtabpage.activity-stream.feeds.snippets", false); pref("browser.newtabpage.activity-stream.feeds.systemtick", false); pref("browser.newtabpage.activity-stream.feeds.telemetry", false); pref("browser.newtabpage.activity-stream.feeds.topsites", false); pref("browser.newtabpage.activity-stream.migrationExpired", true); pref("browser.newtabpage.activity-stream.prerender", false); pref("browser.newtabpage.activity-stream.section.highlights.includePocket", false); pref("browser.newtabpage.activity-stream.showSponsored", false); pref("browser.newtabpage.activity-stream.showTopSites", false); pref("browser.newtabpage.activity-stream.telemetry", false); pref("browser.newtabpage.activity-stream.telemetry.ping.endpoint", ""); pref("browser.newtabpage.activity-stream.telemetry.ut.events", false); pref("browser.newtabpage.activity-stream.tippyTop.service.endpoint", ""); pref("browser.onboarding.enabled", false);

Thanks to clarifying the seperation of preferences into its own file, referenced by autoconfig.js. Because of this we now have a few more settings we've been wanting to nail down for some time, such as the new tab page and eliminating all the firefox tour madness. This is all great stuff for home users, but being that we are a business we just wanted to clean things up a bit. Here is our new autoconfig.cfg file //Firefox autoconfig.cfg 3-11-2019 pref("pdfjs.defaultZoomValue", "page-width"); pref("security.enterprise_roots.enabled", true); pref("network.automatic-ntlm-auth.trusted-uris", ".ourdomain.com"); pref("network.negotiate-auth.trusted-uris", "ourdomain.com"); pref("browser.shell.checkDefaultBrowser", false); pref("accessibility.force_disabled", 1); pref("security.pki.distrust_ca_policy", 0); pref("datareporting.policy.firstRunURL", ""); pref("browser.newtabpage.activity-stream.disableSnippets", true); pref("browser.newtabpage.activity-stream.feeds.favicon", false); pref("browser.newtabpage.activity-stream.feeds.migration", false); pref("browser.newtabpage.activity-stream.feeds.newtabinit", false); pref("browser.newtabpage.activity-stream.feeds.places", false); pref("browser.newtabpage.activity-stream.feeds.prefs", false); pref("browser.newtabpage.activity-stream.feeds.section.highlights", false); pref("browser.newtabpage.activity-stream.feeds.section.topstories", false); pref("browser.newtabpage.activity-stream.feeds.section.topstories.options", ""); pref("browser.newtabpage.activity-stream.feeds.sections", false); pref("browser.newtabpage.activity-stream.feeds.snippets", false); pref("browser.newtabpage.activity-stream.feeds.systemtick", false); pref("browser.newtabpage.activity-stream.feeds.telemetry", false); pref("browser.newtabpage.activity-stream.feeds.topsites", false); pref("browser.newtabpage.activity-stream.migrationExpired", true); pref("browser.newtabpage.activity-stream.prerender", false); pref("browser.newtabpage.activity-stream.section.highlights.includePocket", false); pref("browser.newtabpage.activity-stream.showSponsored", false); pref("browser.newtabpage.activity-stream.showTopSites", false); pref("browser.newtabpage.activity-stream.telemetry", false); pref("browser.newtabpage.activity-stream.telemetry.ping.endpoint", ""); pref("browser.newtabpage.activity-stream.telemetry.ut.events", false); pref("browser.newtabpage.activity-stream.tippyTop.service.endpoint", ""); pref("browser.onboarding.enabled", false);