Difference between revisions of "Firefox/Tweaks"
Pythonscript (talk | contribs) (→Reduce load time by compressing the Firefox binary with upx) |
(update as discussed in Help_talk:Style/Article_summary_templates#Deprecation_of_summaries_and_overviews) |
||
(43 intermediate revisions by 18 users not shown) | |||
Line 1: | Line 1: | ||
− | + | [[tr:Firefox İpuçları]] | |
[[Category:Web Browser]] | [[Category:Web Browser]] | ||
+ | {{Related articles start}} | ||
+ | {{Related|Firefox}} | ||
+ | {{Related|Browser Plugins}} | ||
+ | {{Related|Firefox Ramdisk}} | ||
+ | {{Related articles end}} | ||
− | + | This page contains advanced Firefox configuration options and performance tweaks. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Performance == | == Performance == | ||
− | 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 | + | 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. |
− | === | + | {{Note|Always use the latest version of Firefox.}} |
− | + | ||
+ | === Advanced Firefox options === | ||
+ | This section contains advanced Firefox options for performance tweaking. For additional information see [http://kb.mozillazine.org/Category:Tweaking_preferences these Mozillazine forum posts]. | ||
==== Network settings ==== | ==== Network settings ==== | ||
− | |||
− | + | Advanced network settings can be found on the {{ic|about:config}} page (try searching for ''network''). | |
− | + | ||
+ | {| class="wikitable" border="1" style="width: 100%;" cellpadding="5" cellspacing="0" | ||
+ | |+ Recommended values for a 1.5Mb connection | ||
+ | ! Key || Value || Description | ||
+ | |- | ||
+ | | network.http.pipelining || true || Enable [http://www-archive.mozilla.org/projects/netlib/http/pipelining-faq.html 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 || Maximum 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 || Disable IPv6 support | ||
+ | |} | ||
+ | |||
+ | {{Note|These settings need to be configured based on your connection.}} | ||
+ | |||
+ | ==== Turn off anti-phishing ==== | ||
+ | {{Note|Deleting files from your profile folder is potentially dangerous, so it is recommended that you back it up first.}} | ||
+ | |||
+ | The anti-phishing features of Firefox may cause Firefox to become slow to start or exit. The problem is that Firefox maintains an [[Sqlite]] database that can grow quite big which makes reading and writing slower after repeated use. 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 {{ic|urlclassifier}} in your profile folder ({{ic|~/.mozilla/firefox/<profile_dir>/}}): | ||
+ | $ rm -i ~/.mozilla/firefox/<profile_dir>/urlclassifier* | ||
− | + | :Some of these files might be recreated by Firefox, but they won't grow any larger than their initial size. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ==== | + | ==== Stop urlclassifier3.sqlite from being created again ==== |
− | {{ | + | If you did remove all the {{ic|urlclassifier*}} files as mentioned above, you may find out that {{ic|urlclassifier3.sqlite}} keeps growing again after a certain time. Here is a simple solution to avoid it for now and ever. |
− | + | $ cd ~/.mozilla/firefox/<profile_dir> | |
+ | $ echo "" > urlclassifier3.sqlite | ||
+ | $ chmod 400 urlclassifier3.sqlite | ||
− | + | This effectively makes the file empty and then read-only so Firefox cannot write to it anymore. | |
− | + | ==== Turn off OCSP validation ==== | |
− | + | The OCSP validation of Firefox may cause Firefox to become slow every time a HTTPS connections to a new site is done (see [http://news.netcraft.com/archives/2013/04/16/certificate-revocation-and-the-performance-of-ocsp.html this article] for details). This may be particularly bad in recent times where web gadgets are included in pages via HTTPS (the "like" buttons of the social networks for example) resulting in many HTTPS connections for a single URL loaded. | |
− | + | * Turn off the following option under the advanced tab in preferences -> Encryption -> Validation: ''"Use the Online Certificate Status Protocol (OCSP) to confirm the current validity of certificates"''. | |
− | |||
− | + | ==== Turn off the disk cache ==== | |
− | + | Every object loaded (html pages, jpeg images, css stylesheets, gif banners) is saved in the Firefox cache, to be loaded in the future without to download it again from the server, but only fraction of these objects will be really reused without download (usually the 30%). This because of too short expiration times for the objects, updates or simply the user behavior (to load new pages instead the ones already visited). The Firefox cache is divided in memory and disk cache and using the disk cache results to frequent disk writes, because every time an object loaded it is written to the disk and some older object is removed. | |
− | to | ||
− | + | * Turn on the following option under the advanced tab in preferences -> Network -> Validation: ''"Override automatic cache management"'' and specify zero in ''"Limit cache to"''. | |
− | |||
− | === | + | ==== Longer interval to save session ==== |
− | + | The Firefox session store automatically saves the current status (opened urls, cookies, history and bookmarks) to the disk every 15 seconds. It may be too frequent for the user needs, resulting in a frenquet disk access. | |
− | + | This setting can be found on the {{ic|about:config}} page (try searching for ''sessionstore''). | |
− | |||
− | |||
− | + | * browser.sessionstore.interval 300000 | |
+ | |||
+ | === Other modifications === | ||
+ | This section contains some other modifications that may increase Firefox's performance. | ||
+ | |||
+ | ==== Reduce load time by compressing the Firefox binary with UPX ==== | ||
+ | [http://upx.sourceforge.net/ UPX] is an executable packer that supports very fast decompression and induces no memory overhead. It can be [[pacman|installed]] with the {{Pkg|upx}} package, availalble in the [[official repositories]]. | ||
+ | |||
+ | Before using {{ic|upx}} to compress the Firefox executable, make a backup of the binary: | ||
# cp /usr/lib/firefox/firefox /usr/lib/firefox/firefox.backup | # cp /usr/lib/firefox/firefox /usr/lib/firefox/firefox.backup | ||
− | + | Finally, invoke {{ic|upx}}, applying the best possible compression level: | |
# upx --best /usr/lib/firefox/firefox | # upx --best /usr/lib/firefox/firefox | ||
==== Defragment the profile's SQLite databases ==== | ==== Defragment the profile's SQLite databases ==== | ||
− | {{Warning| This procedure may damage the databases in such a way that sessions are not saved properly.}} | + | {{Warning|This procedure may damage the databases in such a way that sessions are not saved properly.}} |
− | ===== Sample size differences comparison | + | In Firefox 3.0, bookmarks, history, passwords are kept in an 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 start-up and some other bookmarks and history related tasks is to defragment and trim unused space from these databases. |
− | + | ||
− | + | {{AUR|profile-cleaner}} in the [[AUR]] does just this. | |
+ | |||
+ | {| class="wikitable" border="1" style="width: 100%;" cellpadding="5" cellspacing="0" | ||
+ | |+ Sample size differences comparison | ||
+ | ! SQLite database || Size Before || Size After || % change | ||
|- | |- | ||
|urlclassifier3.sqlite|| 37 M || 30 M || 19 % | |urlclassifier3.sqlite|| 37 M || 30 M || 19 % | ||
Line 117: | Line 111: | ||
|- | |- | ||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
==== Cache the entire profile into RAM via tmpfs ==== | ==== Cache the entire profile into RAM via tmpfs ==== | ||
− | If the system has memory to spare, {{ | + | If the system has memory to spare, {{ic|tmpfs}} can be used to [[Firefox Ramdisk|cache the entire profile directory]], which might result in increased Firefox responsiveness. |
== Appearance == | == Appearance == | ||
=== Fonts === | === Fonts === | ||
− | + | {{Box||See the main article: [[Font Configuration]]|#E5E5FF|#FCFCFC}} | |
− | ==== DPI ==== | + | ==== Configure the DPI value ==== |
− | 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 | + | 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 {{ic|about:config}} into the address bar and set {{ic|layout.css.dpi}} to '''0'''. |
− | + | Note that the above method only affects the Firefox user interface's DPI settings. Web page contents still use a DPI value of 96, which may look ugly or, in the case of high-resolution displays, may be rendered too small to read. A solution is to change {{ic|layout.css.devPixelsPerPx}} to system's DPI divided by 96. For example, if your system's DPI is 144, then the value to add is 144/96 = 1.5. Changing {{ic|layout.css.devPixelsPerPx}} to '''1.5''' makes web page contents use a DPI of 144, which looks much better. | |
− | |||
− | |||
− | ==== Default font settings from | + | ==== Default font settings from Microsoft Windows ==== |
Below are the default font preferences when Firefox is installed in Microsoft Windows. Many web sites use the Microsoft fonts. | Below are the default font preferences when Firefox is installed in Microsoft Windows. Many web sites use the Microsoft fonts. | ||
{{bc| | {{bc| | ||
Line 162: | Line 133: | ||
}} | }} | ||
− | === General | + | === General user interface CSS settings === |
− | Firefox's | + | Firefox's user interface can be modified by editing the {{ic|userChrome.css}} and {{ic|userContent.css}} files in {{ic|~/.mozilla/firefox/<profile_dir>/chrome/}} (''profile_dir'' is of the form ''hash.name'', where the ''hash'' is an 8 character, seemingly random string and the profile ''name'' is usually ''default''). |
− | + | {{Note|The {{ic|chrome/}} folder and {{ic|userChrome.css}}/{{ic|userContent.css}} files may not necessarily exist, so you have to create them.}} | |
− | ==== Change | + | This section only deals with the {{ic|userChrome.css}} file which modifies Firefox's user interface, and not web pages. |
− | The setting effectively overrides the global | + | |
− | {{ | + | ==== Change the font ==== |
+ | The setting effectively overrides the global GTK+ font preferences, and does not affect webpages, only the user interface itself: | ||
+ | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css| | ||
* { | * { | ||
font-family: "FONT_NAME"; | font-family: "FONT_NAME"; | ||
Line 177: | Line 150: | ||
==== Hide button icons ==== | ==== Hide button icons ==== | ||
Enables text-only buttons: | Enables text-only buttons: | ||
− | {{ | + | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css| |
.button-box .button-icon { | .button-box .button-icon { | ||
display: none; | display: none; | ||
Line 185: | Line 158: | ||
==== Hiding various tab buttons ==== | ==== 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. | 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. | ||
− | {{ | + | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css|<nowiki> |
/* Tab bar */ | /* Tab bar */ | ||
Line 201: | Line 174: | ||
/* Hide new-tab button */ | /* Hide new-tab button */ | ||
display: none; | display: none; | ||
− | } | + | }</nowiki> |
}} | }} | ||
==== Horizontal tabs ==== | ==== Horizontal tabs ==== | ||
To place the tab bar horizontally stacked along the sides of the browser window: | To place the tab bar horizontally stacked along the sides of the browser window: | ||
− | {{ | + | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css| |
/* Display the tabbar on the left */ | /* Display the tabbar on the left */ | ||
#content > tabbox { | #content > tabbox { | ||
Line 243: | Line 216: | ||
==== Auto-hide Bookmarks Toolbar ==== | ==== Auto-hide Bookmarks Toolbar ==== | ||
+ | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css| | ||
+ | #PersonalToolbar { | ||
+ | visibility: collapse !important; | ||
+ | } | ||
− | + | #navigator-toolbox:hover > #PersonalToolbar { | |
− | + | visibility: visible !important; | |
− | + | } | |
− | + | }} | |
− | |||
− | |||
− | === Remove sidebar width restrictions === | + | ==== Remove sidebar width restrictions ==== |
− | {{ | + | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css| |
/* remove maximum/minimum width restriction of sidebar */ | /* remove maximum/minimum width restriction of sidebar */ | ||
− | #sidebar {max-width: none !important; min-width: 0px !important;} | + | #sidebar { |
+ | max-width: none !important; | ||
+ | min-width: 0px !important; | ||
+ | } | ||
}} | }} | ||
=== Web content CSS settings === | === Web content CSS settings === | ||
− | + | This section deals with the {{ic|userContent.css}} files in which you can add custom CSS rules for web content. You can import other CSS files by adding to the file: | |
− | {{ | + | |
− | / | + | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css| |
@import url("./imports/some_file.css"); | @import url("./imports/some_file.css"); | ||
+ | }} | ||
− | + | ==== Block certain parts of a domain ==== | |
− | + | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css| | |
− | + | @-moz-document domain(example.com) { | |
− | + | div#header { | |
− | + | background-image: none !important; | |
− | + | } | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | @-moz-document domain(example.com){ | ||
− | |||
} | } | ||
+ | }} | ||
− | /* add '[pdf]' next to to | + | ==== Add [pdf] after links to PDF files ==== |
+ | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css|<nowiki> | ||
+ | /* add '[pdf]' next to links to PDF files */ | ||
a[href$=".pdf"]:after { | a[href$=".pdf"]:after { | ||
font-size: smaller; | font-size: smaller; | ||
content: " [pdf]"; | content: " [pdf]"; | ||
− | } | + | }</nowiki> |
+ | }} | ||
− | + | ==== Show URLs at the bottom of the screen when hovering a link ==== | |
+ | {{hc|~/.mozilla/firefox/<profile_dir>/chrome/userContent.css| | ||
a[href]:hover { | a[href]:hover { | ||
text-decoration: none !important; | text-decoration: none !important; | ||
} | } | ||
+ | |||
a[href]:hover:after { | a[href]:hover:after { | ||
content: attr(href); | content: attr(href); | ||
Line 316: | Line 277: | ||
opacity: 0.7; | opacity: 0.7; | ||
z-index: 9999; | z-index: 9999; | ||
− | + | } | |
+ | }} | ||
+ | ==== Firefox 4 New Menu Bar/Firefox Button ==== | ||
+ | To toggle between the new Firefox button and the classic menu bar: | ||
+ | * if the button is active, check ''Preferences > Menu Bar'', or right click in the toolbar area and check ''Menu Bar''. | ||
+ | * if the menu bar is active, uncheck ''View > Toolbars > Menu Bar'', or right click in the toolbar area and uncheck ''Menu Bar''. | ||
+ | |||
+ | In GNU/Linux, you will just get a plain grey button instead of the new orange one from Windows. However you can change this to either a Firefox icon or the icon followed by the "Firefox" text. | ||
+ | |||
+ | Adding the following to your {{ic|~/.mozilla/firefox/userprofile/chrome/userChrome.css}} file will place the icon before the text: | ||
+ | {{bc| | ||
+ | #appmenu-toolbar-button { | ||
+ | list-style-image: url("chrome://branding/content/icon16.png"); | ||
+ | } | ||
+ | }} | ||
+ | Adding the following to the same file will ''remove'' the "Firefox" text: | ||
+ | {{bc| | ||
+ | #appmenu-toolbar-button > .toolbarbutton-text, | ||
+ | #appmenu-toolbar-button > .toolbarbutton-menu-dropmarker { | ||
+ | display: none !important; | ||
+ | } | ||
}} | }} | ||
− | |||
− | + | This userChrome.css configuration copies the default Windows Firefox 4+ look and adds an orange background to the button, with a purple background in Private Browsing mode: | |
+ | {{bc| | ||
+ | #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button { | ||
+ | -moz-appearance: none !important; | ||
+ | color: #FEEDFC !important; | ||
+ | background: -moz-linear-gradient(hsl(34,85%,60%), hsl(26,72%,53%) 95%) !important; | ||
+ | border: 1px solid #000000 !important; | ||
+ | } | ||
+ | |||
+ | #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:not(:active):not([open]) { | ||
+ | -moz-appearance: none !important; | ||
+ | color: #FEEDFC !important; | ||
+ | background: -moz-linear-gradient(hsl(26,72%,53%), hsl(34,85%,60%) 95%) !important; | ||
+ | border: 1px solid #000000 !important; | ||
+ | } | ||
+ | |||
+ | |||
+ | #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:active, | ||
+ | #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button[open] { | ||
+ | -moz-appearance: none !important; | ||
+ | color: #FEEDFC !important; | ||
+ | background: -moz-linear-gradient(hsl(26,72%,53%), hsl(26,72%,53%) 95%) !important; | ||
+ | border: 1px solid #000000 !important; | ||
+ | } | ||
+ | |||
+ | #appmenu-toolbar-button { | ||
+ | -moz-appearance: none !important; | ||
+ | color: #FEEDFC !important; | ||
+ | background: -moz-linear-gradient(hsl(279,70%,46%), hsl(276,75%,38%) 95%) !important; | ||
+ | border: 1px solid #000000 !important; | ||
+ | } | ||
+ | |||
− | + | #main-window #appmenu-toolbar-button:hover:not(:active):not([open]) { | |
+ | -moz-appearance: none !important; | ||
+ | color: #FEEDFC !important; | ||
+ | background: -moz-linear-gradient(hsl(276,75%,38%), hsl(279,70%,46%) 95%) !important; | ||
+ | border: 1px solid #000000 !important; | ||
+ | } | ||
− | |||
− | + | #main-window #appmenu-toolbar-button:hover:active, | |
+ | #main-window #appmenu-toolbar-button[open] { | ||
+ | -moz-appearance: none !important; | ||
+ | color: #FEEDFC !important; | ||
+ | background: -moz-linear-gradient(hsl(276,75%,38%), hsl(276,75%,38%) 95%) !important; | ||
+ | border: 1px solid #000000 !important; | ||
+ | } | ||
+ | }} | ||
− | + | {{Note|You need to create both the {{ic|chrome}} directory and {{ic|userChrome.css}}, if they do not already exist.}} | |
− | + | ==== Block ads ==== | |
− | + | See [http://www.floppymoose.com floppymoose.com] for an example of how to use {{ic|userContent.css}} as a basic ad-blocker. | |
− | |||
− | + | == Miscellaneous == | |
− | + | Other tips and tweaks. | |
− | + | === Mouse wheel scroll speed === | |
− | + | To modify the default values (i.e. speed-up) of the mouse wheel scroll speed, go to {{ic|about:config}} and search for {{ic|mousewheel.acceleration}}. This will show the available options, modifying the following: | |
− | {{ | + | * Set {{ic|mousewheel.acceleration.start}} to '''-1'''. |
+ | * Set {{ic|mousewheel.acceleration.factor}} to the desired number (10 to 20 are common values). | ||
− | + | Alternatively you can install the [http://smoothwheel.mozdev.org/ SmoothWheel add-on]. | |
− | + | === Change the order of search engines in the Firefox Search Bar === | |
− | |||
− | |||
− | * | + | To change the order search engines are displayed in: |
− | + | * Open the drop-down list of search engines and click ''Manage Search Engines...'' entry. | |
+ | * Highlight the engine you want to move and use ''Move Up'' or ''Move Down'' to move it. Alternatively, you can use drag-and-drop. | ||
− | + | === How to open a *.doc automatically with Abiword or LibreOffice Writer === | |
− | + | Go to ''Preferences > Applications'' and search for ''Word Document'' (or ''Word 2007 Document'' for {{ic|*.docx}}). After finding it, click the drop-down list and select ''Use other...''. From there you have to specify the exact path to the Abiword or Writer executable (i.e.{{ic|/usr/bin/abiword}} or {{ic|/usr/bin/lowriter}}). | |
− | === | + | === "I'm Feeling Lucky" mode === |
− | + | Some search engines have a feeling lucky feature. For example Google has "I'm Feeling Lucky" and DuckDuckGo has "I'm Feeling Ducky". | |
− | |||
− | |||
− | + | To activate them: | |
− | + | # Type {{ic|about:config}} in the address bar. | |
− | + | # Search for the string {{ic|keyword.url}}. | |
− | + | # Modify its value (if any) to the URL of the search engine. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | For Google, set it to: | |
+ | {{bc|<nowiki>http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=</nowiki>}} | ||
+ | For DuckDuckGo, set it to: | ||
+ | {{bc|<nowiki>https://duckduckgo.com/?q=\</nowiki>}} | ||
+ | For Google Encrypted (RCA-4 128bit High security encyption), set it to: | ||
+ | {{bc|<nowiki>https://encrypted.google.com/search?btnI=I%27m+Feeling+Lucky&q=</nowiki>}} | ||
=== Secure DNS with DNSSEC validator === | === Secure DNS with DNSSEC validator === | ||
+ | |||
You can enable [[DNSSEC]] support for safer browsing. | You can enable [[DNSSEC]] support for safer browsing. | ||
=== Adding magnet protocol association === | === Adding magnet protocol association === | ||
− | In {{ic|about:config}} | + | |
− | + | In {{ic|about:config}} set {{ic|network.protocol-handler.expose.magnet}} to '''false'''. | |
− | + | ||
− | + | The next time you open a magnet link, you will be prompted with a {{ic|Launch Application}} dialogue. From there simply select your chosen torrent client. This technique can also be used with other protocols. | |
− | This technique can also be used with other protocols. | + | |
+ | === Prevent accidental closing === | ||
+ | |||
+ | The [https://addons.mozilla.org/en-us/firefox/addon/disable-ctrl-q-shortcut/ Disable Ctrl-Q Shortcut] extension can be installed to prevent unwanted closing of the browser. | ||
+ | |||
+ | An alternative is to add a rule in your window manager configuration file. For example in openbox add: | ||
+ | <keybind key="C-q"> | ||
+ | <action name="Execute"> | ||
+ | <execute>false</execute> | ||
+ | </action> | ||
+ | </keybind> | ||
+ | in the ''<keyboard>'' section of your {{ic|rc.xml}} file. | ||
+ | {{Note|This will be effective for every application used under a graphic server.}} | ||
+ | |||
+ | === Plugins don't work with latest version === | ||
+ | |||
+ | Due to Arch's bleeding edge nature, there can be some compatility issues with plugins not working with the latest Firefox install (ie [http://5digits.org/pentadactyl/index Pentadactyl]). If possible, try installing the nightly/beta builds available, or see [[Downgrading Packages]]. | ||
+ | |||
+ | == See also == | ||
+ | |||
+ | * [http://kb.mozillazine.org/Knowledge_Base MozillaZine Wiki] | ||
+ | * [http://kb.mozillazine.org/About:config_entries about:config Entries Explained] | ||
+ | * [http://linuxtidbits.wordpress.com/2009/08/01/better-fox-cat-and-weasel/ Top Fox: Completing the Feel of Firefox] | ||
+ | * [http://linuxtidbits.wordpress.com/2013/03/08/firefox-defining-font-type-and-size/ Firefox: Defining font type and size] |
Revision as of 19:08, 8 December 2013
This page contains advanced Firefox configuration options and performance tweaks.
Contents
- 1 Performance
- 2 Appearance
- 3 Miscellaneous
- 3.1 Mouse wheel scroll speed
- 3.2 Change the order of search engines in the Firefox Search Bar
- 3.3 How to open a *.doc automatically with Abiword or LibreOffice Writer
- 3.4 "I'm Feeling Lucky" mode
- 3.5 Secure DNS with DNSSEC validator
- 3.6 Adding magnet protocol association
- 3.7 Prevent accidental closing
- 3.8 Plugins don't work with latest version
- 4 See also
Performance
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.
Advanced Firefox options
This section contains advanced Firefox options for performance tweaking. For additional information see these Mozillazine forum posts.
Network settings
Advanced network settings can be found on the about:config
page (try searching for network).
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 | Maximum 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 | Disable IPv6 support |
Turn off anti-phishing
The anti-phishing features of Firefox may cause Firefox to become slow to start or exit. The problem is that Firefox maintains an Sqlite database that can grow quite big which makes reading and writing slower after repeated use. 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/<profile_dir>/
):
$ rm -i ~/.mozilla/firefox/<profile_dir>/urlclassifier*
- Some of these files might be recreated by Firefox, but they won't grow any larger than their initial size.
Stop urlclassifier3.sqlite from being created again
If you did remove all the urlclassifier*
files as mentioned above, you may find out that urlclassifier3.sqlite
keeps growing again after a certain time. Here is a simple solution to avoid it for now and ever.
$ cd ~/.mozilla/firefox/<profile_dir> $ echo "" > urlclassifier3.sqlite $ chmod 400 urlclassifier3.sqlite
This effectively makes the file empty and then read-only so Firefox cannot write to it anymore.
Turn off OCSP validation
The OCSP validation of Firefox may cause Firefox to become slow every time a HTTPS connections to a new site is done (see this article for details). This may be particularly bad in recent times where web gadgets are included in pages via HTTPS (the "like" buttons of the social networks for example) resulting in many HTTPS connections for a single URL loaded.
- Turn off the following option under the advanced tab in preferences -> Encryption -> Validation: "Use the Online Certificate Status Protocol (OCSP) to confirm the current validity of certificates".
Turn off the disk cache
Every object loaded (html pages, jpeg images, css stylesheets, gif banners) is saved in the Firefox cache, to be loaded in the future without to download it again from the server, but only fraction of these objects will be really reused without download (usually the 30%). This because of too short expiration times for the objects, updates or simply the user behavior (to load new pages instead the ones already visited). The Firefox cache is divided in memory and disk cache and using the disk cache results to frequent disk writes, because every time an object loaded it is written to the disk and some older object is removed.
- Turn on the following option under the advanced tab in preferences -> Network -> Validation: "Override automatic cache management" and specify zero in "Limit cache to".
Longer interval to save session
The Firefox session store automatically saves the current status (opened urls, cookies, history and bookmarks) to the disk every 15 seconds. It may be too frequent for the user needs, resulting in a frenquet disk access.
This setting can be found on the about:config
page (try searching for sessionstore).
- browser.sessionstore.interval 300000
Other modifications
This section contains some other modifications that may increase Firefox's performance.
Reduce load time by compressing the Firefox binary with UPX
UPX is an executable packer that supports very fast decompression and induces no memory overhead. It can be installed with the upx package, availalble in the official repositories.
Before using upx
to compress the Firefox executable, make a backup of the binary:
# cp /usr/lib/firefox/firefox /usr/lib/firefox/firefox.backup
Finally, invoke upx
, applying the best possible compression level:
# upx --best /usr/lib/firefox/firefox
Defragment the profile's SQLite databases
In Firefox 3.0, bookmarks, history, passwords are kept in an 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 start-up and some other bookmarks and history related tasks is to defragment and trim unused space from these databases.
profile-cleanerAUR in the AUR does just this.
SQLite database | Size Before | Size After | % change |
---|---|---|---|
urlclassifier3.sqlite | 37 M | 30 M | 19 % |
places.sqlite | 16 M | 2.4 M | 85 % |
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.
Appearance
Fonts
Configure the DPI value
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 set layout.css.dpi
to 0.
Note that the above method only affects the Firefox user interface's DPI settings. Web page contents still use a DPI value of 96, which may look ugly or, in the case of high-resolution displays, may be rendered too small to read. A solution is to change layout.css.devPixelsPerPx
to system's DPI divided by 96. For example, if your system's DPI is 144, then the value to add is 144/96 = 1.5. Changing layout.css.devPixelsPerPx
to 1.5 makes web page contents use a DPI of 144, which looks much better.
Default font settings from Microsoft 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 user interface CSS settings
Firefox's user interface can be modified by editing the userChrome.css
and userContent.css
files in ~/.mozilla/firefox/<profile_dir>/chrome/
(profile_dir is of the form hash.name, where the hash is an 8 character, seemingly random string and the profile name is usually default).
chrome/
folder and userChrome.css
/userContent.css
files may not necessarily exist, so you have to create them.This section only deals with the userChrome.css
file which modifies Firefox's user interface, and not web pages.
Change the font
The setting effectively overrides the global GTK+ font preferences, and does not affect webpages, only the user interface itself:
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
* { font-family: "FONT_NAME"; }
Hide button icons
Enables text-only buttons:
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
.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.
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
/* 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:
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
/* 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
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
#PersonalToolbar { visibility: collapse !important; } #navigator-toolbox:hover > #PersonalToolbar { visibility: visible !important; }
Remove sidebar width restrictions
~/.mozilla/firefox/<profile_dir>/chrome/userChrome.css
/* remove maximum/minimum width restriction of sidebar */ #sidebar { max-width: none !important; min-width: 0px !important; }
Web content CSS settings
This section deals with the userContent.css
files in which you can add custom CSS rules for web content. You can import other CSS files by adding to the file:
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
@import url("./imports/some_file.css");
Block certain parts of a domain
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
@-moz-document domain(example.com) { div#header { background-image: none !important; } }
Add [pdf] after links to PDF files
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
/* add '[pdf]' next to links to PDF files */ a[href$=".pdf"]:after { font-size: smaller; content: " [pdf]"; }
Show URLs at the bottom of the screen when hovering a link
~/.mozilla/firefox/<profile_dir>/chrome/userContent.css
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; }
Firefox 4 New Menu Bar/Firefox Button
To toggle between the new Firefox button and the classic menu bar:
- if the button is active, check Preferences > Menu Bar, or right click in the toolbar area and check Menu Bar.
- if the menu bar is active, uncheck View > Toolbars > Menu Bar, or right click in the toolbar area and uncheck Menu Bar.
In GNU/Linux, you will just get a plain grey button instead of the new orange one from Windows. However you can change this to either a Firefox icon or the icon followed by the "Firefox" text.
Adding the following to your ~/.mozilla/firefox/userprofile/chrome/userChrome.css
file will place the icon before the text:
#appmenu-toolbar-button { list-style-image: url("chrome://branding/content/icon16.png"); }
Adding the following to the same file will remove the "Firefox" text:
#appmenu-toolbar-button > .toolbarbutton-text, #appmenu-toolbar-button > .toolbarbutton-menu-dropmarker { display: none !important; }
This userChrome.css configuration copies the default Windows Firefox 4+ look and adds an orange background to the button, with a purple background in Private Browsing mode:
#main-window:not([privatebrowsingmode]) #appmenu-toolbar-button { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(34,85%,60%), hsl(26,72%,53%) 95%) !important; border: 1px solid #000000 !important; } #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:not(:active):not([open]) { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(26,72%,53%), hsl(34,85%,60%) 95%) !important; border: 1px solid #000000 !important; } #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button:hover:active, #main-window:not([privatebrowsingmode]) #appmenu-toolbar-button[open] { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(26,72%,53%), hsl(26,72%,53%) 95%) !important; border: 1px solid #000000 !important; } #appmenu-toolbar-button { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(279,70%,46%), hsl(276,75%,38%) 95%) !important; border: 1px solid #000000 !important; } #main-window #appmenu-toolbar-button:hover:not(:active):not([open]) { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(276,75%,38%), hsl(279,70%,46%) 95%) !important; border: 1px solid #000000 !important; } #main-window #appmenu-toolbar-button:hover:active, #main-window #appmenu-toolbar-button[open] { -moz-appearance: none !important; color: #FEEDFC !important; background: -moz-linear-gradient(hsl(276,75%,38%), hsl(276,75%,38%) 95%) !important; border: 1px solid #000000 !important; }
chrome
directory and userChrome.css
, if they do not already exist.Block ads
See floppymoose.com for an example of how to use userContent.css
as a basic ad-blocker.
Miscellaneous
Other tips and tweaks.
Mouse wheel scroll speed
To modify the default values (i.e. speed-up) of the mouse wheel scroll speed, go to about:config
and search for mousewheel.acceleration
. This will show the available options, modifying the following:
- Set
mousewheel.acceleration.start
to -1. - Set
mousewheel.acceleration.factor
to the desired number (10 to 20 are common values).
Alternatively you can install the SmoothWheel add-on.
Change the order of search engines in the Firefox Search Bar
To change the order search engines are displayed in:
- Open the drop-down list of search engines and click Manage Search Engines... entry.
- Highlight the engine you want to move and use Move Up or Move Down to move it. Alternatively, you can use drag-and-drop.
How to open a *.doc automatically with Abiword or LibreOffice Writer
Go to Preferences > Applications and search for Word Document (or Word 2007 Document for *.docx
). After finding it, click the drop-down list and select Use other.... From there you have to specify the exact path to the Abiword or Writer executable (i.e./usr/bin/abiword
or /usr/bin/lowriter
).
"I'm Feeling Lucky" mode
Some search engines have a feeling lucky feature. For example Google has "I'm Feeling Lucky" and DuckDuckGo has "I'm Feeling Ducky".
To activate them:
- Type
about:config
in the address bar. - Search for the string
keyword.url
. - Modify its value (if any) to the URL of the search engine.
For Google, set it to:
http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=
For DuckDuckGo, set it to:
https://duckduckgo.com/?q=\
For Google Encrypted (RCA-4 128bit High security encyption), set it to:
https://encrypted.google.com/search?btnI=I%27m+Feeling+Lucky&q=
Secure DNS with DNSSEC validator
You can enable DNSSEC support for safer browsing.
Adding magnet protocol association
In about:config
set network.protocol-handler.expose.magnet
to false.
The next time 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.
Prevent accidental closing
The Disable Ctrl-Q Shortcut extension can be installed to prevent unwanted closing of the browser.
An alternative is to add a rule in your window manager configuration file. For example in openbox add:
<keybind key="C-q"> <action name="Execute"> <execute>false</execute> </action> </keybind>
in the <keyboard> section of your rc.xml
file.
Plugins don't work with latest version
Due to Arch's bleeding edge nature, there can be some compatility issues with plugins not working with the latest Firefox install (ie Pentadactyl). If possible, try installing the nightly/beta builds available, or see Downgrading Packages.