Tame and upgrade Firefox: The Ultimate Guide
- Tutorial
- Recovery mode
Lyrical introduction
I do not like the race of versions, its senselessness remotely resembling an arms race. We did not have time to properly bring to mind the current version - they release a new one, with new bugs, vulnerabilities and "features". For people like me - lovers of stable and proven solutions for the corporate environment, and for myself too - the Mozilla team has an ESR assembly : for a long time, updates have been released for it that fix bugs and vulnerabilities, but the major version of the browser itself is not updated! Here is a link to the website page where you can download this wonderful ESR version (achieved by not-so-obvious moves), also, ESR can be downloaded from official FTP ftp.mozilla.org/pub/firefox/releases/latest-esr/
The 17th ESR version that I had been expecting had just been released a long time ago (the previous one was only the 10th). In connection with this event, I decided to write a detailed guide on optimizing our (not) favorite browser - with a parsing of all the parameters, what each of them does and where it came from.
Part 1. So Mozila did not slow down
1. To my surprise, I found: the characteristic inhibition, which many probably encountered, is caused by a built-in script that determines the system settings of the proxy .
If there is no proxy, we indicate this explicitly : "settings - additionally - network - connection" - "without proxy". If our fox works in a corporate environment - if possible, explicitly set the proxy or proxy.pac
2 script . Minimum additions(addons): we do not install unnecessary ones, of those that are installed, we keep included only those that are really needed. Remember: an extra plugin is an extra waste of computing resources when drawing each page. Actually plugins: we disable everything to the maximum, and first of all dotnet, DRM, java quick start. In a corporate environment, we take measures so that these plugins do not appear at all in the list of installed ones.
3. Volume limitation and automatic optimization of places database- places.sqlite file. The first is achieved by the max_pages parameter (see below), the second - (theoretically) happens regularly once a month. In modern versions of FF, unfortunately, the interface does not provide settings for limiting the storage time and the size of the page visiting history. Naturally, addons can fill this gap. As an alternative to forcing the restriction of the number of pages in history, I recommend the PlacesCleaner addon : it cleans and optimizes the database at a given interval (in days). If only frequent optimization is needed, and the number of pages has already been set rigidly through the config, the Vacuum Places Improved addon may be of interest .
4. Limiting the cache size to a reasonable size - explicitly specify in the settings (orvia pref ). I think it’s clear to everyone: gigabytes of files scattered across the disk and indexes will not increase all this speed.
Part 2. Getting rid of inappropriate content
Long gone are the days when the problem was loading, in fact, advertising banners in gif format. Now the evil is counters and centralized banner networks spying on the user, first of all: firstly, scripts that are heavier than the “payload” - the advertising graphics themselves, and secondly, centralized nature: the increased load on their server is and the case leads to a delay in loading their content, and not downloading it, the browser delays the rendering of the page - as a result, we wait even with fast Internet ... And the dominance of flash advertising? It represents “now”, compared with “then”, a disproportionately large problem: just look at how much memory the plugin-container process consumes is comparable to the browser itself:
The following are solutions to the problem of inappropriate content that are most interesting from a technical point of view:
1. The adblock add-on family is the most convenient and, as a result, a popular tool.
Details
Out of all their diversity, I recommend paying attention to 2: Adblock plus is the latest version of the add-on, and its alternative to Adblock edge. Advantages: they begin to block ads immediately after installation (“out of the box”), they can block any content (pictures, flash, scripts) and even remove the HTML containers specified in the blacklist directly from the page (by id, class ...), you can how to add ready-made subscriptions, and make your own rules.
Disadvantages: the added by default subscription RuAdlist + Easylist ( attention! ) Does not block counters; ready-made subscription rule sets are too long lists, which is fraught with waste of computing power and RAM; you need to learn your own Adblock syntax if you want to create your rule manually.
For an easy solution to the problem with counters, we add the “Against Counters ” list to the subscription : https://ruadlist.googlecode.com/svn/trunk/cntblock.txt , it is lightweight - 12 kb and is the only subscription mentioned here that does not lead to increase browser resource usage. But it does not block the google-analytics script, so you still need to add a rule.
There is also a BitBlock list - so that plugins from social networks are not loaded - Facebook like buttons, google +, etc., http://ruadlist.googlecode.com/svn/ trunk / bitblock.txt . All these additional filters can be set in 1 click on the page of their developer: https://code.google.com/p/ruadlist/
It must be remembered that subscriptions contain a huge number of rules, mostly unnecessary, which slows down loading of heavy and complex pages (such as search results for images in Yandex and Google), memory consumption increases: up to 120 Mb with three subscriptions versus 56 Mb with Adblock no rules (browser shows 1 tab with a blank page). If with a pair of straight arms we don’t want to sacrifice speed and waste extra memory, we delete all subscriptions (except, perhaps, “against the counters”) and create the rules ourselves: manually universal rules, and on frequently visited sites - in a visual mode, block all banners , primarily flash (the ad block has the ability to show a list of elements and sometimes create a rule by clicking directly on an unwanted element with a mouse click).* upd * And also about adblock plus: to improve performance, be sure to disable “count filter operations” in the settings (add-on button, drop-down menu)! Adblock shovels megabyte (in case of subscriptions) patterns.ini with each hit - looked there and was horrified. It is no coincidence that Adblock edge and adblock lite come with a filter count that is disabled by default. Read more about Adblock optimization here .
Disadvantages: the added by default subscription RuAdlist + Easylist ( attention! ) Does not block counters; ready-made subscription rule sets are too long lists, which is fraught with waste of computing power and RAM; you need to learn your own Adblock syntax if you want to create your rule manually.
For an easy solution to the problem with counters, we add the “Against Counters ” list to the subscription : https://ruadlist.googlecode.com/svn/trunk/cntblock.txt , it is lightweight - 12 kb and is the only subscription mentioned here that does not lead to increase browser resource usage. But it does not block the google-analytics script, so you still need to add a rule.
||google-analytics.com/ga.js
There is also a BitBlock list - so that plugins from social networks are not loaded - Facebook like buttons, google +, etc., http://ruadlist.googlecode.com/svn/ trunk / bitblock.txt . All these additional filters can be set in 1 click on the page of their developer: https://code.google.com/p/ruadlist/
It must be remembered that subscriptions contain a huge number of rules, mostly unnecessary, which slows down loading of heavy and complex pages (such as search results for images in Yandex and Google), memory consumption increases: up to 120 Mb with three subscriptions versus 56 Mb with Adblock no rules (browser shows 1 tab with a blank page). If with a pair of straight arms we don’t want to sacrifice speed and waste extra memory, we delete all subscriptions (except, perhaps, “against the counters”) and create the rules ourselves: manually universal rules, and on frequently visited sites - in a visual mode, block all banners , primarily flash (the ad block has the ability to show a list of elements and sometimes create a rule by clicking directly on an unwanted element with a mouse click).* upd * And also about adblock plus: to improve performance, be sure to disable “count filter operations” in the settings (add-on button, drop-down menu)! Adblock shovels megabyte (in case of subscriptions) patterns.ini with each hit - looked there and was horrified. It is no coincidence that Adblock edge and adblock lite come with a filter count that is disabled by default. Read more about Adblock optimization here .
2. noscript, yesscript - blocking scripts, helps to defeat such evil as scripts counter and banner networks.
Details
noscript works on the principle of a white list, there is a predefined whitelist, yesscript - on the principle of a black list.
Disadvantages for noscript: specialization in blocking scripts, the impossibility of compromise: blocks scripts even for the domain of the page open on this tab, which will necessarily spoil the performance of many sites, and if the daw is set to "fully allow javascript execution" (in my opinion, the only acceptable mode) and adding individual scripts (for example, counters) to the black list - it is impossible to see the black list in the settings (or set it in advance). Well, yesscript - which implements an adequate blacklist algorithm - due to the scarcity of settings, even a fan of minimalism can disappoint: there is only a list of urls (reg. Expressions?) Scripts from where should be blocked, you need to create it yourself. For comparison: Adblock, if you use only self-written rules in it, it will also block the script, but besides him, there are also pictures, and flash, and entire blocks of HTML code right in the page. The difference is obvious.
Disadvantages for noscript: specialization in blocking scripts, the impossibility of compromise: blocks scripts even for the domain of the page open on this tab, which will necessarily spoil the performance of many sites, and if the daw is set to "fully allow javascript execution" (in my opinion, the only acceptable mode) and adding individual scripts (for example, counters) to the black list - it is impossible to see the black list in the settings (or set it in advance). Well, yesscript - which implements an adequate blacklist algorithm - due to the scarcity of settings, even a fan of minimalism can disappoint: there is only a list of urls (reg. Expressions?) Scripts from where should be blocked, you need to create it yourself. For comparison: Adblock, if you use only self-written rules in it, it will also block the script, but besides him, there are also pictures, and flash, and entire blocks of HTML code right in the page. The difference is obvious.
3. imglikeopera - a very interesting plugin, unfairly deprived of popularity. Blocks pictures and flash.
Details
The idea is borrowed from the Opera - a button that controls the display of images.
Advantages: able to forcibly cache graphic content for a long time, supports regular expressions. Disadvantages: it does not contain predefined rule sets - everything is set manually, does not control scripts (but was experimentally dopped by me to add this feature - it makes mixed impressions), it adds extra parameters “ilo-full-src” to the source code of the page and when you save the pages they are there.
Advantages: able to forcibly cache graphic content for a long time, supports regular expressions. Disadvantages: it does not contain predefined rule sets - everything is set manually, does not control scripts (but was experimentally dopped by me to add this feature - it makes mixed impressions), it adds extra parameters “ilo-full-src” to the source code of the page and when you save the pages they are there.
4. plugins.click_to_play configuration parameter
Details
and the simplest switch-plugins_click_to_play addon , which creates a button that controls this parameter. A very effective and compatible with previous solutions way to eliminate memory eats and processor loading of flash content in the face of the plugin-container process. When click_to_play is on, a gray block appears on the flash banner with the inscription “click here to enable the plug-in”, and a notification appears at the beginning of the address bar, clicking on which you can configure the plug-in to run for this site.
Part 3. Correct default settings
The easiest way to deploy FF with the given settings is to put a js-file similar to prefs.js in your profile in the directory [path to install FF] / defaults / preferences . I call it the same as in the profile - prefs.js, but the name is not important, the main thing is that there is a .js extension
So, we create a js-file with the following contents:
* upd *
# Mozilla User Preferences
pref("app.update.enabled", false);
pref("browser.cache.memory.max_entry_size", 256);
pref("browser.cache.memory.capacity", 4096);
pref("browser.display.show_image_placeholders", false);
pref("browser.download.manager.retention", 1);
pref("browser.download.useDownloadDir", false);
pref("browser.feeds.showFirstRunUI", false);
pref("browser.newtabpage.enabled", false);
pref("browser.places.importBookmarksHTML", false);
pref("browser.privatebrowsing.dont_prompt_on_enter", true);
pref("browser.rights.3.shown", true);
pref("browser.safebrowsing.enabled", false);
pref("browser.safebrowsing.malware.enabled", false);
pref("browser.search.update", false);
pref("browser.sessionhistory.max_total_viewers", 1);
pref("browser.shell.checkDefaultBrowser", false);
pref("browser.startup.page", 0);
pref("browser.tabs.animate", false);
pref("browser.xul.error_pages.expert_bad_cert", true);
pref("config.trim_on_minimize", true);
pref("dom.event.contextmenu.enabled", false);
pref("extensions.blocklist.enabled", false);
pref("extensions.shownSelectionUI", true);
pref("extensions.update.enabled", false);
pref("extensions.update.notifyUser", false);
pref("extensions.pendingOperations", false);
pref("geo.enabled", false);
pref("gfx.direct2d.force-enabled", true);
pref("gfx.font_rendering.directwrite.enabled", true);
pref("layers.acceleration.force-enabled", true);
pref("intl.charsetmenu.browser.cache", "windows-1251, UTF-8");
pref("intl.charset.default", "windows-1251");
pref("intl.charsetmenu.browser.cache.size", 2);
pref("network.cookie.prefsMigrated", true);
pref("network.dns.disableIPv6", true);
pref("network.http.pipelining", true);
pref("network.http.pipelining.max-optimistic-requests", 2);
pref("network.http.proxy.pipelining", true);
pref("network.http.request.max-start-delay", 1);
pref("network.prefetch-next", false);
pref("places.history.expiration.max_pages", 400);
pref("plugins.hide_infobar_for_outdated_plugin", true);
pref("privacy.donottrackheader.enabled",true);
pref("security.warn_entering_weak", false);
pref("security.warn_viewing_mixed", false);
pref("toolkit.telemetry.prompted", true);
There can be several js files in defaults / preferences. This is convenient: the optional parameter block is localized in a separate file, it can be attached to a specific PC on the network or removed from there.
It is easy to make your FF distribution kit for Windows with the correct settings: we unpack the installer, you can safely delete the win32 directory, the core directory contains what is written to program files. We put our js file with the correct settings in core \ defaults \ preferences. You can immediately remove maintenanceservice_installer.exe and maintenanceservice.exe - we do not clog the PC with unnecessary services. The resulting unpacked distribution can be installed manually or deployed in all possible ways - just like the original exe distribution: setup.exe accepts all the same keys.
Part 4. Details on what each parameter does
Sources:
{1} solution found by me
{2} www.latestonnet.com/2012/01/17/optimize-firefox-to-run-4-times-faster-than-before.html
{3} sonikelf.ru/optimizuruem -firefox
{4} egonitron.com/2007/05/25/the-truth-about-the-firefox-pipelining-trick
{5} techlogon.com/2012/12/02/how-to-speed-up-firefox -tweaking-guide
Original source (though for older versions): http://kb.mozillazine.org/Category:Preferences
To start with about the strategy . Unlike many
1) we prevent the causes of “brakes”
2) disable all unnecessary and interfering functionality - notifications,
3) memory saving
4) enable HTTP 1.1, but without extremism
no annoying updates without asking
pref("app.update.enabled", false);
pref("browser.search.update", false);
pref("extensions.update.enabled", false);
pref("extensions.update.notifyUser", false);
pref("extensions.pendingOperations", false);
pref("extensions.blocklist.enabled", false);
{1}memory optimization
unloading memory pages when minimizing the window {3}
Attention: browser.cache.memory.capacity = 4096 means that 4 MB will be allocated to the cache in memory (value in KB). If there is obviously a lot of free memory, it is rational to set values many times larger. On the other hand, the minimum cache size means that everyone in the corporate environment will run out of memory ...
browser.cache.memory.max_entry_size means the maximum size of the object cached into memory (value in kb). In theory, the smaller the more efficiently the memory is consumed. Often (as in {3}) are mistaken for a parameter that determines the size of the cache itself. Confirmation of my words is in the browser itself, look here: about: cache? Device = memory
It can be seen that the browser.cache.memory.capacity we set is displayed exactly in the "Maximum storage size" line.
pref("browser.sessionhistory.max_total_viewers", 1);
the number of pages stored in RAM for a quick jump backward - by reducing the value we save memory; recommend setting 0, but I (as in {2} ) consider it to be optimum 1: in the vast majority of cases, we need to return exactly 1 step, and here the fox will please us with its speed;pref("browser.cache.memory.max_entry_size", 256);
pref("browser.cache.memory.capacity", 4096);
pref("config.trim_on_minimize", true);
RAM cache size {1} , {3}unloading memory pages when minimizing the window {3}
Attention: browser.cache.memory.capacity = 4096 means that 4 MB will be allocated to the cache in memory (value in KB). If there is obviously a lot of free memory, it is rational to set values many times larger. On the other hand, the minimum cache size means that everyone in the corporate environment will run out of memory ...
browser.cache.memory.max_entry_size means the maximum size of the object cached into memory (value in kb). In theory, the smaller the more efficiently the memory is consumed. Often (as in {3}) are mistaken for a parameter that determines the size of the cache itself. Confirmation of my words is in the browser itself, look here: about: cache? Device = memory
It can be seen that the browser.cache.memory.capacity we set is displayed exactly in the "Maximum storage size" line.
wean from unnecessary questions
pref("browser.shell.checkDefaultBrowser", false);
no annoying suggestions to become the default browser {1}pref("browser.feeds.showFirstRunUI", false);
pref("browser.rights.3.shown", true);
pref("extensions.shownSelectionUI", true);
pref("toolkit.telemetry.prompted", true);
pref("browser.places.importBookmarksHTML", false);
pref("browser.privatebrowsing.dont_prompt_on_enter", true);
firefox doesn’t show self-promotion and unnecessary reminders on first launch {1}counteract the collection of information
send the header "do not track" {1}
pref("geo.enabled", false);
pref("browser.safebrowsing.enabled", false);
pref("browser.safebrowsing.malware.enabled", false);
pref("privacy.donottrackheader.enabled",true);
disabling Google spying and checking URLs for phishing - speeds up the work: the browser makes fewer moves {1}send the header "do not track" {1}
usability interface
forbid sites to turn off the context menu {1} the
fox doesn’t spoil itself while downloading the question is asked where to download {1} we
clear the download history when exiting ff {1} we
limit the maximum number of guaranteed saved records in the history of up to 400: this approach places limited database size without plugins - only possible on modern versions of FF (understood from the sources and confirmed experimentally) {1}
in a new tab shows the default blank page without a tie s {1}
disable animations tabs {5}
do not show the space for pictures - accelerates drawing{5}
optional: do not load plugins automatically - fix the problem of gluttonous flash content {1}
pref("browser.startup.page", 0);
pref("dom.event.contextmenu.enabled", false);
pref("browser.download.manager.retention", 1);
pref("browser.download.useDownloadDir", false);
pref("places.history.expiration.max_pages", 400);
pref("browser.newtabpage.enabled", false);
pref("browser.tabs.animate", false);
pref("browser.display.show_image_placeholders", false);
open a blank page by default - ideal for the corporate environment {1} weforbid sites to turn off the context menu {1} the
clear the download history when exiting ff {1} we
limit the maximum number of guaranteed saved records in the history of up to 400: this approach places limited database size without plugins - only possible on modern versions of FF (understood from the sources and confirmed experimentally) {1}
in a new tab shows the default blank page without a tie s {1}
disable animations tabs {5}
do not show the space for pictures - accelerates drawing{5}
pref("plugins.click_to_play",true);
graphics hardware acceleration
pref("gfx.direct2d.force-enabled", true);
pref("gfx.font_rendering.directwrite.enabled", true);
pref("layers.acceleration.force-enabled", true);
forced use of a graphics accelerator: the browser is more demanding on a video driver and GPU than games !? We say a solid "no" to this misunderstanding! {1}encodings
by default page encoding {1}
how many character sets are cached (default 5) {1}
pref("intl.charsetmenu.browser.cache", "windows-1251, UTF-8");
pref("intl.charset.default", "windows-1251");
pref("intl.charsetmenu.browser.cache.size", 2);
which character sets are cached by default page encoding {1}
how many character sets are cached (default 5) {1}
network settings
disables anyone here who doesn’t need IPv6 to
enable HTTP1.1 (multiple requests in one connection) for direct connections and through proxies, respectively.
the delay before exceeding the allowable number of keep-alive connections, the default is 10 (sec), 0 is recommended in {2}, I think it is better to set not 0, but 1, while retaining some delay,
decrease max-optimistic-requests from 4 to 2 by the results of my experiments eliminates the delay in opening pages when working through HTTP1.1;
recommend increasing from 6 (default) to 8 max. the number of permanent connections to 1 server, which I personally do not recommend; on the contrary, you can try lowering to 4 or even 2 (as in IE5 and 6, which never had problems with HTTP1.1);
disabling preloading of the following pages, in a corporate environment - the desired setting
pref("network.dns.disableIPv6", true);
pref("network.http.pipelining", true);
pref("network.http.proxy.pipelining", true);
pref("network.http.request.max-start-delay", 1);
pref("network.http.pipelining.max-optimistic-requests", 2);
# опционально, экспериментально
# pref("network.http.max-persistent-connections-per-server", 8);
# pref("network.prefetch-next", false);
{1-5}disables anyone here who doesn’t need IPv6 to
enable HTTP1.1 (multiple requests in one connection) for direct connections and through proxies, respectively.
the delay before exceeding the allowable number of keep-alive connections, the default is 10 (sec), 0 is recommended in {2}, I think it is better to set not 0, but 1, while retaining some delay,
decrease max-optimistic-requests from 4 to 2 by the results of my experiments eliminates the delay in opening pages when working through HTTP1.1;
recommend increasing from 6 (default) to 8 max. the number of permanent connections to 1 server, which I personally do not recommend; on the contrary, you can try lowering to 4 or even 2 (as in IE5 and 6, which never had problems with HTTP1.1);
disabling preloading of the following pages, in a corporate environment - the desired setting
"security"
improve usability in the warning about a self-signed certificate - save clicks (this warning has not yet been completely removed) {1}
pref("security.warn_entering_weak", false);
pref("security.warn_viewing_mixed", false);
pref("browser.xul.error_pages.expert_bad_cert", true);
disabling useless questions about weak encryption and mixed content, to which all users will still answer “yes” {1}improve usability in the warning about a self-signed certificate - save clicks (this warning has not yet been completely removed) {1}
page rendering
often recommend content.notify.backoffcount = 5, but no one says that you still need to enable content.notify.ontimer so that the first setting affects something
(experimentally, I quote this block due to the fact that previously it was pref("content.notify.backoffcount", 5);
pref("content.notify.ontimer", true);
pref("content.interrupt.parsing", true);
pref("content.notify.interval", 750000);
low-level settings for rendering pages before they load; often recommend content.notify.backoffcount = 5, but no one says that you still need to enable content.notify.ontimer so that the first setting affects something
constantly recommended content.notify.backoffcount = 5)
todo : find a way to wean FF to swear at an invalid certificate, but so far I have not found such a setting