Mozilla Home Throbber Project

Author: Jason Bassford.

This project page was last updated on 9/16/02.

The current versions of Home Throbber are:

Modern 1.1 Install º Screenshot
Classic 1.1 Install º Screenshot
Sky Pilot 1.1a Install º Screenshot
Graphics 1.1a Install Throbber graphics for all supported themes. Folders will be created in your profile Chrome directory.
Code 1.1 Install Files containing the lines of code to be added to user.js and userChrome.css. The file update.user.js will be created in your profile directory, and the file update.userChrome.css will be created in your profile Chrome directory.

Installs marked with º will only install on Win32 platforms (see bold and italicised section of notes below). Others are platform independent.

Note: If you’ve already installed a previous Home Throbber theme, unless noted in the History section below, you will gain nothing by installing a more recent version.


History

10/12/05:

  1. Due to a regression in Seamonkey, Homethrobber, by default, isn’t going to go to your home page when you click on the throbber. This is because user.js is no longer honouring the code (it ignores it). In order to get it to work, you need to manually copy the section of code that the installer addds to user.js and paste it into prefs.js. The bug in question can be found here.

9/17/02:

  1. I realised that in version Sky Pilot 1.1 I’d skinned the throbber graphics rather than the home Button. I’ve corrected the mistake and released 1.1a of both Sky Pilot and Graphics.. Downloading the update, and installing on top of the previous release, will replace the throbber graphics with proper home button graphics. As noted, below, be aware that it will created duplicate lines of code in user.js and userChrome.css – although this will not cause any functional problems.

9/16/02:

  1. Increased Home Throbber version to 1.1.
  2. Added support for the Sky Pilot theme.
  3. Added “resource” XPIs for the download of all theme graphics used, and the code to apppend to existing files to get the throbber to go to your home page. These resources will install on all platforms, and remaining steps can be done manually.
  4. Removed the creation of theme switching batch files. I’m trying to unhook as much platform dependency as possible – and I figure that anybody who downloads a Home Throbber theme will just download the one for the theme they use and stick with it.
  5. Packaged each Home Throbber theme into a separate XPI for ease of use.

9/14/02:

  1. Home Throbber 1.0 released.

This project grew out of my frustration with not having the ability to put a home button onto Mozilla’s navigation (main) toolbar. I could use the one from the personal toolbar – but it would be the only reason I would display it and I found that to be rather silly. I have the personal toolbar turned off because I feel it takes up too much vertical real estate. This is the same reason that I don’t use the Sidebar – it takes up too much horizontal real estate.

Several months ago, a regular of MozillaZine, who goes by the nickname “3rd-Hand”, created a small XPI (Mozilla installation script) called Home Button that puts a home button onto the navigation toolbar.

Why, then, have I gone to the trouble of “reinventing the wheel”? For several reasons:

  1. The Home Button add-on modifies the base Mozilla code. What this means in “real terms” is that every time you install a newer version of Mozilla, the add-on would be lost. Since I download a new build about once every other day, I thought I’d try to figure out some method that would persist despite Mozilla updates.
  2. I didn’t understand how it worked. To be honest, I still don’t completely understand it. Despite having written code in C, Visual Basic, Basic, assembler, and others, there’s something about XUL overlay that escapes me. Since I like to know WHY things like this work I had something against just running it and using unasked. Also, the fact that there was no easy uninstall method, short of decompressing .jar files, modifying things, and recompressing them, somehow just didn’t feel right.
  3. I am cognizant of screen real estate, as I’ve already said. I’ve been working without the Print or Search buttons on the navigation bar for some time now. I wanted a home button without (somehow) adding more real-estate.
  4. I’ve never liked the Mozilla default throbber, feeling that the big blue “M” didn’t really fit in with the look of the other Modern themed buttons.

By pure chance I happened upon a Newsgroup posting on a prefs.js entry that would change change the URL that the throbber takes you to when you click on it. I thought that was perfect, and my project started. I set out to change the URL to my home page. At first I used my actual Web site URL – then I got “sneakier” and replaced that with JavaScript pointing to whatever my home page might be at any given time.

Next, I worked on replacing the graphics for the throbber with actual home button graphics. Initially, I created a simple batch file that would update the .jar (renamed zip) with the newer images. But I wasn’t happy with this because there was no platform independence of any kind, and it wasn’t nearly as convenient as clicking on a link to a single XPI script. So I worked on “converting” this idea into an XPI and spent several frustrating but educational days developing something that might have worked – if it weren’t for the fact that I was unable to access a .jar file while it was in use, and the only way to install and XPI was to have Mozilla running at the time. Chicken and the egg. So I gave up on that one.

