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 (see http://gmailblog.blogspot.com/2008/10/new-in-labs-calendar-and-docs-gadgets.html). 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 at http://groups.google.com/group/gmail-labs-help-add-any-gadget/browse_thread/thread/a8d37ceec5dc147c, and some additional developer notes of my own later in this message (for those interested). There's also no direct developer support from Google, no explicit "GMail Gadgets API", which is why this message is being cross-posted at the iGoogle Developer Forum and the GMail Labs Help group. 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: 1. In GMail, click the Settings link (at the upper-right), and go to the Labs tab. 2. In Labs, turn on the "Add any gadget by URL" feature (towards the bottom), and save your changes. 3. Still in Settings, go to the Gadgets tab. 4. Paste in one of the URLs below to activate the gadget. Which of course 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. String --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "iGoogle Developer Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Gadgets-API?hl=en -~----------~----~----~----~------~----~------~--~---
