Tips & Tricks

This page contains various tips and tricks for Firefox. Most of these tips involve editing of text files on your hard drive and is not recommended if you're not familiar with basic file and folder usage. The tips are divided into four categories and sorted by importance/popularity.

Contents

Browser Appearance

Use Windows XP styled menus

If you are running Windows XP and want your menus to fit in with the default (Luna) style, add the following code to your userChrome.css file:

/* Make menus XP style */
menupopup, popup {
   border: 1px solid ThreeDShadow !important;
   -moz-border-left-colors: ThreeDShadow !important;
   -moz-border-top-colors: ThreeDShadow !important;
   -moz-border-right-colors: ThreeDShadow !important;
   -moz-border-bottom-colors: ThreeDShadow !important;
   padding: 2px !important;
   background-color: Menu !important;
}
menubar > menu {
   border: 1px solid transparent !important;
   padding: 2px 5px 2px 7px !important;
   margin: 0 !important;
}
menubar > menu[_moz-menuactive="true"] {
   background-color : Highlight !important;
   color: HighlightText !important;
}
Use Windows Classic (9x/Me/2000) styled menus

If you want the menus to appear native to the Windows Classic appearance, add the following code to your userChrome.css file:

/* Windows Classic (9x/Me/2000) style Menus */
menupopup, popup {
   border: 2px solid !important;
   -moz-border-top-colors: ThreeDLightShadow ThreeDHighlight;
   -moz-border-right-colors: ThreeDDarkShadow ThreeDShadow;
   -moz-border-bottom-colors: ThreeDDarkShadow ThreeDShadow;
   -moz-border-left-colors: ThreeDLightShadow ThreeDHighlight;
   padding: 1px !important;
}
menubar > menu[disabled="true"] {
   border: 1px solid transparent !important;
}
menubar > menu[_moz-menuactive="true"] {
   border-top: 1px solid ThreeDHighlight !important;
   border-right: 1px solid ThreeDShadow !important;
   border-bottom: 1px solid ThreeDShadow !important;
   border-left: 1px solid ThreeDHighlight !important;
   background-color: transparent !important;
   color: MenuText !important;
}
menubar > menu[_moz-menuactive="true"][open="true"]  {
   border-top: 1px solid ThreeDShadow !important;
   border-right: 1px solid ThreeDHighlight !important;
   border-bottom: 1px solid ThreeDHighlight !important;
   border-left: 1px solid ThreeDShadow !important;
}
Use your own background image for the toolbars

In addition to changing themes, you can personalize Firefox even more by using your own toolbar background image. Add the following code to your userChrome.css file:

/* Use a background image for the toolbars:
   (Substitute your image file for background.gif) */

 menubar, toolbox, toolbar, .tabbrowser-tabs {
   background-image: url("background.gif") !important;
   background-color: none !important;
   }

It's easiest to place the image file in the same location as the userChrome.css file. The image can be of any image format supported by Firefox.

Make the active tab easier to distinguish

In order to make the active tab easier to distinguish among the currently opened tabs, you can also change the colors for the tabs. Add the following code to your userChrome.css file:

/* Change color of active tab */
tab{
   -moz-appearance: none !important;
}
tab[selected="true"] {
   background-color: rgb(222,218,210) !important;
   color: black !important;
}

/* Change color of normal tabs */
tab:not([selected="true"]) {
   background-color: rgb(200,196,188) !important;
   color: gray !important;
}
Don't use bold text on the active tab

If you don't want the title of the active tab to be bold, add the following code to your userChrome.css file:

/* Make the active tab not bold */
tab[selected="true"] {
   font-weight: normal !important;
}
Remove the close button from the tab bar

You can remove the close button from the tab bar by adding the following code to your userChrome.css file:

/* Remove the close button on the tab bar */
.tabs-closebutton-box {
   display: none !important;
}

You can still close tabs by right clicking on them and select Close Tab, or by pressing Ctrl+W

Remove items from the main menu

Some people like to place all their toolbar items on the same row as the menu. In order to save horizontal space, you can remove top menu items that you don't use. Add the following code to your userChrome.css file:

/* Remove the Go and Help menus
   (These are just examples. Try changing "Go" to "Edit" or "Bookmarks") */
menu[label="Go"], menu[label="Help"] {
   display: none !important;
}
Remove extra padding from the Navigation Toolbar