I then happened upon a far more elegant solution – userChrome.css in the Profile directory. Not only was this not in use with Mozilla running, but changes made there, rather than to the Mozilla program code, would persist throughout Mozilla upgrades.

The result of all of that is what you see here. (At the risk of stating the obvious, you must restart Mozilla after intalling the XPI in order for the changes to take place.)

Unfortunately, in order to append lines of text to prefs.js (via user.js) and to userChrome.css I have had to resort to calling an external Windows batch file since I know of no way of doing a text file append from within native XPI / JavaScript. Not that it’s impossible, just that I don’t know of a method of accomplishing this at present. So, that portion of the XPI will only run on Win32 platforms. (Although it could be easily modified for other platforms.) Non-Win32 users will need to manually edit their user.js and chrome/userChrome.css files (create them if they don’t exist) and add the text as described in steps 1. and 3. below. The code can be downloaded from the link to Code 1.1 (and see notes there) at the top of this page.

I’ve only designed home button icons for the Modern, Classic, and Sky Pilot themes, but this could also be easily expanded to include other themes. I only use Modern myself, so I was not interested in others – but I designed Home Throbber designs for the Classic theme just because it was there. After making 1.0 available, I received a request for the Sky Pilot theme so that one’s now in place too.

One “flaw” with using userChrome.css, rather than modifying the program code itself, is that when you switch themes, the Home Throbber graphics do not also switch automatically. At least, I’ve not yet found any method by which you can make portions of userChrome.css conditional on the theme currently being used. As such, if themes are switched, the GIF files will have to be updated with those from the other theme. You can either download the entire set of GIFs I have, or just install the XPI for the other theme.

If you find, after switching themes, that the throbber icon doesn’t match the new theme, or sometimes displays in the new theme but at other times in the old theme, try clearing your memory and disk cache.

In addition to what was mentioned above, there is another issue of which you should to be aware. Every time you run the XPI it will append text to both user.js and userChrome.css. This is better than just replacing those files which may already contain other lines of code, but still not as nice as appending only if the lines of code don’t already exist. (I have no idea how I would accomplish this in a simple manner.) These duplicate blocks of code will not cause any actual harm, but if you are fussy about this you should delete these duplicate entries from those two files. (Once you restart Mozilla, the user.js entries will be added to prefs.js, but this is not a problem as duplicate entries there are automatically deleted.)

To have Mozilla switch back to the default throbber graphics, either simply delete userChrome.css or, if other customizations are in that file, delete or comment out the throbber entries.

To completely remove Home Throbber, exit Mozilla and follow these next steps.

  1. Delete user.js or remove the following entries from the file:
    user_pref(“addressbook.throbber.url”, “javascript:home()”);
    user_pref(“browser.throbber.url”, “javascript:home()”);
    user_pref(“calender.throbber.url”, “javascript:homE()”);
    user_pref(“compose.throbber.url”, “javascript:home()”);
    user_pref(“editor.throbber.url”, “javascript:home()”);
    user_pref(“messenger.throbber.url”, “javascript:home()”);

  2. Remove the above lines from prefs.js.

  3. Delete userChrome.css (from the Chrome directory) or remove the following entries
    from the file:
    #navigator-throbber {
    list-style-image : url(“throbber-single.gif”) !important;
    }
    #navigator-throbber:hover {
    list-style-image : url(“throbber-single-hover.gif”) !important;
    }
    #navigator-throbber[busy=”true”] {
    list-style-image : url(“throbber-anim.gif”) !important;
    }
    #navigator-throbber[toolbarmode=”small”] {
    list-style-image : url(“throbber16-single.gif”) !important;
    }
    #navigator-throbber:hover[toolbarmode=”small”] {
    list-style-image : url(“throbber16-single-hover.gif”) !important;
    }
    #navigator-throbber[toolbarmode=”small”][busy=”true”] {
    list-style-image : url(“throbber16-anim.gif”) !important;
    }

  4. Remove the “throbber*” files from the Chrome directory.

That’s all I can think of right now. Oh, except that I don’t take any responsibility for what this might do to your Mozilla installation. It works for me, and it should work for you (certainly under XP, probably under other flavous of Win32) – but I don’t guarantee anything.

If you have any questions or comments, feel free to email me.

Leave a Reply