Firefox tweaks

From ArchWiki
Revision as of 09:34, 16 August 2011 by Kovtunos (Talk | contribs) (Reduce load time by compressing the Firefox binary with upx)

Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.

Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어

External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Summary help replacing me
Firefox configuration and modifications
Browser Plugins: Acquiring and installing plugins such as Flash
Firefox: Installing and troubleshooting the Firefox browser and plugins
Speed-up Firefox using tmpfs: Caching the profile in RAM


Improving Firefox's performance is divided into parameters that can be inputted while running Firefox or otherwise modifying its configuration as intended by the developers, and advanced procedures that involve foreign programs or scripts.


Improvements stemming from native Firefox settings.

Network settings

References: Mozillazine

  • All settings can be adjusted by browsing to about:config.
  • Values for connections (HTTP, proxy, etc.) should be tweaked based on connection.

These are the values for a 1.5Mb cable connection:

Key Value Description
network.http.pipelining true enable pipelining for normal connections
network.http.proxy.pipelining true enable pipelining for proxy connections
network.http.pipelining.firstrequests true enable pipelining of first requests
network.http.pipelining.maxrequests 8 maximum HTTP requests per pipeline
content.notify.backoffcount 5 number of initial reflows during rendering
content.interrupt.parsing true enable interruption of parsing to return to the application's event loop
content.max.tokenizing.time 2250000 time after which parsing is interrupted
content.notify.interval 750000 time steps for the initial reflows (content.notify.backoffcount)
content.notify.ontimer true enable timer based reflows
content.switch.threshold 750000 keep same as content.notify.interval
nglayout.initialpaint.delay 0 time before inital page reflow
network.http.max-connections 48 number of total HTTP connections
network.http.max-connections-per-server 24 maximum number of any type of connections per server
network.http.max-persistent-connections-per-proxy 16 maximum number of keep-alive type connections per proxy
network.http.max-persistent-connections-per-server 8 maximum number of keep-alive type connections per server
browser.cache.memory.capacity 65536 size of memory to use as cache - set as big as you can for normal operation
network.dns.disableIPv6 true disables IPv6 support - may not work for all networks, some report speed increase

Turning off anti-phishing

Note: Deleting files from your profile folder is potentially dangerous, so it's recommended that you make a backup of the folder first.

