Friday, August 5, 2011

Fix 1-ClickWeather Add-on for Firefox

1-ClickWeather is the best weather extension for Firefox, in my opinion. Slim, nice looking, accurate, and full-featured. But unfortunately, its developers stopped updating it since a long time. So, it only occasionally worked in Firefox 4, and it stopped working at all in Firefox 5. Luckily, there is a quite easy fix to it!

1. If not already installed, install it from here:

To finish the installation, restart Firefox, then close it again.

2. Open your home directory in Nautilus and browse to ".mozilla/firefox/PROFILE/extensions/{DCBD1271-D228-4082-9FBC-36D9B7660B03}/chrome", where PROFILE is usually a combination of random characters appended by ".default". You may need to press Ctrl+H to show the hidden files/directories.

3. Double-click on the file "1clickweather.jar" to open it in the Archive Manager. If you want to be safe, make a backup copy of it before.

4. Browse to "/content/1clickweather/js/" and double-click on the file "1clickweather.js" to open it in the text editor.

5. In the lines 452 to 454, you will find this:

function create_class(class) { 
    return new Function('return new ' + class)();

Now this is the culprit, "class" is a reserved keyword in JavaScript and cannot be used. So, replace it with something of your choice, for example "fixclass", in the occasions marked below:

function create_class(fixclass) { 
    return new Function('return new ' + fixclass)();

6. When done so, just click on "Save" in the toolbar, and you will be asked if you want to update the archive. Then, obviously, choose "Update".

7. Now only close any windows you opened in the process and you are done! 1-ClickWeather should work now.

Update 2/27/2012: Additionally to the above fix, since Firefox 10 (apparently, the broken state of the add-on filed on Mozilla's server has eventually filtered through to their compatibility database), you need to disable the automatic compatibility check to be able to enable the add-on. This should be possible by manually adding custom settings keys via Firefox' "about:config" dialog like indicated below - but that didn't work for me!:

extensions.checkCompatibility.10.0        boolean     false
extensions.checkCompatibility.nightly     boolean     false

What eventually worked is the add-on "Disable Add-on Compatibility Checks" - even though I'm still wondering why, since it seemingly does just the very same - however, this add-on has also the advantage that it automatically updates those keys to whatever Firefox version you are running:

Notice that it's called "checkCompatibility" in the Add-on Manager, same as in its link, but contrary to the name stated on the website!

Related Posts:

Web Browser