< Day Day Up > |
about:config, Firefox's Configuration Consoleabout:config is the most powerful way to set options, configuration settings, and preferences (let's just use the term preferences from now on). It has a simple interface, has a search capability, and is capable of working with each of the preference data types. It is an important feature of Firefox because it enables many preferences to be changed that might not easily be set. Certainly it lets you edit prefs.js (refer to Chapter 4, "Managing Profiles," for more on prefs.js and user.js). However, about:config enables you to change settings while Firefox is running, right in the browser, making things much easier and more manageable. This section covers about:config. Chapter 4 briefly described about:config. In this section, we will examine about:config completely and give examples of how it can be used to modify preferences that are not otherwise accessible. Back Up Before Disaster!Prior to making any changes with about:config, it is vital that you make a backup of your configuration! If you change something that causes Firefox to act unpredictably or to crash, you need to have a way to recover. All your alterable files are stored in your profile. This profile can be backed up in its entirety, or you can choose to only back up the critical components. I recommend a full backup of your profile because this enables you to quickly return to the state that Firefox was in when the backup was made. First and this is important close Firefox! Firefox updates the profile when closing and does other housekeeping tasks. You want everything to be stable before backing up. Take a look at Figure 9.4. In this figure my Firefox profile is named xrjy2cro.default. On May 17, I made two backup copies of this profile. Then on May 18, I made a new backup. To back up, I simply did a right button drag-and-drop and selected Copy Here from the pop-up prompt. (Don't select Create Shortcuts Here because this will not make copies of any files in the profile!) Figure 9.4. Drag and drop with the right button in Windows Explorer to make a copy of your profile.Windows won't give me a name that I am happy with, so I renamed my backups using a date and other text to indicate when the backup was made and what the original filename or folder name was. An offline backup, such as to a CD-R or CD-RW disc, keeps this information safe in case of a major hardware failure. Note The previous example's illustration is for Windows XP. If you are using another version of Windows or another operating system, refer to Chapter 4 for information about finding and backing up the profile. Now, say I destroy my profile by doing something wrong in about:config. I can rename my original profile (in this case xrjy2cro.default) to a different name, saving it just in case the restore fails. Then I can copy not rename one of my backups to the original profile name. (I copy so that I don't lose or overwrite my profile backup.) A new or unused profile contains only a few files. As a profile is used, however, it quickly grows in size. Most of the growth is due to the disk cache. You can reduce the size of a profile by clearing the cache by selecting Tools, Options from the menu. Then click Privacy and click the Clear button next to Cache. Caution Extensions and themes are installed as part of a profile. When you restore a profile from a copy made before installing an extension or a theme, that extension or theme is inaccessible until it is reinstalled. Of course, it is important to not restore any extension or theme that caused Firefox to fail! Understanding the about:config DisplayThe about:config user interface is very simple (see Figure 9.5). Don't be fooled, though; it is still powerful and its simplicity makes it easy to use. Figure 9.5. about:config displays just like a web page in Firefox.In about:config is an edit box where you can enter a keyword, characters, or anything you want to filter by. A Show All button also appears in this box and is active whenever you have used a filter; this turns off the previous filter. The data in about:config is arranged in four columns:
The final piece of the about:config user interface is a pop-up context menu. This menu, shown in Figure 9.6, is displayed whenever a preference is right-clicked. Figure 9.6. The about:config pop-up context menu allows modification of a preference's value and creating a new preference.The about:config pop-up context menu provides the following functionalities:
Adding New PreferencesAll this makes it seem like every possible preference that can be set in Firefox has been included in about:config. This is not true, however. In all, thousands of preferences can be set in Firefox; this does not include the thousands of preferences that are part of extensions. With that in mind, you can see that Firefox's about:config lists only a handful of the more popular preferences. One Firefox installation with several extensions installed had about 900 preferences, and another installation with nothing installed still had more than 600 preferences in about:config. Filtering and Sorting the about:config DisplayWith hundreds, possibly thousands, of preferences that can be set in Firefox, searching by hand could be somewhat tedious. You have the ability to sort on any of the columns about:config has (Preference Name, Status, Type, and Value), which helps, but manual searching can still be difficult. Instead of manually searching for a preference, you can use the Filter box. In that box, type characters or words you want to see in a preference name. (You can't filter on preference values at least not at the time this was written.) Note Why would you add preferences? In fact, many preferences that affect Firefox's operation are not present by default, and a few preferences listed don't do much of anything they're simply holdovers from earlier versions of Mozilla or Netscape. There is no exhaustive list of all the Firefox preferences. One of my future projects is to write routines that walk the Firefox source, looking for and flagging all preferences, and create a cross-reference of them. This is not the type of task that could be done manually, though, because preferences come and go. As you type characters, about:config eliminates any preferences that do not have the characters you typed. For example, let's say I wanted to see all preferences that had the word proxy in them. As I typed (first a p, then the r, an o, and the x), Firefox would eliminate preferences. So, finally, with prox (I didn't type the y), I would see only 20 matching preferences (see Figure 9.7). Figure 9.7. I've typed prox in the filter box and now only have to look at about 20 preferences instead of the 600+ I started with.When I'm done with the filtered preferences, I can either clear the Filter box or just click the Show All button at the right end of the Filter box. It's that easy. Using Caution with about:configThe about:config feature is a great interface, but in reality there is virtually no error-checking for preferences. You can enter virtually any value you might be able to type. In fact, if you create a new preference and choose the wrong data type, the odds are you cannot insert the correct value even if you try! Because there is no error-checking on the values you enter, pay particular attention to what was originally stored in the preference. Write down the original value (or do a screen print that's what I do) so you can restore the preference to what it was before you changed it. After you have created a preference in about:config, it can be removed only by manually editing prefs.js. And, if all else fails, simply restore the backup you made just before changing anything with about:config! Modifying Preferences with about:configMost of the common configuration settings and preferences can be configured using Firefox's Options dialog box, and I strongly recommend trying that first before using about:config. However, with the Options dialog box, you are at the mercy of the Firefox developers as to which preferences are important enough to include in that dialog box. Therefore, you might have to use about:config to modify a preference. To modify a preference using about:config, do the following:
Preferences that are Boolean and which are set to a value (a Boolean value can be blank, although that is not recommended) can be toggled with a double-click on the preference name. Double-clicking an integer or a string preference displays an edit dialog box where you can edit or replace the existing data with your desired changes. Changing Hidden and Undocumented OptionsA few really useful preferences are not in about:config but really should be! Thank goodness you can add these preferences and gain even more functionality with Firefox. We'll look at some of these preferences in this section. A few interesting preferences you can set in about:config follow. browser.tabs.showSingleWindowMpdePrefs This preference is a Boolean value that adds options to the Firefox Options dialog box. Setting this preference to true adds a new section named Force Links That Open New Windows to Open in to the Options dialog box's Advanced Tabbed Browsing section. This new section contains two options: The Same Tab/Window As the Link and A New Tab. browser.link.open_newwindow.restriction Note There is a wealth of information about preferences in the file all.js, part of the source code package. Download the Firefox source code, open the folder modules\libpref\src\init, and edit the all.js file with WordPad. Many of the preferences that take an integer value are documented in this file, with comments showing each valid value and its effect. This preference is in about:config already. However, it is not well documented without digging through the source or the Internet. Possible values for this preference are
browser.xul.error_pages.enabled When Internet Explorer encounters an error, it displays an error page in the browser window. Firefox, by default, displays an error message box that must be dismissed, requiring extra mouse movement and an extra click. You can tell Firefox to display errors as a page by setting this property to TRue (the default value is false). This property should already be in your about:config. browser.throbber.url The throbber (that funny space at the far right of the menu bar) can be clicked. When clicked, it takes you by default to Mozilla's Firefox home page. You can change the URL to anything you want by changing this preference's string value. Just make sure it's a fully formed URL! browser.blink_allowed The blinking text attribute, which does not do anything in Internet Explorer, causes text to blink. Many users find this annoying. If you set this preference to false, you turn off a web page's capability to display blinking text. layout.frames.force_resizability This preference enables you to make all frames resizable, by default. This preference is great when the web designer has failed to include enough room for the frame's content. Setting this preference to true makes frames resizable; however, it can also make some pages look odd because all the frames will have a fixed width border. |
< Day Day Up > |