0

I need to configure Firefox on a large number of computers. Is there a user preference I can set to show the bookmarks toolbar by default using a config file like all-companyname.js?

Here is an example of what I mean by a user preference:

user_pref("browser.startup.homepage", "https://www.google.com");

So far the only related preference I have found is dom. disable_window_open_feature.directories which prevents websites from hiding the bookmarks bar when they open a popup window.

0

Big disclaimer: This "answer" is googled together by someone who has (close to) no clue what he is doing (i.e. me). But probably this or one of the references is helpful.

  1. xulstore.json

    What you are looking for seems to be no preference, but a local state stored in xulstore.json in the profile directory. There's the string

    "PersonalToolbar":{"currentset":"personal-bookmarks","collapsed":"true"}

    which controls the visibility - "false" hides the toolbar. (See here and notice that localstore.rdf is now xulstore.json.)

  2. userChrome.css

    You can find information about this in <profile_dir>/chrome/userChrome.css. Adding the lines

    #PersonalToolbar { visibility: collapse !important; }

    does what you want which I found here.

  3. autoconfig.cfg

    You can place an autoconfig file, named e.g. autoconfig.cfg, that can modify userChrome.css. It could for example include the following code which should not be used if not verified by someone who knows what he or she is doing (i.e. not me) which requires some knowledge of JavaScript I guess.

    // const Cc = Components.classes; const Ci = Components.interfaces; Components.utils.import("resource://gre/modules/Services.jsm"); var profileDir = Services.dirsvc.get("ProfD", Ci.nsILocalFile); profileDir.append("chrome"); if( !profileDir.exists() || !profileDir.isDirectory() ) { profileDir.create(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0777); } profileDir.append("userChrome.css"); var fos = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); fos.init(profileDir, -1, -1, false); var css ="#PersonalToolbar{ visibility: collapse !important;}"; fos.write(css, css.length); fos.close();

    I found this code on Michael Kaply's Homepage and slightly modified it in the third line from below to suit your needs.

  4. all-companyname.js

    You can set a preference that tells firefox to use the autoconfig file you just created by adding

    pref('general.config.filename', 'autoconfig.cfg');

    which is something I found, again, on Michael Kaply's Guide.

While a little complicated, this looks quite elegant to me. Sadly, I don't think I'll be able to answer any questions that may arise in the implementation of this method. But probably the rest of the community will be able to help.

(Note that any information that's taken from Michael Kaply's Guide may be from 2012.)

An alternative that I can think of is to provide a simple add-on via .xpi that switches the state of visibility of the bookmarks toolbar and provide the "hide"-setting as a default. In fact, it seems like there had been such an Add-On, but it's no longer available. This would be quite an ugly workaround for such a simple task.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.