This tip will make the toolbars use less space around the buttons, allowing Firefox to use more space for the actual webpages. This also affects additional toolbars such as the Googlebar. Add the following code to your userChrome.css file:

/* Remove extra padding from the Navigation Bar */
.toolbarbutton-1, .toolbarbutton-menubutton-button {
   padding: 2px 3px !important;
}
.toolbarbutton-1[checked="true"], .toolbarbutton-1[open="true"],
.toolbarbutton-menubutton-button[checked="true"],
.toolbarbutton-menubutton-button[open="true"] {
   padding: 4px 1px 1px 4px !important;
}
Change the window icon

You can change Firefox's default window icon to any icon you want, by following these steps:

  1. Go to the folder you installed Firefox in (e.g. C:\Program Files\Mozilla Firefox\) and then go to the subfolder chrome.
  2. While in chrome, create a new subfolder called icons, then go to that folder and create yet another subfolder called default. The full path to this folder could be C:\Program Files\Mozilla Firefox\chrome\icons\default\.
  3. Choose the icon you want to use (on Windows use .ico files, on Linux use .xpm files) and then place it in this folder and rename it to main-window.[ext], e.g. main-window.ico on Windows and main-window.xpm on Linux.

In addition to the main window, you can also change the icon on the Bookmark Manager and JavaScript Console. The icon names are bookmark-window.[ext] and jsconsoleWindow.[ext], respectively.

After this is done, restart Firefox and you should be able to see your chosen icon in the title of the browser windows.

Display Sidebar on the right

To display the Sidebar on the right side of the window instead of the left, add the following code to your userChrome.css file:

/* Place the sidebar on the right edge of the window  */
window > hbox {
   direction:rtl;
}
window > hbox > * {
   direction:ltr;
} 
Change the width of the Search Bar

By default, the Search bar on the toolbar is relatively small. To specify your own width in pixels, add the following code to your userChrome.css file:

/* Make the Search box flex wider
   (in this case 400 pixels wide) */
 #search-container, #searchbar {
   -moz-box-flex: 400 !important;
}

Browser Behavior

Open external links in new windows or tabs

If another program wants to display a web page in the default browser, Firefox will reuse an existing window by default, which means that it will navigate from a page you might be reading. To stop this, Go to Tools > Options... (Edit > Preferences... under Linux and Mac OS X), select Advanced and click on Tabbed Browsing. Under "Open links from other applications in:", you can choose the alternative you prefer.

Reveal More Tab/Window Options

There are some hidden options for the Tabbed Browsing that will allow you to force links that open new windows to open in the current or a new tab. First, add the following code to your user.js file:

// Reveal more tab/window options:
  user_pref("browser.tabs.showSingleWindowModePrefs", true);

Restart Firefox and go to Tools > Options... (Edit > Preferences... under Linux and Mac OS X), select Advanced and click on Tabbed Browsing. The following options should be visible:

Force links that open new windows to open in:
the same tab/window as the link
a new tab

The options should be self-explanatory.

Decide which New Windows to Block

In the tip above, you learned how to reveal the Force links that open new windows... option. If you activated this, all windows that a web page wants to open will be diverted to either the current tab/window or a new tab. However, this also applies to small pop-up windows (e.g. a poll results window or the ICQ window in go.icq.com), which really should be opened in a new window. To change this behavior so it doesn't divert new windows that are spawned by JavaScript, add the following code to your user.js file:

/* Force New Windows Restrictions
    0: Default - Divert *all* new windows to current tab/window or new tab
    1: Don't divert *any* windows spawned by JS
    2: Don't divert JS windows that include size/placement/toolbar info */
user_pref("browser.link.open_newwindow.restriction", 2);
Use error pages instead of dialog messages

By default, Firefox displays annoying error messages if a connection fails, instead of quietly displaying the error information in the browser window as Internet Explorer does. To turn off the error messages and use pages instead, add the following code to your user.js file:

// Instead of annoying error dialog messages, display pages:
user_pref("browser.xul.error_pages.enabled", true);

Note that this feature is still a bit buggy as it removes the last visited page from the Back button history.

Tweak Find As You Type

Find As You Type has a few hidden preferences that can be changed to better fit your needs. Add the following prefs to your user.js file:

// Find As You Type Configuration:
// Set this pref to false to disable Find As You Type:
user_pref("accessibility.typeaheadfind", true);
// If you set this pref to true, typing can automatically start Find As You Type.
// If false (default), you must hit / (find text) or ' (find links) before your search.
user_pref("accessibility.typeaheadfind.autostart", true);
// Set this pref to false if you want Find As You Type to search normal text too:
user_pref("accessibility.typeaheadfind.linksonly", true);
// Set this pref to true if you require that the link starts with the entered text:
user_pref("accessibility.typeaheadfind.startlinksonly", false);
// This is the time in milliseconds for the Find As You Type to stop watching for keystrokes:
user_pref("accessibility.typeaheadfind.timeout", 3000);

For information about what Find As You Type is, read the documentation.

Disable Other JavaScript Window Features

Firefox has a few options that allow you to decide what scripts can and can not do with windows. These options are available from Tools > Options > Web Features > Advanced. However, this list of options doesn't cover them all. There are some other useful options which can be applied by adding the following code to your user.js file:

// More DOM/JavaScript options
// Make sure all pop-up windows are resizable:
user_pref("dom.disable_window_open_feature.resizable", true);
// Make sure all pop-up windows are minimizable:
user_pref("dom.disable_window_open_feature.minimizable", true);
// Always display the menu in pop-up windows:
user_pref("dom.disable_window_open_feature.menubar", true);
// Always display the Navigation Toolbar in pop-up windows:
user_pref("dom.disable_window_open_feature.location", true);
// Prevent sites from disabling scrollbars:
user_pref("dom.disable_window_open_feature.scrollbars", true);
Use your Netscape 6/7 or Mozilla bookmarks in Firefox

If you are using Netscape 6/7 or Mozilla, you can share your bookmarks with Firefox. All bookmarks are stored in a file called bookmarks.html and is stored in the profile folder. For example, if you want to use the bookmarks for Netscape 7 in Firefox, add the following code to your user.js file:

// Specify which bookmarks file to use:
user_pref("browser.bookmarks.file", "C:\\Path To Netscape Profile\\bookmarks.html");

Remember to use two backslashes for the path separators if you're using Windows, e.g. C:\\Path\\bookmarks.html instead of C:\Path\bookmarks.html.

This tip can also be used on dual-boot systems to use the same bookmarks on both operating systems. Just make sure that you place the file on a location that you have write access to from operating systems.

By default, if you enter a search term in the address field and press Enter, a Google "I'm Feeling Lucky" search is performed, and you're taken to the first result of that search directly. If you prefer to see the standard search result list instead, add the following code to your user.js file:

// Change to normal Google search:
user_pref("keyword.URL", "http://www.google.com/search?btnG=Google+Search&q=");

Of course, you could also change to a completely different search engine by changing the string to something else. The default search string is: "http://www.google.com/search?btnI=I%27m+Feeling+Lucky&q=".

Disable Bookmark Icons

You can disable the display of bookmark icons and "favicons" by adding the following code to your user.js file:

// Disable Bookmark Icons
user_pref("browser.chrome.site_icons", false);
user_pref("browser.chrome.favicons", false);
Change the Activity Indicator URL

When you click on the Activity Indicator (also known as the "throbber"), you are directed to the Firefox Start Page. This can be changed to any URL by adding the following code to your user.js file:

// Click on throbber to go to Mozilla.org:
user_pref("browser.throbber.url", "http://www.mozilla.org/");
Prevent URLs from being saved in Location Bar

Firefox allows you to prevent URLs from being saved in the pull-down menu for the Location Bar. This restriction helps protect user privacy and prevent users from "stumbling" into sites that other users had previously viewed.

Andrew Mutch has written a page explaining how to implement this restriction. Read it here.

Prevent sites from disabling the context menu

Some sites prevent you from right-clicking on the page to show the context menu. This bookmarklet will disable such attempts with just a single click. Drag the following link to the Bookmarks Toolbar Folder in Firefox, or to your Bookmarks menu, to create a bookmark:

Enable Context Menu

Alternatively, right-click on the link and select Bookmark This Link....

Web Page Appearance

Ad Blocking

Advertisements on websites are annoying, often breaking up text and flashing to get your attention. There is a neat trick that you can use to block most of the ads on Web pages.

Because of the length of the code in this tip, it is available in a separate page.

You probably just find the blinking above annoying. To stop it, add the following code to your user.js file:

// Put an end to blinking text!
user_pref("browser.blink_allowed", false);
Disable <marquee> tags

