Customizing the download progress bar

This is an archived page. It's not actively maintained.


Support for extensions using XUL/XPCOM or the Add-on SDK was removed in Firefox 57, released November 2017. As there is no supported version of Firefox enabling these technologies, this page will be removed by December 2020.

Add-ons using the techniques described in this document are considered a legacy technology in Firefox. Don't use these techniques to develop new add-ons. Use WebExtensions instead. If you maintain an add-on which uses the techniques described here, consider migrating it to use WebExtensions.

Starting from Firefox 53, no new legacy add-ons will be accepted on (AMO) for desktop Firefox and Firefox for Android.

Starting from Firefox 57, only extensions developed using WebExtensions APIs will be supported on Desktop Firefox and Firefox for Android.

Even before Firefox 57, changes coming up in the Firefox platform will break many legacy extensions. These changes include multiprocess Firefox (e10s), sandboxing, and multiple content processes. Legacy extensions that are affected by these changes should migrate to use WebExtensions APIs if they can. See the "Compatibility Milestones" document for more information.

A wiki page containing resources, migration paths, office hours, and more, is available to help developers transition to the new technologies.


This example illustrates how to customize the progress bar displayed for a given download in the Downloads window.

First you need to overlay the Downloads window so that you can add a new stylesheet. In your file, add the following (replacing "myextension" with the name of your extension's chrome package):

% overlay chrome://mozapps/content/downloads/downloads.xul  chrome://myextension/content/downloads-overlay.xul

In downloads-overlay.xul, reference the new stylesheet:

<?xml version="1.0"?>

<?xml-stylesheet href="chrome://myextension/skin/myextension.css" type="text/css"?>

<overlay id="myDownloadOverlay" xmlns="">

In, make sure that there is an asterisk in front of the entry for myextension.css so that it will be preprocessed. This is required since it contains platform-specific directives, as we will see.

The myextension.css file will look something like this:

richlistitem progressmeter {
%ifdef XP_WIN
  min-height: 17px !important;
%ifdef XP_MACOSX
  -moz-appearance: none !important;
  background-image: url(chrome://myextension/skin/progress_bg_osx.png) !important;

richlistitem .progress-bar {
%ifdef XP_WIN
  -moz-appearance: none !important;
  background-image: url(chrome://myextension/skin/progress_fd_win.png) !important;
%ifdef XP_MACOSX
  background-image: url(chrome://myextension/skin/progress_fd_osx.gif) !important;


Note: This file only supports Windows and Mac, but it would be straightforward to add support for Linux.


This is the product of some tweaking and experimentation, so perhaps there is a different and/or better way to achieve the same thing. We are specifying the height of the progress meter on Windows and a background image on Mac. The background image (the first one in the file) should be a segment of whatever you want the unfilled portion of the progress bar to look like. An image of 7 pixels wide and 12 pixels high seems to work well. The other two images are for the filled in progress bar on Windows and Mac respectively. Once again, a height of 12 pixels or so and a few pixels wide seems about right, though you might have to experiment with this a bit.

Changing the progress bar for specific downloads

This is all you need to change the progress bar appearance for all downloads. If you want to change it for certain specific downloads only, things get a bit trickier. In your overlay file, add a JavaScript file between the <overlay> and </overlay> tags:

    <script type="application/javascript" src="chrome://myextension/content/downloads-overlay.js" />

The JavaScript file will look something like this:

var MyDownloadManager = {
  defaultCreateDownloadItem : null,

  init : function fdm_init() {
    MyDownloadManager.defaultCreateDownloadItem = window.createDownloadItem;
    window.createDownloadItem = function(aAttrs) {
      var dl = MyDownloadManager.defaultCreateDownloadItem(aAttrs);
      if (dl) {

             if (...whatever condition you use to decide whether to change this download...) {
               dl.setAttribute("myspecialdownload", "true");
      return dl;

window.addEventListener("load", function(e) { MyDownloadManager.init(); }, false);

In your CSS file, change richdownloaditem (both occurrences) to richdownloaditem[myspecialdownload="true"]. Now your new progress bar image will only be used for the downloads with your special attribute.