The anti-phishing features of Firefox may cause Firefox to become slow to start or exit, and might also affect the browsing speed since Firefox apparently contacts google for every http request. The problem is that Firefox maintains a sqlite database that might grow quite big, and reading and writing to this database begins to take some time when it grows bigger. If you feel that you don't need Firefox to tell you which sites may be suspect you can disable this feature:

  • Turn off the following options under the security tab in preferences: "Tell me if the site I'm visiting is a suspected Attack site" and "Tell me if the site I'm visiting is a suspected forgery".
  • Delete all files beginning with urlclassifier in your profile folder (~/.mozilla/firefox/********.default where ******** is some combination of letters and numbers. Default might be something else if you have created a non-default profile). Some of these files might be recreated by Firefox, but they won't grow any larger than their initial size:
$ rm -i ~/.mozilla/firefox/*.default/urlclassifier*

Improve rendering by disabling pango

Note: Exporting the setting may also fix font issues for the entire Mozilla suite.



to Template:Filename and relogin for the change to take place.

Foreign modifications

Advanced Firefox alterations

Reduce load time by compressing the Firefox binary with upx

Install the Template:Package Official package:

# pacman -S upx

Make a backup of the firefox binary:

# cp /usr/lib/firefox-5.0/firefox-bin /usr/lib/firefox-5.0/firefox-bin_backup

Invoke Template:Filename, applying a compression level of 9:

# upx -9 /usr/lib/firefox-5.0/firefox-bin

Defragment the profile's SQLite databases

Warning: This procedure may damage the databases in such a way that sessions are not saved properly.
Sample size differences comparison
SQLite DB Size Before Size After  % change
urlclassifier3.sqlite 37 M 30 M 19 %
places.sqlite 16 M 2.4 M 85 %
Profile defragmentation procedure

Firefox 3.0, bookmarks, history, passwords are kept in SQLite databases. SQLite databases become fragmented over time and empty spaces appear all around. But, since there are no managing processes checking and optimizing the database, these factors eventually result in a performance hit. A good way to improve startup and some other bookmarks and history related tasks is to defragment and trim unused space from these databases.

Run Template:Filename Template:Codeline and Template:Codeline commands in the profile directory.


$ cd ~/.mozilla/firefox/*.default
$ for i in urlclassifier3 places; do \
    sqlite3 $i.sqlite vacuum;        \
    sqlite3 $i.sqlite reindex;       \

To automate the process for all the databases in all the profiles directory, use the following:

$ find ~/.mozilla -name \*.sqlite    \
    -exec sqlite3 {} vacuum  \;    \
    -exec sqlite3 {} reindex \;

Cache the entire profile into RAM via tmpfs

If the system has memory to spare, Template:Codeline can be used to cache the entire profile directory, which might result in increased Firefox responsiveness.



See also: Font Configuration


Modifying the following value can help improve the way fonts looks in Firefox if the system's DPI is below 96. Firefox, by default, uses 96 and only uses the system's DPI if it is a higher value. To force the system's DPI regardless of its value, type about:config into the address bar and search for layout.css.dpi. Change it to 0.

Default font settings from MS Windows

Below are the default font preferences when Firefox is installed in Microsoft Windows. Many web sites use the Microsoft fonts.

Proportional: Serif Size (pixels): 16
Serif: Times New Roman
Sans-serif: Arial
Monospace: Courier New Size (pixels): 13

General UI CSS settings

Firefox's UI can be modified by editing the files in Template:Filename; namely, Template:Filename and Template:Filename.

All of the following modifications take place in Template:Filename.

Change UI font

The setting effectively overrides the global GTK2+ font preferences, and does not affect the body; only the UI itself:

* {
    font-family: "FONT_NAME";

Hide button icons

Enables text-only buttons:

.button-box .button-icon {
    display: none;

Hiding various tab buttons

These settings hide the arrows that appear to the horizontal edges of the tab bar, the button that toggles the "all tabs" drop-down list, and the plus sign button that creates a new tab.

/* Tab bar */

.tabbrowser-strip *[class^="scrollbutton"] {
    /* Hide tab scroll buttons */
    display: none;

.tabbrowser-strip *[class^="tabs-alltabs"] {
    /* Hide tab drop-down list */
    display: none;

.tabbrowser-strip *[class^="tabs-newtab-button"] {
    /* Hide new-tab button */
    display: none;

Horizontal tabs

To place the tab bar horizontally stacked along the sides of the browser window:

/* Display the tabbar on the left */
#content > tabbox {
    -moz-box-orient: horizontal;

.tabbrowser-strip {
    -moz-box-orient: vertical;
     * You can set this to -moz-scrollbars-vertical instead,
     * but then the scrollbar will *always* be visible.  this way
     * there is never a scrollbar, so it behaves like the tab bar
     * normally does
     overflow: -moz-scrollbars-none;

.tabbrowser-tabs {
    -moz-box-orient: horizontal;
    min-width: 20ex;   /* You may want to increase this value */
    -mox-box-pack: start;
    -moz-box-align: start;

.tabbrowser-tabs > hbox {
    -moz-box-orient: vertical;
    -moz-box-align: stretch;
    -moz-box-pack: start;

.tabbrowser-tabs > hbox > tab {
    -moz-box-align: start;
    -moz-box-orient: horizontal;

Web content CSS settings

In Template:Filename you can add custom css rules for web content. Examples:

/* import other css file */
@import url("./imports/some_file.css");

/* block ads */
    display: none !important

/* domain specific rule */
@-moz-document domain({ 
         div#header{background-image:none !important} 

/* add '[pdf]' next to to pdf links  */
a[href$=".pdf"]:after {
    font-size: smaller;
    content: " [pdf]";


Viewing PDF/PS inside Firefox

if you don't want for some reason install Adobe Acrobat Reader for exploiting the feature to see PDF inside Firefox, you can use other software, like Evince (default viewer in GNOME)

for example if you want to use evince for opening a pdf/ps or any other document supported by evince, inside firefox, and not to open a new window, this is possible and you just follow this simple instructions:

  • install mozplugger (in this moment is in AUR) and evince (in extra)
  • delete ~/.mozilla/firefox/*.default/pluginreg.dat (as mentioned after mozplugger installation)
  • edit /etc/mozpluggerrc: find the line containing "pdf" word, after "GV()" edit evince line as below:
  #repeat noisy fill exits: evince "$file"
  repeat noisy swallow(evince) fill: evince "$file"
Note: you must place comments at the very beginning of the line to avoid errors
  • finally close (if not yet) and reopen firefox (now you can see a new plugin called mozplugger)
  • try to open a pdf sample
Note: this method works also with other pdf viewer, trying to change "evince" with the other program.

Wheel mouse scroll speed

To modify the default values (i.e. speed-up) of the wheel mouse scroll speed, type the following into Firefox's address bar:


Now enter the following into the 'filter' dialog: mousewheel.withnokey

  • Double-click the entry entitled, mousewheel.withnokey.sysnumlines and thereby setting its value to false
  • Double-click the entry entitled, mousewheel.withnokey.numlines and enter the desired number of lines per movement into the box (12, for example).

Restart firefox for this setting to take effect.

Alternatively you can install SmoothWheel add-on.

Change the order of searchplugins list

You can now (in Firefox 3) change the order in the GUI:

  • Open the dropdown list of search engines and click Manage Search Engines
  • Highlight the Engine you want to move and use Move Up or Move Down to move it.

How to open a *.doc automatically with abiword or open office

Click through the following menus:

There is also a plugin/addon called mime edit. This addon will let you edit the mime types for firefox.

Secure DNS with DNSSEC validator

You can enable DNSSEC support for safer browsing.