Greasemonkey auto-update notification

One of the biggest advantages of an extension over a GreaseMonkey script is the possibility of automatic update notification for the user. For my Greasemonkey statistics detector I've been looking in to a way to provide automatic update notification, without having to "phone home" on each use of the script. It's not finished yet, but this is what I've come up with so far.

Using the GreaseMonkey functions GM_setValue and GM_getValue, I store the last date at which I checked for updates. If that date was more than 1 week ago, I make the script download a simple small "version.xml" file from my server, which would contain something like:

[sourcecode language="xml"]
< ?xml version="1.0" encoding="UTF-8"?>

110

[/sourcecode]

If that version is higher than the current version of the script, for instance, if you were using version 1 (100), it would be older than 1.1 (110) which is on the server, and you would get an unobtrusive popup to notify you that you should update. It will then store the date at which it checked, and won't check for another week again.

Of course I will provide the code to this once it's finished, but I was hoping some of you would have some ideas on this, and perhaps some good recommendations...

[tags]Greasemonkey, Firefox[/tags]

Related posts

  1. Small update to table sorting script
  2. Update to sortable table script
  3. Does Internet Explorer 7 like your website?
  4. Sortable table v1.5

Enjoyed this article?

Join 4714 subscribers and subscribe by daily or weekly emails or with RSS to receive more tips, tricks and ideas on improving your website!

One Response to “Greasemonkey auto-update notification”

Hosting by:
Hosted by MediaTemple Grid Services