Skip to content

Do-It-Yourself Upgrades to the Better Gmail Extensions

There are times that an event occurs that makes it necessary for me to rewrite what I was in the process of writing here. And it was while I was writing this particular entry that three events occurred that made me need to rewrite what I wrote.

I was going to write about Firefox extensions that could be written based on the Better Gmail extension code, and these extensions did not yet exist when I first started writing this entry. I was going to mention that the Better Gmail extension may occasionally require updates to the Greasemonkey scripts that it uses. And then this Lifehacker post came out about an upgrade made to a script that Better Gmail uses. So then I thought I should mention this upgrade here, as doing so would help illustrate a point that I was going to make. However, I was also going to write about how I was able to modify the Better Gmail extension to make it work with YouTube. Then I saw this post on Lifehacker that announced the release of a Better YouTube extension, making it unnecessary for me to speculate on when such an extension might appear, as I had originally intended. I then thought that I could at least mention why one might need to upgrade the Better Gmail extension, with the new version of Gmail rendering Better Gmail’s scripts useless. Then on Lifehacker, news was posted saying that a new extension was released, titled “Better Gmail 2”, which contained scripts that work with the new version of Gmail. And with these recent events, you may now understand why this entry is appearing a few days later than I wanted it to appear.

In this entry, I will mention how updates can be made to these extensions that improve Gmail. Occasionally, updates to scripts used by these two extensions do need to be made. And one could wait for the extensions to be updated, or one could perform the necessary updates by going through a fairly straightforward process.

Before I begin outlining this process, there are a few things that I should note. I am assuming that Windows is the operating system being used, as most of those reading this are likely using Windows. I also assume that those following the instructions have the Greasemonkey extension installed on Firefox. Firefox users that do not have it installed can either install this extension or go through a slightly different process to update the files that need to be updated. In addition, I assume that the user would be fine with installing other utilities if they are not already installed, such as the JDK. I should also note that I give upgrading of the Better Gmail extension as an example, as the only difference in upgrading Better Gmail 2 is that a directory name is slightly different. In Better Gmail 2, the directory in the extensions folder is bettergmail2@ginatrapani.org, rather than bettergmail@ginatrapani.org. Finally, I should note that the example given of upgrading Gmail Macros was rendered obsolete with the release of Better Gmail 2. I did not update this example because of a deadline I imposed upon myself in getting this blog entry published, and the reason for this deadline is one that I note at the end of this post. So for those who would like a step-by-step guide on how to perform their own upgrades of the Better Gmail extensions by adding newer versions of scripts to them, here it is.

  1. Download the updated Greasemonkey script that you would like to add. You will later need to ensure that you know the name of the file that you are downloading. For example, if you are downloading the new version of Gmail Macros and replacing the old version of it, the name of the file is gmailmacrosnew.user.js.
  2. Close your Mozilla Firefox web browser.
  3. Go into your profile directory. Instructions on how to find your profile directory are here if you need them. Then go into the Firefox directory. Then from there, go into extensions\bettergmail@ginatrapani.org\chrome.
  4. Extract the contents of the .jar file in that directory. 7-Zip is one utility that can be used to do this.
  5. Go back into your profile directory, then go into the gm_scripts directory.
  6. Copy the file that contains the new script to the user_scripts directory, which is within the content directory that was extracted from the .jar file. For example, to upgrade the Gmail Macros script, copy gmailmacrosnew.user.js to this directory.
  7. Delete the original script file from the directory to which the new script file was copied. For example, if upgrading Gmail Macros, you would delete the file named macrosbn.js.
  8. Rename the new script file that you copied to this folder to the name of the original file. For example, rename gmailmacrosnew.user.js to macrosbn.js if upgrading Gmail Macros. However, in most script upgrades, you may only need to remove “.user” from the filename.
  9. Through a command prompt, go into the directory where the .jar file was first extracted in step 4. You may need to download the JDK and install it first, and the JDK can be downloaded from here. Then the command that can be run would be “jar cvf bettergmail.jar .” to create the new .jar file.
  10. Start Firefox. Better Gmail should work with the new script now.

One may prefer to add more scripts to the Better Gmail extensions, instead of overwriting scripts already used by these extensions. And after working with the source code in the Better Gmail extension, I can say that adding new scripts to these extensions can be done more easily than one might think. Of course, the process of adding new scripts is more complicated than the process of updating existing ones. I could outline each step that would need to be taken in adding a script/feature to these extensions. However, I will leave that explanation out of this particular post. Whether or not one of my next posts here will be one where I give that explanation may depend on how much demand there might be for that explanation to appear here.

It might be considered more trouble than it is worth to add more scripts to these extensions, even though only a few of them can presently be used with Better Gmail 2. And one could simply look for and install scripts that work with the newer version of Gmail when they become available, and simply use them with the Greasemonkey extension. So why would one want to go through the process of adding scripts to the Better Gmail extensions? Well, once should consider the reasons these extensions exist. Having the scripts used by these extensions all grouped together with an interface that prevents enabling of conflicting scripts can be convenient, as some scripts do conflict with others. This is especially true in the case of skins. Also, when one has several Greasemonkey scripts work with all websites, the list of scripts that are available for use with a web page can be a cluttered list. Use of this extension prevents this from happening. And I must say that when I added new scripts to Better Gmail, I was more interested in seeing how adding new scripts to it could be done. Why? Because I wanted to see how I could modify the code in Better Gmail to make it work with other web pages, and with the scripts that work with these other pages. This was supposed to lead into me commenting on the possibility of a Better YouTube extension, however I can at least say I have verified that these extensions that make websites “better” can be easily developed.

There might be some who would want to go through the process of updating and adding scripts used by the extensions that I mentioned here. I am not sure how many people would actually go ahead with this, but the instructions I have listed here can be referred to by those who may want to update these extensions. And with the new version of Gmail coming out, we have recently seen that scripts in the Better Gmail extensions occasionally need to be updated. And with the Better Gmail 2 extension currently lacking features/scripts, perhaps it would have been a good idea for me to include instructions on how to add new scripts to Better Gmail 2. However, I must admit that a reason I decided to leave out those instructions for now is that I wanted to get this entry published as soon as possible. And that is because I wanted to make sure that I got this post published before a fourth event could occur that would make me need to rewrite what I wrote, and thus cause the publishing of this post to be delayed yet again.