Experiences With Gadgets for Gmail
Sterling Udell is a freelance web developer who started programming with Google Maps since before the API was released. He’s the author of the book Beginning Google Maps Mashups.
In the last couple of days I’ve been actively exploring the creation of gadgets for GMail, and wanted to share some of my findings, both for GMail users and other gadget developers.
First, a bit of background... Google announced support for gadgets on GMail about a month ago, at which time they released their own Calendar and Docs gadgets. Since I have quite a few gadgets these days, I thought I’d try my hand at it myself.

What I generally found is that, although GMail theoretically supports any gadget, in practice most don’t work well and many don’t work at all. There’s a list of some reasons why, and some additional notes of my own later in this post. One of the major oddities is that there’s no easy mechanism for adding a gadget directly, as there is in iGoogle. Here are the required steps:
- In GMail, click the Settings link (at the upper-right), and go to the Labs tab.
- In Labs, turn on the “Add any gadget by URL” feature (towards the bottom), and save your changes.
- Still in Settings, go to the Gadgets tab.
- Paste in one of the URLs below to activate the gadget.
Which brings me to my gadgets themselves. At the moment, I have three:
First, a brand-new gadget created specifically for GMail, although it does also work in iGoogle (and elsewhere). It’s a compact multi-timezone clock:
<<http://gad.getpla.net/poly/clock.xml>>
Second, my most popular iGoogle gadget, DaylightMap, now supporting GMail:
<<http://www.daylightmap.com/daylight_mapplet.xml>>
And third, just for fun, It’s 5:00 Somewhere!
<<http://gad.getpla.net/5oclock/somewhere.xml>>
Finally, here are some of the development-related items that I’ve learned along the way. Hopefully they’ll help others with their own GMail gadgets.
- Caching is definitely broken:
• The refresh-interval parameter to all functions which use the gmodules cache (_IG_GetCachedUrl, _IG_GetImageUrl, etc.) is ignored. In Firebug I can see that the content is being retrieved with “refresh=3600”, and that’s the effect I’m seeing as well. So if you need to disable caching, you’ll need to do it manually, with a timestamp parameter or other workaround.
• Strangely enough, caching generally seems to be effectively disabled for the gadget XML itself. This is good for testing but has an obvious downside for deployment. - Dynamic-Height is flaky – sometimes works and sometimes not on FF, and on Chrome I get an error: Uncaught Error: Unknown RPC service: resize_iframe
- Gadgets are a fixed, narrow width, looks like 162px at normal font size. This presents some challenges for UI design.
- There’s no UI for Settings, but setprefs works – which effectively means that all UserPrefs are datatype="hidden”.
- Gadgets are served over HTTP, meaning that if you’ve set GMail to use HTTPS, you get a “Page contains nonsecure items” warning from IE.
With these few caveats, gadgets for GMail generally follow the legacy iGoogle Gadgets API – meaning they’re quite straightforward for most web developers. The door is now open for you to make your own mark on GMail, rather than waiting for Google’s developers to make the enhancements. What accessories would you find useful in GMail?
[By Sterling Udell | Origin: Experiences With Gadgets for Gmail | Comments]
[Advertisement] Google books at eBay: background info on Google, AdWords, AdSense, Blogger and more...




