Difference between revisions of "Firefox/Tweaks"

From ArchWiki
Jump to navigation Jump to search
(Network settings: Removed items that are not in the latest Firefox (v12).)
Line 40: Line 40:
<td>enable pipelining for proxy connections</td>
<td>enable pipelining for proxy connections</td>
<td>enable pipelining of first requests</td>
Line 50: Line 45:
<td>maximum HTTP requests per pipeline</td>
<td>maximum HTTP requests per pipeline</td>
<td>number of initial reflows during rendering</td>
<td>enable interruption of parsing to return to the application's event loop</td>
<td>time after which parsing is interrupted</td>
<td>time steps for the initial reflows (content.notify.backoffcount)</td>
<td>enable timer based reflows</td>
<td>keep same as content.notify.interval</td>
<td>time before inital page reflow</td>
<td>number of total HTTP connections</td>
<td>number of total HTTP connections</td>
<td>maximum number of any type of connections per server</td>
<td>maximum number of any type of connections per server</td>
Line 105: Line 65:
<td>maximum number of keep-alive type connections per server</td>
<td>maximum number of keep-alive type connections per server</td>
<td>size of memory to use as cache - set as big as you can for normal operation</td>

Revision as of 23:35, 27 April 2012

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 – فارسی

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki: Acquiring and installing plugins such as Flash Template:Article summary wiki: Installing and troubleshooting the Firefox browser and plugins Template:Article summary wiki: Caching the profile in RAM Template:Article summary end


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.maxrequests 8 maximum HTTP requests per pipeline
network.http.max-connections 64 number of total HTTP connections
network.http.max-connections-per-server 16 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
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. 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 do not 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: "Block reported attack sites" and "Block reported web forgeries".
  • 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 ~/.profile and relogin for the change to take place.

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Firefox/Tweaks#)

Template:Box YELLOW

Foreign modifications

Advanced Firefox alterations

Reduce load time by compressing the Firefox binary with upx

Install the upx 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 upx, 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 sqlite3 vacuum and reindex 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, tmpfs 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.

On XFCE above method affects only Firefox UI DPI settings, but web page contents still use DPI=96, which may look ugly. Another soluntion is to change layout.css.devPixelsPerPx to system's DPI/96. For example, on my system DPI=142, DPI/96=1.48. Changing layout.css.devPixelsPerPx to 1.48 makes web page contents use DPI=142, which looks much better.

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 ~/.mozilla/firefox/RANDOMHASH.PROFILENAME/chrome/; namely, userChrome.css and userContent.css.

All of the following modifications take place in userChrome.css.

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;

Auto-hide Bookmarks Toolbar

#PersonalToolbar {
	visibility: collapse !important;
#navigator-toolbox:hover > #PersonalToolbar {
	visibility: visible !important;

Remove sidebar width restrictions

/* remove maximum/minimum  width restriction of sidebar */
#sidebar {max-width: none !important; min-width: 0px !important;}

Web content CSS settings

In userContent.css 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(example.com){ 
         div#header{background-image:none !important} 

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

/* show url in bottom of screen when hovering over link */
a[href]:hover {
    text-decoration: none !important;
a[href]:hover:after {
    content: attr(href);
    position: fixed; left: 0px; bottom: 0px;
    padding: 0 2px !important;
    max-width: 95%; overflow: hidden;
    white-space: nowrap; text-overflow: ellipsis;
    font:10pt sans-serif !important;
    background-color: black  !important;
    color: white !important;
    opacity: 0.7;
    z-index: 9999;


Viewing PDF/PS inside Firefox

If you do not want for some reason to 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 open a pdf/ps or any other document type supported by evince inside firefox, without opening a new window, just follow these 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 also works with other PDF viewers. Try replacing "evince" with the name of another 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:

  • Edit
  • Preferences
  • File types
  • Manage
  • Select the doc extension
  • Select Open them with this application
  • Select /usr/bin/abiword or /usr/bin/soffice

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.

Adding magnet protocol association

In about:config add the following:


Set it's initial value to false. When you open a magnet link you will be prompted with a Launch Application dialogue. From there simply select your chosen torrent client. This technique can also be used with other protocols.