MozillaZine

Editing configuration

From MozillaZine Knowledge Base

(Difference between revisions)
Revision as of 11:01, 9 May 2006
Rod Whiteley (Talk | contribs)
(Add troubleshooting section)
<-- Previous diff
Current revision
Chealer (Talk | contribs)
(Modifying preferences - 2008's "recent" is not so recent anymore)
Line 1: Line 1:
-Mozilla applications are highly customizable, and there are a number of standard ways to change their appearance and behaviour. Basic settings can be changed using the application's dialog boxes. The main Options or Preferences dialogs can be reached from the "Tools" or "Edit" menus. (See [[menu differences in Windows, Linux, and Mac]].)+Mozilla applications are highly customizable, and there are a number of ways to change their appearance and behavior, such as through [https://addons.mozilla.org extensions and themes]. Basic settings can be changed using the application's own dialog boxes. The main Options or Preferences dialogs can be reached from the "Tools" or "Edit" menus (see [[menu differences in Windows, Linux, and Mac]]).
-==Modifying preferences&mdash;adding, removing and setting==+This article describes more advanced methods of customizing Mozilla applications, by editing the configuration files.
-To make more advanced changes to the application&rsquo;s behaviour&mdash;in particular, if you have been instructed to &ldquo;set a preference&rdquo;&mdash;you should either edit the [[user.js file]], or use the [[about:config]] interface. Note that whilst it is often quicker to use about:config, editing the "user.js" file has the advantage of portability: your preferences will never be overridden, and they can be transferred to a different profile, or backed up for safe keeping.+
-==Modifying appearance==+==Modifying preferences==
-To modify the way in which Web pages and e-mails are displayed, you should edit the [[userContent.css]] file. To modify the appearance of the application itself, you should edit the [[userChrome.css]] file.+Preference settings that are modified from default values are saved in the [[prefs.js file]]. Instead of directly editing this file, Mozilla applications include a configuration editor that can be accessed from the application interface.
-==Editor settings==+=== [[about:config]] ===
-To edit configuration files, you might need to check your text editor's settings so that your editor saves files using the correct file type and character encoding.+To modify a preference in a browser application such as Firefox or SeaMonkey, type '''about:config''' into the Location Bar (address bar) and press Enter. In Thunderbird, choose [[Menu differences in Windows, Linux, and Mac|Tools –> Options]] –> Advanced –> General and press the Config Editor... button.
-===File type===+You will be brought to a long list of [[:Category:Preferences|preferences]]. To change an existing preference, double click on it. To add a new preference, context click (right-click on most systems) anywhere and choose New and the type of preference. You will be prompted for the preference name and initial value. For more detailed information, see the [[about:config]] article.
-Ensure that your editor saves plain text files.+
-Some editors can ''only'' save plain text files. These editors have no +While it's easier to use about:config for a single profile, it may be easier to use a [[user.js file]] if you need to make the same changes in many profiles (see the linked article for more information).
-setting for the type of file.+
-Some editors can save various types of file. In this case, ensure that your+=== Developer Toolbar ===
-editor saves configuration files as plain text.+Starting in Firefox 16 [https://hacks.mozilla.org/2012/08/new-firefox-command-line-helps-you-develop-faster/], now you can modify preferences from [https://developer.mozilla.org/docs/Tools/GCLI Developer Toolbar] (Tools -> Web Developer -> Developer Toolbar) using the command line
 + pref set ''<preference name>'' ''<value>''
 +for example
 + pref set [[javascript.enabled]] false
 +To reset a preference to its default value, use command line
 + pref reset ''<preference name>''
 +To show current value of a preference, use command line
 + pref show ''<preference name>''
-Some editors recognize file names ending in <tt>.css</tt> and <tt>.js</tt>+==Modifying appearance==
-as CSS and JavaScript files respectively. These editors automatically save +To modify the way in which Web pages and e-mails are displayed, you should edit the [[userContent.css]] file. To modify the appearance of the application itself, you should edit the [[userChrome.css]] file.
-these files as plain text.+
-===Character encoding===+==How to edit configuration files==
-Configuration files use the UTF-8 character encoding (also known as character +===ChromEdit extension===
-set or charset), but you do not always need to use a text editor that supports+The [http://webdesigns.ms11.net/chromeditp.html ChromEdit Plus] extension provides a convenient way of editing your configuration files.
-UTF-8.+ChromEdit Plus is an unofficial, updated version of the original [https://addons.mozilla.org/firefox/17 ChromEdit] extension [http://cdn.mozdev.org/chromedit/], with more features.
 +<!-- The [https://addons.mozilla.org/firefox/17 ChromEdit] extension [http://cdn.mozdev.org/chromedit/] provides a convenient way of editing your configuration files. As of June 2006, ChromEdit is not officially available for current Mozilla application versions. -->
-For most purposes you only need to use basic English letters and symbols +===Manual editing===
-([http://en.wikipedia.org/wiki/ASCII ASCII]) in your configuration files.+If instead you choose to edit your configuration files using your own text editor, you should consult the [[Editing configuration/Manual editing | Manual editing]] advice.
-In these cases, you can use almost any +
-character encoding except Unicode. If your text editor does not have any +
-setting for character encoding, then you can probably use it for ASCII +
-characters.+
-For some purposes you need to type accents or other characters that are not+==Troubleshooting==
-ASCII. If your text editor is set to use UTF-8, then simply type the +If you experience problems when editing configuration files, consult the [[Editing configuration/Troubleshooting | Troubleshooting]] article.
-characters that you need.+
-If your editor does not support UTF-8, or if you cannot type the special +==See also==
-characters that you need, then encode each special character using its +*[[Modify Thunderbird settings]]
-hexadecimal Unicode representation. In <tt>.css</tt> files, use a backslash+*[[Resetting preferences]]
-followed by hexadecimal digits. In <tt>.js</tt> files, use <tt>\u</tt> +
-followed by exactly four hexadecimal digits.+
- +
-For example, you can encode an information sign followed by a non-breaking +
-space like this:+
- +
-''In <tt>userContent.css</tt>:''+
- :link:before {content: "\2139\a0";}+
- +
-''In <tt>user.js</tt>:''+
- user_pref("mailnews.reply_header_ondate", "\u2139\u00a0 On %s");+
- +
-===Checking your editor===+
-To check your text editor, create a plain text file named <tt>test.txt</tt>.+
-In the file, type some of the accents and special characters that you need.+
-Save the file somewhere on your computer.+
- +
-Open the file in your web browser. For example, in Firefox choose File &ndash;+
-Open File... and select the file, or drag the file's icon and drop it in +
-Firefox.+
- +
-Set your browser's character encoding to UTF-8. For example, in Firefox choose +
-View &ndash; Character Encoding &ndash; Unicode (UTF-8). Check that your +
-browser displays the file correctly with this setting.+
- +
-== Troubleshooting ==+
-If you make changes to a configuration file but the changes seem to have no effect,+
-here are some common causes that you can check:+
- +
-<ul>+
-<li>You edited the wrong file, or created the file in the wrong place.</li>+
-<p>+
-Check that you found the [[profile folder | profile]] that is actually being+
-used by the application, not some other profile, and ''not'' the application's +
-[[installation directory]].</p>+
-<p>+
-Check that CSS files are in the <tt>chrome</tt> +
-directory in the profile, not in the profile directory itself.</p>+
-<li>The file contains errors.</li>+
-<p>+
-If you found the preference settings or CSS rules or on a web page, +
-copy and paste from the web page to avoid typing errors.</p>+
-<p>+
-If you have to edit the content, ensure that you preserve the correct punctuation.</p>+
-<p>+
-Check that the font in your text editor makes it easy for you to+
-see the difference between parentheses <tt>()</tt>, square brackets <tt>[]</tt>+
-and curly braces <tt>{}</tt>, and between colon <tt>:</tt> and semicolon+
-<tt>;</tt>.</p>+
-<p>+
-In the application, choose Tools &ndash; JavaScript Console... +
-(or Tools &ndash; Web Development &ndash; JavaScript Console...) to see+
-error messages.</p>+
-<p>'''Note:&nbsp;''' The JavaScript console does not always show errors relating to preference settings..+
-In recent versions of some Mozilla applications, it does show CSS errors.</p>+
-<li>CSS rules are being overridden by other rules.</li>+
-<p>+
-Try adding <tt>!important</tt> to any CSS rule that has no effect. Add it+
-just before the semicolon at the end of the rule.</p>+
-<p>+
-If you are using a theme that you installed, try the CSS rules with the application's default theme.</p>+
-</ul>+
==External links== ==External links==
-<ul>+* [http://www.mozilla.org/support/thunderbird/edit Editing Configuration Files (Thunderbird Help)]
-<li>The [https://addons.mozilla.org/extensions/moreinfo.php?id=17 ChromEdit] extension provides a convenient way of editing configuration files.+* [http://www.mozilla.org/unix/customizing.html Customizing Mozilla]
-<p>''At the time of writing (May 2006) ChromeEdit is not officially available for current versions of Mozilla aapplications, but an unofficial [http://home.iitk.ac.in/~anupamsr/chromedit.xml updated version] is available.''</p></li>+
- +
-<li>The [https://addons.mozilla.org/extensions/moreinfo.php?id=2108 Stylish extension] provides another way to change styles. It does not use userContent.css or userChrome.css, and changes take effect without restarting the application.</li>+
-</ul>+
- +
-* [https://addons.mozilla.org Extensions and themes] provide many additional features and allow you to change the way your application looks.+
-* [http://www.mozilla.org/support/firefox/edit Editing Configuration Files] at Firefox Help+
-* [http://www.mozilla.org/support/thunderbird/edit Editing Configuration Files] at Thunderbird Help+
[[Category:Configuration]] [[Category:Configuration]]

Current revision

Mozilla applications are highly customizable, and there are a number of ways to change their appearance and behavior, such as through extensions and themes. Basic settings can be changed using the application's own dialog boxes. The main Options or Preferences dialogs can be reached from the "Tools" or "Edit" menus (see menu differences in Windows, Linux, and Mac).

This article describes more advanced methods of customizing Mozilla applications, by editing the configuration files.

Contents

Modifying preferences

Preference settings that are modified from default values are saved in the prefs.js file. Instead of directly editing this file, Mozilla applications include a configuration editor that can be accessed from the application interface.

about:config

To modify a preference in a browser application such as Firefox or SeaMonkey, type about:config into the Location Bar (address bar) and press Enter. In Thunderbird, choose Tools –> Options –> Advanced –> General and press the Config Editor... button.

You will be brought to a long list of preferences. To change an existing preference, double click on it. To add a new preference, context click (right-click on most systems) anywhere and choose New and the type of preference. You will be prompted for the preference name and initial value. For more detailed information, see the about:config article.

While it's easier to use about:config for a single profile, it may be easier to use a user.js file if you need to make the same changes in many profiles (see the linked article for more information).

Developer Toolbar

Starting in Firefox 16 [1], now you can modify preferences from Developer Toolbar (Tools -> Web Developer -> Developer Toolbar) using the command line

pref set <preference name> <value>

for example

pref set javascript.enabled false

To reset a preference to its default value, use command line

pref reset <preference name>

To show current value of a preference, use command line

pref show <preference name>

Modifying appearance

To modify the way in which Web pages and e-mails are displayed, you should edit the userContent.css file. To modify the appearance of the application itself, you should edit the userChrome.css file.

How to edit configuration files

ChromEdit extension

The ChromEdit Plus extension provides a convenient way of editing your configuration files. ChromEdit Plus is an unofficial, updated version of the original ChromEdit extension [2], with more features.

Manual editing

If instead you choose to edit your configuration files using your own text editor, you should consult the Manual editing advice.

Troubleshooting

If you experience problems when editing configuration files, consult the Troubleshooting article.

See also

External links