Skip to content

Instantly share code, notes, and snippets.

@slmg
Last active August 21, 2020 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slmg/3f5fe93ceea1389547ce85bc0b382631 to your computer and use it in GitHub Desktop.
Save slmg/3f5fe93ceea1389547ce85bc0b382631 to your computer and use it in GitHub Desktop.
Mozilla Firefox tweaks

Firefox UI Tweaks

Features

  • Bookmark toolbar Chrome behaviour: display only on new tab (kinda...)
  • Remove extra space on top left before tabs when Firefox isn't full screen
  • Do not show title bar (looks bulky in ubuntu)
  • Do not hide tab bar in full screen

Installation

Hard

Use this method on a new system or if you do not care to destroy all firefox settings (cookies, bookmarks, extensions, preferences, etc...). If you use sync, it should not be a problem.

# Replace with relevant values
FIREFOX_HOME=/home/<username>/.mozilla/firefox
GIST=<path of unziped gist>

# Recreate firefox config dir and cd into it
rm -r $FIREFOX_HOME
mkdir $FIREFOX_HOME
cd $FIREFOX_HOME

mkdir -p 1d3nt1ty.perso/chrome

cp $GIST/userChrome.css 1d3nt1ty.perso/chrome
cp $GIST/times.json 1d3nt1ty.perso
cp $GIST/user.js 1d3nt1ty.perso
cp $GIST/profiles.ini .

# firefox needs to be notified to use the profile `perso` once, then it'll be used by default
firefox -P perso

Soft

Use this method to integrate with an existing firefox profile, i.e. you do want to keep firefox's state.

# Replace with relevant values
FIREFOX_HOME=/home/<USERNAME>/.mozilla/firefox
GIST=<path of unziped gist>

# figure out what is the current profile used by firefox, visble in the second line (under [Install...])
cat $FIREFOX_HOME/profiles.ini

# cd in the current profile folder
# ...

mkdir chrome

# copy the relevant files into your existing profile
cp $GIST/userChrome.css chrome
cp $GIST/user.js .

Additional step

In any case, to show the bookmarks tab only on new-tab page, it is needed to manually right click on the main toolbar and toggle "Bookmarks Toolbar".

[Profile0]
Name=perso
IsRelative=1
Path=1d3nt1ty.perso
[General]
StartWithLastProfile=1
Version=2
{
"created": 1598027196534,
"firstUse": null
}
// Required to enable Firefox to read ./chrome/userChrome.css
user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true);
// Do not show title bar (bulky in ubuntu systems)
user_pref("browser.tabs.drawInTitlebar", true);
// Do not hide tab bar in full screen
user_pref("browser.fullscreen.autohide", false);
/* Show bookmark toolbar only when urlbar is focused */
#nav-bar:focus-within + #PersonalToolbar{
visibility: visible !important;
}
#PersonalToolbar {
visibility: collapse !important;
}
/* Remove space before first tab */
#TabsToolbar .titlebar-spacer[type="pre-tabs"] {
display: none !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment