![Firefox for Enterprise logo](https://assets-prod.sumo.prod.webservices.mozgcp.net/media/uploads/products/2020-04-14-08-36-43-8dda6f.png)
Prefs.js file is generated in random userprofile path, need to overwrite it dynamically
Need way to overwrite prefs.js with corporate standard for kiosk like environment. Either need way to have firefox install in standard path within each user profile or have firefox insert file from source. Advice ? thanks.
All Replies (11)
Why would you want to overwrite prefs.js as there are other ways to deploy/configure Firefox via policies.json or autoconfig.cfg ?
Ti ṣàtúnṣe
We have configured the autoconfig and userchrome files and need to add a static print shortcut to the browser bar. Is this possible with json? historically the prefs.js file was used for this.
thanks,
Jon
Is that about a toolbar button or about a bookmark or something else ?
In an autoconfig.cfg file you can possibly include JavaScript code to parse and edit browser.uiCustomization.state if that is the pref you are interested in. You need to disable the sandbox via autoconfig.js to be able to run privileged JavaScript code if you do not use ESR versions.
The autoconfig.js file that specifies to use autoconfig.cfg is placed into the "defaults\pref" directory where the channel-prefs.js file is located.
// pref("general.config.filename", "autoconfig.cfg"); pref("general.config.obscure_value", 0); pref("general.config.sandbox_enabled", false); // required if you need to disable the sandbox and run JavaScript code
We need to add the print icon to the locked down bar besides the url area.
is there a way to set a profiles.ini in the application directory\system to standardize the profile directory? i could then use group policy to overwrite the prefs.js.
You can modify the name of the directory in profiles.ini to be a consistent name and then move your files into that directory.
You can also use
-p "profile path"
https://wiki.mozilla.org/Firefox/CommandLineOptions#-profile_.22profile_path.22
to have Firefox put the profile in a specific place.
Thanks, i used a scheduled task to overwrite at boot. Resolved... should really be able to code this in the ADMX.
Can you be more specific about your specific ask so I can open a bug?
Do you want profiles to not have random names?
Or do you want to be able to put the Mozilla directory in an arbitrary location?
Hi
It would be nice from an enterprise support perspective if the profile directory always had the same path for every install. Placing a profile.ini in the profile path seems a bit redundant, as if you can do that, you can overwrite the prefs.js. Another nice option would be to place prefs.js in the installdir/defaults/profile directory for it be be auto-populated into the profile upon generation like the stylesheets.
Mike, thank you for your efforts, most appreciated.
Regards,
Jon
Been sitting on this forever, but for some reason didn't reply.
The reason profiles are the way they are is so malware can't easily find your profile.
If you want to put a profile at a specific path, you can do that with some Firefox command line parameters:
https://wiki.mozilla.org/Firefox/CommandLineOptions
Particularly
https://wiki.mozilla.org/Firefox/CommandLineOptions#-profile_.22profile_path.22
Thanks Mike. Appreciate the response.