Is there a way to toggle Hide/Unhide Firefox Web Browsers Title Bar via Command Line?

It is possible via the Firefox Web Browser's GUI:

  1. click on top right 3 horizontal lines (☰)
  2. click on Customize
  3. Untick "Title Bar"

Firefox Customize GUI

I have gone through man firefox but did not get any information on how to achieve this via Command Line.

Ubuntu 18.04.3 & Ubuntu 19.10

Due to some demanding reasons, one of the reason is below

I need to use Hide top bar Extension but not all the time.. So I would like to toggle between Hide and Unhide Firefox Web Browsers Title Bar like in below cases

  1. UnHide it when Hide top bar extension is On
  2. Hide it when Hide top bar extension is off

Please note that:

I am Ok.. if it is not possible with CLI.. I just want to make sure is there a way or not with CLI

  • 1
    Maybe user_pref("browser.tabs.drawInTitlebar", true); in your prefs.js? – DK Bose Oct 25 '19 at 14:13
  • Hi, thanks for responding.. I am looking for a command line.. the way you guide seems tougher than GUI way I mentioned in Q – UnKNOWn Oct 25 '19 at 14:15
  • 1
    seems the right way.. the reason is I am customizing the ISO.. so straight away whoever installs with this ISO will not bother like you said you never bothered.. Thank You @DKBose – UnKNOWn Oct 25 '19 at 14:20
  • 1
    You are asking an XY question. The answer to your current question, "How to edit the firefox preferences with the terminal" is not the appropriate approach to do what you really want, shipping a customized firefox version on an ISO. – vanadium Oct 25 '19 at 15:25
  • 4
    Possible duplicate of How do I change Firefox's `about:config` from a shell script? – kenn Oct 25 '19 at 15:38

Firefox stores user preferences in the file prefs.js in the user's profile directory. That file should not be edited while firefox is running. Changes in preferences are written when firefox exits.

A script that edits the file prefs.js to change the setting "browser.tabs.drawInTitlebar" would therefore be needed to change the setting that enables or disables the legacy title bar using the command line. The setting appears as:

user_pref("browser.tabs.drawInTitlebar", true);

Configuration options can also be set using a file user.js in the profile folder. Preferences set in user.js have preferences over the settings in prefs.js. Any changes using the preferences dialog or using about:config will be lost when Firefox is restarted, so that file is a means to set more permanent default options in a user profile (Ref).

The change will only take effect the next time firefox is loaded. I am not aware of a possibility to reload the configuration files "on the fly" (nor are these specialists) so a change would immediately take effect in the running Firefox instance. The best you can do, afaik, is have your script terminate Firefox, apply the change in user.js using your script, then reopen Firefox.

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.