Locating Your Profile

 < Day Day Up > 

Each user typically has a personal profile located in a predefined location, depending on the operating system. The following list shows the profile settings for a number of operating system platforms:

  • Windows XP/2000 Profile files are typically located in the folder %AppData%\Mozilla\Firefox\Profiles\xxxxxxxx.default\. With Windows Explorer, go to C:\Documents and Settings\[User Name]\Application Data\Mozilla\Firefox\Profiles\, where [User Name] is the user whose profile you are navigating to. (Note that Application Data is normally a hidden file, so you must turn on the hidden file display to see it.)

  • Windows 95, 98, and Me The profile files are often located in C:\WINDOWS\Application Data\Mozilla\Firefox\Profiles\xxxxxxxx.default\. Because these versions of Windows do not properly support multiple users, only one profile is stored.

  • Linux Look for the folder path ~/.mozilla/firefox/xxxxxxxx.default/.

  • Mac OS X Look for the folder path ~/Library/Application Support/Firefox/Profiles/xxxxxxxx.default/.

A default installation of Firefox has more than 100 files in the profile location. Most can be safely ignored; some, however, are important to us.

Note

The characters xxxxxxxx in the previous profile names represent a string of random characters (numbers and letters). This serves a dual purpose. First, it ensures that the profile for one installation does not overwrite another profile. Second, it helps protect the profile from attacks or exploitation by rogue applications. When Firefox is installed, it creates an initial profile with an extension of .default. When you create new profiles, the extension for your new profile will be the same as the profile name and not default.


Configuration File: user.js

The main profile configuration file is called user.js. This file contains various preferences the user can set. A preference is a Firefox option. For example, the color of a hyperlink in a web page can be set with the preference browser.anchor_color.

Firefox only reads user.js and never writes to it. (When Firefox writes preference changes, they are written to prefs.js.)

The user.js file, by default, is not created by the Firefox installation process; you need to create it using Notepad or some other suitable text editor. I recommend avoiding word processing editors (such as Word) because they can leave undesirable characters and formatting in the file.

Note

When you have a user.js file and you set a preference in it, this preference can be migrated to prefs.js by Firefox.


Preferences stored in user.js are loaded whenever Firefox is started. If user.js is modified while Firefox is running, the changes take place the next time Firefox is restarted.

All the parameters you can configure in user.js can also be set by typing about:config in Firefox's Location bar. This displays the Firefox configuration page.

Creating a user.js File in Windows

You should already know how to create a file in your operating system. However, if you are unsure of how to create and edit text files, try the following steps. Although they're written for Windows XP users, Linux and OS/X users would follow almost identical steps. Instead of using Notepad, though, they would use whatever text editor they are most familiar with:

Note

The file extension .js is defined as JavaScript. JavaScript files are edited, by default, using Notepad. The default execution (open) is wscript.exe (the Windows scripting host), or the equivalent in other operating systems.

There is also a file type .jse, for JavaScript Encoded files. However, Firefox does not use .jse files.


  1. Open a command prompt window. (Click Start and select All Programs, Accessories, Command Prompt.)

  2. Using the command prompt, change to the Application Data folder by typing the command CD %APPDATA% at the command prompt. Do not forget the closing percent sign!

  3. Navigate to the Firefox configuration folders using a series of CD (CHDIR) commands: CD MOZILLA, CD FIREFOX, CD PROFILES, CD xxxxxxxx.DEFAULT. (Remember that xxxxxxxx will be a string of eight random letters and numbers.)

  4. Type notepad user.js. If a user.js file already exists, it opens in Notepad. If the user.js file does not exist, Notepad asks whether you want to create it. Confirm that you want to create user.js.

  5. Edit your user.js file, changing or setting whatever preferences you want to change. When you're done, save the file if you have made changes you want to keep. You can also discard your changes by exiting Notepad without saving.

Tip

In any .js (Java Script) file, comments can be included using the Java comment syntax: /* starts a multiline comment and */ ends the multiline comment. For a single-line comment, prefix the comment with //.

Here's an example:

   /* Everything in user.js    overrides prefs.js! */ 

This line inserts a comment in the file, which Firefox ignores. Comments are useful as reminders of why (or perhaps how) you made a given change. I recommend that each line you add to your user.js include a corresponding comment line that specifies why you added the line and what the default value was.


Customizing Firefox's Look and Feel with userChrome.css

Just like .js is a JavaScript file, .css indicates a Cascading Style Sheet (CSS). The userChrome.css file is used to customize how Firefox's user interface looks. As with user.js, userChrome.css does not exist by default. However, a sample userChrome file (userChrome-example.css) is supplied with Firefox. You can rename and edit this sample file to make it the starting point for your own userChrome.css file.

The userChrome.css and userContent.css files contain CSS rules to describe how things should appear. Chapter 15, "Creating Your Own Theme," goes into more detail about Cascading Style Sheets. Additionally, if you want to become a CSS expert, visit the W3C website (http://www.w3c.org) and read the specifications for CSS.

The sample userChrome.css file has only a few sample settings. But many more settings are possible in userChrome.css.

Customizing How Content Is Displayed with userContent.css

To modify the default display of web content, use the userContent.css file. The layout and syntax of userContent.css is identical to userChrome.css, as discussed previously.

As you might expect, a useful extension for Firefox is available that edits the userChrome.css, userContent.css, user.js, and prefs.js files. This editor, named ChromEdit, is a simple text tool with tabs for each of these four configuration tools.

Keep in mind that, if prefs.js is edited and saved using ChromEdit, Firefox overwrites any edits you saved.

Caution

Prior to making wholesale changes to prefs.js or any other Firefox configuration file, you should make a backup copy. Doing this enables you to recover if you change something that prevents Firefox from running.


The ChromEdit utility can be installed from http://www.extensionsmirror.nl/index.php?showtopic=21 (see Figure 4.1). Once installed, a new menu item Edit User Files is installed in the Tools menu.

Figure 4.1. The ChromEdit editor window with the profile files opened.


     < Day Day Up > 


    Firefox and Thunderbird. Beyond Browsing and Email
    Firefox and Thunderbird Garage
    ISBN: 0131870041
    EAN: 2147483647
    Year: 2003
    Pages: 245

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net