Some sites using scrolling marquee tags. If you don't find them useful, add the following code to your userContent.css file:

/* Stop those <marquee> tags! */
marquee {
   -moz-binding                  : none !important;
   display                       : block;
   height                        : auto !important;
}

If you added the code, this text should not scroll after restarting Firefox.
Force frames to be resizable

Many sites use frames to display their contents, and sometimes the frames are too small. To force all frames to be resizable, add the following code to your user.js file:

// Force frames to be resizable
   user_pref("layout.frames.force_resizability", true);

Note that this will also make the frames appear with a fixed-width border and thus, may make the pages look funny.

Change the cursor for links that open in new window

This neat trick will change the mouse pointer when you hover it over links that will open a new window. Add the following code to your userContent.css file:

/* Change cursor for links that open in new window */
:link[target="_blank"], :visited[target="_blank"],
:link[target="_new"],   :visited[target="_new"] {
   cursor:  crosshair;
} 
Change the cursor for JavaScript links

This tip will change the mouse pointer when you hover it over links that will perform a JavaScript command. Add the following code to your userContent.css file:

/* Change cursor for JavaScript links */
a[href^="javascript:"] {
   cursor: move;
} 

Other Tips

Change language on web pages

Some web sites offer content in multiple languages. You can choose several languages in Firefox and they will be treated in order of priority. In order to change the priority, just go to Tools > Options..., select the General section and click the Languages button.

Run Firefox from removable media

This advanced tip makes it possible to run Firefox from removable media, such as a USB memory stick. This will allow you to run Firefox with your personal settings from any computer, even those that don't have Firefox installed. It has only been tested on Windows XP/2000. The basic instructions are as follows:

  1. Copy the Firefox application folder and your profile folder to the removable medium. In this example we will use R:\Firefox for the application folder and R:\FFProfile as the profile folder, assuming the drive letter for the removable media is R:.
  2. Create a simple batch file called R:\Firefox.bat with the following line:
    start \Firefox\firefox.exe -profile \FFProfile
    
  3. Optionally, disable the disk cache to reduce the amounts of file writes to the removable storage by entering about:config in the address field of Firefox and set browser.cache.disk.enable to false.

The reason why a batch file is needed instead of a simple shortcut is that a shortcut uses absolute paths, and since the actual drive letter for the removable media may change depending on which computer it is plugged into, the relative path used in the batch file is guaranteed to work anywhere.

Select and copy individual table cells

While holding down the Ctrl key, you can select table cells. Just click on any non-link portion of the cell. You can select multiple cells, either by clicking individually on the cells you want to select or by just dragging with the mouse. Once selected, you can use Copy and Paste just like you would on a text selection.

Speed up page rendering

By default, Firefox doesn't try to render a web page for 250 milliseconds while it's waiting for data. If you add the code below to your user.js file, Firefox immediately starts to display the page, even without complete data. The drawback, especially on slower machines, is that the total time to display the page will be longer.

// Last value in milliseconds (default is 250)
user_pref("nglayout.initialpaint.delay", 0);
Enable Pipelining

Pipelining is an experimental feature, designed to improve page-load performance, that is unfortunately not well supported by some web servers and proxies. To try it out, add the following code to your user.js file:

// Enable pipelining:
user_pref("network.http.pipelining", true);
user_pref("network.http.proxy.pipelining", true);
user_pref("network.http.pipelining.maxrequests", 8);
Specify where to store the cache

To specify in which folder the cache is stored, add the following code to your user.js file:

// Path to Cache folder:
user_pref("browser.cache.disk.parent_directory","C:\\Path To Cache");

Remember to use two backslashes for the path separators if you're using Windows, e.g. C:\\Path\\Path To Cache instead of C:\Path\Path To Cache.

Specify the memory cache usage

Normally, Firefox determines the memory cache usage dynamically based on the amount of available memory. To specify a specific amount of memory cache, add the following code to your user.js file:

// Specify the amount of memory cache:
// -1 = determine dynamically (default), 0 = none, n = memory capacity in kilobytes
user_pref("browser.cache.memory.capacity", 4096);

To disable the memory cache completely, add the following code:

// Disable memory cache:
user_pref("browser.cache.memory.enable", false);

Because of the use of <marquee>, this page does not validate as HTML 4.01 Strict.

© 2002-2004 David Tenser.