Is there a way to lock Customization changes in Firefox in about:config?

Discussion in 'other software & services' started by lotuseclat79, Dec 11, 2014.

  1. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    Due to the fact that I use a Live USB flash drive with Ubuntu on it to keep my hard drives unmounted when I access the Internet, I save my Firefox profile (Linux) which contains new bookmarks at the end of every day's session (in a mounted hard drive) after disabling Networking and then turning off my router.

    It appears that my Customization changes do not appear to survive saving my profile and then reinstalling the saved profile each successive day such that every day I must re-customize how I like Firefox to appear after launching it.

    Is there a way to lock down these Customization changes perhaps in about:config so I won't have to keep repeating it every day with my saved Firefox profile from the previous day?

    After activating Customization, I typically must Restore defaults, then re-active the Menu, Bookmarks, and Additional toolbars, after which I need to add NoScript to the Additional toolbar. It is these customization changes that I would like to be able to lock down to avoid re-customizing the same thing every day.

    -- Tom
     
  2. 142395

    142395 Guest

    Did you try user.js?
     
  3. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    Do you mean prefs.js, i.e. there is no user.js in the Linux version. And, what I want to know is what is the item and how to configure it.

    Thanks for the reply,

    -- Tom
     
  4. BoerenkoolMetWorst

    BoerenkoolMetWorst Registered Member

    Joined:
    Dec 22, 2009
    Posts:
    4,868
    Location:
    Outer space
    How do you save your Profile? Making a copy of your profile folder with everything in it does the trick perfectly when reinstalling/moving to new machine etc.
     
  5. 142395

    142395 Guest

    No, you have to manually make user.js in the same folder with prefs.js.
    And that depends what settings you want to save, firstly find them in about:config.
    Let me assume your setting is "browser.bookmarks.max_backups" and want to set it's value to 0, and also "browser.cache.disk.enable" to false. These are part of my Windows firefox's one but I think format is same for Linux, but effective about:config entry won't exactly same (so replace yours).
    Then, create text file and write like this:

    user_pref("browser.bookmarks.max_backups", 0);
    user_pref("browser.cache.disk.enable", false);

    Then save it, launch firefox and see if setting is applied.
     
  6. 142395

    142395 Guest

    Well, though, about:config or user.js don't save bookmarks or addons, so it will not be what you want.
    Maybe the sollution is in other.
     
  7. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    In Linux, the entire profile is located in /home/user/<user's home directory>/.mozilla - ergo, I tar the entire profile with a small script that saves the entire day's sessions' current state in a tarball compressed with xz. Remember - since I am using a Live USB flash drive - I am running in 8GB of memory and need to save the profile state on hard drive for it to survive the power down of my system. Since by that time I have all ready disabled my Networking and turned off my router, it is safe to mount my hard drive, and save it there.
     
  8. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    What I am looking for is a configuration item to install in about:config that prevents my customization from being changed. I have explained how I save my profile which contains my bookmarks and addons to BoerenkoolMetWorst in my reply above in message #7.

    -- Tom
     
  9. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    I finally resorted to searching for "How to prevent Firefox Cusomizations from being changed in about:config" and fouind How to Stop the Toolbar From Hiding in Firefox which explained that when "browser.fullscreen.autohide" is true Firefox hides your toolbar when you enter full screen mode, and the fix is to change the value to "false". For now, I've changed the value to false and will go with just that change for now to see if it works to fix my entire problem.

    Thanks for all of your comments. I'll post the results tomorrow to see if it has solved the problem.

    -- Tom
     
  10. 142395

    142395 Guest

    I hope it works, and reccommend you to make backup copu of user.js you made.
    But to be honest I can't fully understand what you said, sorry it's due to my limited English reading.
     
  11. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    Well, it does not appear to have worked, but I plan to keep the change and look for more that might work. I may post a message on the Ubuntu forums or Mozilla forums to see if there is a fix there that someone may know about, or it may be that there is a need to make a change in about:config that has not yet addressed the problem.

    -- Tom
     
  12. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    I observed that on initial launch of Firefox it required customizations to be made, and then after closing and relaunching Firefox, the same scenario played out. So, it would appear that customizations do not survive the relaunch of Firefox after I save Firefox's profile.

    I'll need to make further observations of whether this happens when I am running my scripts which save the current state of the Firefox profile (both before I close, and after I close Firefox) to see if anything gets changed at that point to fully understand if anything is being changed in the state of the profile of Firefox somewhere in the process of running my profile saving scripts or possibly whether the problem is specific to any override associated with launching Firefox which may be responsible for losing the customizations.

    -- Tom
     
  13. hawki

    hawki Registered Member

    Joined:
    Dec 17, 2008
    Posts:
    6,065
    Location:
    DC Metro Area
    Do any of these help?es this help?

    http://lacithedog.wordpress.com/2014/04/17/mozbackup-for-linux/

    http://alternativeto.net/software/mozbackup/?platform=linux

    "Firefox stores a user's personal information such as bookmarks, extensions, and user preferences in a unique profile. The first time you start Firefox, it will automatically create a default profile; additional profiles can be created using the Profile Manager. The settings which form a profile are stored in files within a special folder on your computer — this is the profile folder........."


    "Linux
    Profile folders are located here:

    • ~/.mozilla/firefox/<profile folder>
    The ".mozilla" folder is a hidden folder. See this article for more information. To show hidden files in Nautilus (Gnome desktop's default file browser), choose "View -> Show Hidden Files"."

    http://kb.mozillazine.org/Profile_folder_-_Firefox

    "Linux

    Go to your home folder > .mozilla > Firefox

    The Linux Mint Firefox directory.

    Backup the folder

    Your profile is a random selection of numbers and letters which is followed by .default. Copy and paste that folder in to your backup folder that you created in Step 1. Backup profiles.ini too and put that also in your backup folder.

    Restoring backup

    If you are on a new computer or a fresh install you will need to run Firefox and then close it, this will create a new profile.

    Navigate to the directory as in Step 3.

    From here you have 2 options. You can either replace the contents of the new .default folder with your contents or delete the original folder and copy your old folder across along with the profiles.ini, overwriting the original profiles.ini.

    This method is not also limited to backing up Firefox profiles, you can save Thunderbird, Seamonkey, Galeon, Flock, Songbird or any Mozilla based software. I used this method to move my Firefox and Thunderbird profiles from Vista to Linux."

    "http://www.worldoweb.co.uk/2009/backup-your-firefox-profile-manually

    "This article will teach you four different ways of how you can backup your Firefox profile, with all the settings, bookmarks and all other important bits of data. The tips given here are valid both for Linux and Windows (and even Mac), save for the fourth method, which is limited to Windows."


    http://www.dedoimedo.com/computers/firefox-backup.html
     
    Last edited: Dec 14, 2014
  14. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    Hi hawki,

    Thanks for the info, but I already have a bullet proof way of saving my Linux Firefox profile located in /hom/<username>/.mozilla . The problem is that I need to be able to lock down my customizations which do not survive Firefox relaunches with a LockPref (<item-name>) in the prefs.js file, or in about:config with a specific setting, and I do not know what the name of the item is or how to configure what I want to do in about:config to prevent the problem from happening. The problem is not a backup problem, as I save the profile and replace it to its latest state before every new daily computer session. Something is overriding the Customizations changes at Firefox launch, and the Customizations need to be locked down to avoid the interference.

    -- Tom
     
  15. hawki

    hawki Registered Member

    Joined:
    Dec 17, 2008
    Posts:
    6,065
    Location:
    DC Metro Area
    I see. Sorry.
     
  16. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    Not knowing the particular item in about:config presented a hurdle in helping to solve this problem. So, what was required to whittle down the search space was a simple scheme to do a diff comparison of the prefs.js file in the Firefox profile when it was in one of two states, i.e. an uncustomized state and a customized state. Low an behold, the item is a string item named "browser.uiCustomization.state". The objective now is to freeze the customized state from being changed to an uncustomized state. One way this uncustomization problem seems to happen is to switch from an online to offline use between a relaunch of Firefox.

    Having just come up with this idea today, it now remains to construct a LockPref statement in (I think) a user created user.js file, if I am not mistaken to finally solve the problem. Even though the Classic Theme Restorer add-on is simple to use and it always worked to restore defaults + show toolbars + position the NoScript icon to the Add-on Toolbar - it gets old real fast to continually have to do this manually when the default way that Firefox handles the browser.uiCustomization.state is to change it when you don't want it to do that!

    -- Tom
     
  17. Compu KTed

    Compu KTed Registered Member

    Joined:
    Dec 18, 2013
    Posts:
    1,411
    If your trying to prevent about:config preferences from changing by Firefox then you would
    create a lock file. Couple of preference examples below.

    Code:
    //
     lockPref("browser.chrome.favicons", false);
     lockPref("browser.chrome.site_icons", false);
    
    Again, these are only 2 examples so whatever preferences you want to lock list them however many
    and save the file as mozilla.cfg and place it in your browser install directory.

    Next create a new file in the defaults/pref subfolder of the installation directory.
    Can name it users.js if you like.

    Add the following lines to the file:
    Code:
     
    pref("general.config.obscure_value", 0);
    pref("general.config.filename", "mozilla.cfg");
    
    Save the change and completely restart the application. Now, all of the prefs listed will be locked.
    To verify go into about:config and and look up the preferences. Should see entries appear
    in italic and should state locked in the status column.

    To unlock all preferences, remove the entries you added earlier from the "users.js" file and completely restart browser.

    Hope this is what your looking for.
     
    Last edited: Feb 13, 2015
  18. siljaline

    siljaline Registered Member

    Joined:
    Jun 29, 2003
    Posts:
    6,618
    We need a Mozilla dedicated board here as all of these posts are getting shuffled into Software | Services and getting lost with all the rest.

    All in favor of a dedicated NEW Mozilla sub-forum say Aye !!
     
  19. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    Hi Compu KTed,

    Well, that seems to have worked!!! Thanks!

    In summary, for others, attempting to freeze their customizations/modifications in about:config - the process is as follows:

    1. Determine which preference(s) in about:config you want to lock by name. (Mine was "browser.uiCustomization.state")

    2. Save the modified preference(s) in the following format in the Firefox installation directory under the file name mozilla.cfg:
    //
    lockPref("name of preference", value of preference);
    ...

    3. Install the file named users.js with the following contents in the Firefox installation directory path defaults/pref:
    pref("general.config.obscure_value", 0);
    pref("general.config.filename", "mozilla.cfg");

    4. Relaunch Firefox, and verify that your preferences are marked by name and locked status in italics.

    As an afterthought, since I install via USB each day, I will have to add both of those files to my post USB installation scripts to preserve the changes prior to my daily Firefox launch.

    -- Tom
     
    Last edited: Feb 17, 2015
  20. Compu KTed

    Compu KTed Registered Member

    Joined:
    Dec 18, 2013
    Posts:
    1,411
    Your Welcome.
    The users.js file might already be used by someone who has created it to store changes they have made. You could name it something else if you like. I just used it as an example.
     
  21. lotuseclat79

    lotuseclat79 Registered Member

    Joined:
    Jun 16, 2005
    Posts:
    5,390
    As an addendum, it appears that there is still one case that does not work, and that is when the browser is launched while offline. If anyone knows how to override this with another item to lockdown, please mention it to me in this thread and I will test it out. I presume it probably includes the word "offline", but I am not certain that it does.

    -- Tom
     
  22. Alhaitham

    Alhaitham Registered Member

    Joined:
    May 18, 2013
    Posts:
    188
    Location:
    Egypt
    Aye
     
  23. siljaline

    siljaline Registered Member

    Joined:
    Jun 29, 2003
    Posts:
    6,618
    We have a seconded for a Mozilla specific sub Forum - Aye !
     
  24. SweX

    SweX Registered Member

    Joined:
    Apr 21, 2007
    Posts:
    6,429
    Personally, I think a sub forum for Mozilla/Firefox is too specific, why not a Browser sub forum? Where discussions about browsers (mozilla/firefox, chrome, opera, vivaldi, maxthon etc...) and add-ons, extensions can take place.

    I say Aye to a Browser sub forum.
     
  25. Compu KTed

    Compu KTed Registered Member

    Joined:
    Dec 18, 2013
    Posts:
    1,411
    Not sure what you mean. The lockPref will remain locked for those preferences you specify whether online
    or offline. In order to remove the lock from preference(s) you can delete those lines in users.js file or
    whatever name you choose to use and those preferences will be restored back to their default settings.

    Note: Any customized pref setting (ones you added- created) however seem to be removed from my experience.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.