Zohar Posted October 16, 2015 Share Posted October 16, 2015 (edited) Hi If you open Firefox, and enter in the URL Field: about:config You will see many settings that you can edit. One of them for example is: gfx.downloadable_fonts.enabled This is a boolean setting that tells firefox whether to download custom fonts that a website want the browser to download, or not. How can I change this setting programmatically, without automating the GUI? So I can turn this setting On and Off, without seeing the GUI for the settings all the time... I hope it's pssible Thank you Edited July 23, 2017 by Zohar Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted October 16, 2015 Share Posted October 16, 2015 I do not have FF installed on this computer but the settings are usually in the registry or in a settings file.I just do a compare before/after the change to see what changed and then script it. https://support.mozilla.org/en-US/questions/965842 Link to comment Share on other sites More sharing options...
mdwerne Posted October 16, 2015 Share Posted October 16, 2015 (edited) I've found most of the settings I need to change are in the prefs.js file in each Firefox users profile.I've had great success with this script: https://www.autoitscript.com/forum/topic/169753-firefox-configurationHope this helps,-MikeUpdate: Using the above script, this command allowed me to change from true to false...I assume the method to toggle back is obvious. _FF_Config("gfx.downloadable_fonts.enabled", false)Make sure you quit Firefox before attempting to make the change. Edited October 16, 2015 by mdwerne Adding solution... Zohar 1 Link to comment Share on other sites More sharing options...
Zohar Posted October 16, 2015 Author Share Posted October 16, 2015 Hi ViciousXUSMC and mdwerne Thank you both for this solution,it will indeed work, and it's indeed programmatic and not via GUI,however since it messes with the config file, it is a disadvantage,since if the user changes other settings via the GUI, then they will be overridden by the file that we write.(that's why it's emphasized in the _FF_Config() function to close Firefox first..) Anther disadvantage of messing with the config file, is that the change will only happen after firefox is opened again. For these reasons,I am looking for a programmatic way which uses some Object Model that Firefox provides (hopefully),and which allows changing a setting...Is there a chance that there is some? Link to comment Share on other sites More sharing options...
BrewManNH Posted October 16, 2015 Share Posted October 16, 2015 The pref.js file IS the programmatic way to configure FireFox. You only have to do it once, and before FF is opened. You could do it by including it in the StartUp folder to have it run on log in.The changes a user makes to FF that shows in about:config should be in one of the prefs.js files and your script can read these files prior to writing to them to make sure you're not changing a user setting. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
Zohar Posted October 16, 2015 Author Share Posted October 16, 2015 Thank you BrewManNH,but as I asked in the last post, If there is an Object Model that we can use,it will be a better method of achieving it. I do hope Firefox exposed an Object Model.. Link to comment Share on other sites More sharing options...
pcjunki Posted October 16, 2015 Share Posted October 16, 2015 you could set it globally in Mozilla.cfgwhich is stored in the same directory as firefox.exejust add this line, and it's set for all userspref("gfx.downloadable_fonts.enabled", false); Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted October 16, 2015 Share Posted October 16, 2015 Also the link I gave shows how to lock preferences and have user.js set preferences at startup so no need to have issues with closing FF first. You really have quite a few options here, all of them quite valid and easy to implement. Link to comment Share on other sites More sharing options...
Zohar Posted October 16, 2015 Author Share Posted October 16, 2015 (edited) pcjunki,but I don't want just to set uit once and for all..I want to be able to togle it on and off when ever needed.(usually it's off, and on some occasions I want to temporarily turn it on). BTW,maybe there's a way to change Firefox's settings via command line? It's amazing how little firefox did, regarding automation for the browser.. For example, to automate webpages, one needs to install the MozRepl add-in..You would expect that such a feature would be available built-in..I like Firefox, but in terms of automation it's extremely disappointing Edited October 16, 2015 by Zohar Link to comment Share on other sites More sharing options...
pcjunki Posted October 16, 2015 Share Posted October 16, 2015 you can toggle it on off,pref("gfx.downloadable_fonts.enabled", false);orpref("gfx.downloadable_fonts.enabled", true); Link to comment Share on other sites More sharing options...
Zohar Posted October 16, 2015 Author Share Posted October 16, 2015 yes I knowbut using what you said (setting it globally in Mozilla.cfg file) still has the disadvantages that I wrote earlier.. Link to comment Share on other sites More sharing options...
BrewManNH Posted October 16, 2015 Share Posted October 16, 2015 Have you tried modifying the prefs.js or mozilla.cfg file while FF was running? Does it change anything you're trying to change? If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator Link to comment Share on other sites More sharing options...
JohnOne Posted October 16, 2015 Share Posted October 16, 2015 Seems to me like you're not interested in anything anyone has to say, I'm wondering why your question was not just "Does FF expose COM methods?"It does not, there would be a UDF that uses it easily found if it did.For example, to automate webpages, one needs to install the MozRepl add-inSo why not just do that? MuffinMan 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jguinch Posted October 16, 2015 Share Posted October 16, 2015 @Zohar : applying changes in prefs.js or mozilla.cfg seems to be the only way to change the Firefox configuration. You can edit mozilla.cfg even if Firefox is open, but all changes require a restart of the application to be applied. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Zohar Posted October 17, 2015 Author Share Posted October 17, 2015 Seems to me like you're not interested in anything anyone has to say, I'm wondering why your question was not just "Does FF expose COM methods?"I am very much interested in what everyone has to say,but not all solutions will fit..Not choosing a solution doesn't mean I am not interested in what people have to say.. It does not, there would be a UDF that uses it easily found if it did.Yeah, I begin to understand there isn't another way..Sad @Zohar : applying changes in prefs.js or mozilla.cfg seems to be the only way to change the Firefox configuration.You can edit mozilla.cfg even if Firefox is open, but all changes require a restart of the application to be applied.Thank you jguinch,Since it's the only way, then I will use it, and close FF before changing anything.. Thank you Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now