Vista Gadget Headaches

I’ve been trying for the past week or so to write a couple of gadgets for the Vista Sidebar that I’d personally find insanely useful. One is a simple Flickr drag and drop uploading gadget, the other is a Xbox Live Friends Status gadget. The idea behind that second one being that at a glance I can tell which of my XBL friends are online. I would love to have both of these gadgets along with some sort of gmail gadget that isn’t a huge monstrosity.

Being the industrious programming type that I am it seemed like it wouldn’t be a huge deal to create gadgets to do precisely what I wanted. I’ve implemented the Flickr API in PHP, so why not Javascript? I already know that the Xbox Live idea can work as simple Javascript because there’s already a Klipfolio gadget to do just that. Unfortunately I’ve run into some pretty nasty limitations of the Sidebar and Gadget APIs while trying to work on these ideas. It’s been really frustrating.

The Flickr Gadget was going swimmingly up until the time I tried to actually upload a photo. Flickr expects a POST request so I figured I could create an invisible form that could then just be submitted or uploaded via YUI. As it turns out you can’t call submit() on a form from within a gadget, and the YUI implementation tries to create a hidden iframe which just launches IE. Stymied there, I researched how to get at the raw binary of the photo and send that via a raw xmlhttprequest. That was a dead end as well, it appears that there’s no way to send raw binary through an xmlhttprequest. Since Microsoft doesn’t provide any sort of API for this thing like the Yahoo Widget Engine, my Flickr uploader is in pretty bad shape. I was reading an interesting article about using some Javascript trickier to get access to .NET objects in a gadget. It seems pretty promising thus far combined with the flickr.net library but so far I can’t even get the examples for the .NET gadget interop working.

Xbox Live Status gadget was sunk when I realized that the standard xmlhttprequest object can’t have custom referrers set. This meant I couldn’t automate the Windows Live login that Xbox.com requires to view friend’s online status. Without being able to automate that login there was no friends status to check and thus no gadget. Klipfolio provides an object much like xmlhttprequest that does allow for setting a custom referrer.

So far I’ve been pretty frustrated by the limitations of the Gadget API. I like the concept of Gadgets in and of themselves and quite enjoy some of the ones I have already. It just sucks that my ideas keep getting torpedoed due to the lack of features in the Gadget API. I’m going to keep watching CodeProject and the MSDN Sidebar Gadget forums to see if anyone posts some amazing solutions to my problems but I don’t have much hope. Perhaps I could learn Flash, but that seems like an awfully nasty hack just to get some more control over web requests being made by the gadget. Some simple extensions to xmlhttprequest for the Sidebar environment would really allow for some amazing gadgets. Maybe sometime down the round, I haven’t been able to find much info about Microsoft’s plans for the Gadget API so I’m not hopeful.

2 Responses to “Vista Gadget Headaches”

  1. Asaf M:

    Say, did you find technical reference in MSDN stating that limitation in the Gadget run time environment?

    July 2nd, 2008 at 12:19 am

  2. Pat Cavit:

    Not that I recall, it just flat out doesn’t allow you to upload files. Since you can use flash in gadgets (I think) something like http://developer.yahoo.com/yui/uploader/ could work.

    July 2nd, 2008 at 8:28 am

Leave a Reply

Comments will be sent to the moderation queue.