Wednesday, February 25, 2009

Silverlight vs. FireFox

After struggling with getting some Silverlight (2.0) apps working in FireFox (v3), I thought I’d post the solutions here so that I can find them easily in the future.

The first problem was getting the application to load in the first place. In one of the parameters to the <object> that will represent your application, you pass in a ‘data’ parameter, like this:

data="data:application/x-silverlight-2,"

See that pesky little comma after the “2”? Well, without it, your app probably won’t show up in FireFox, at least mine wouldn’t. It works fine in IE and Chrome, but no way the ‘fox would love it.

The second issue seems to be that if you give your app a percentage height, and the outer elements don’t have a set height themselves, you could end up with an application with a height of 0 pixels – which means there is nothing to show. Fortunately other people have already figures this out, such as this here guy, who I thank for saving me some gray hairs. :)

That’s it!

No comments: