June 07 2009

Side Note: Silverlight 2 Windowless Browser Support

I was doing some site updates during the week (stuff unrelated to Silverlight actually) and came across this simple and intriguing issue. I thought I’d blog about this really specific issue because its been frustrating to say the least (and I have no idea when this will be resolved) and it was a stark reminder for me that Silverlight development is not at the point where it is a ubiquitous experience for some browsers.

 

Updated 9/6 – Re-tested with Safari 4 RTW.

Windowless Silverlight Content

One of the perks of using Silverlight plugins on a website is having the ability to blend XAML content and HTML content. I’ll use a simple example of a control that is semi-transparent to show how this blending works and where it falls down. The screenshots below show the XAML code of the plugin and and HTML code used to embed the plugin on the page. A photo is used for the HTML background.

 

XAML Code HTML Code
XAMLCode HTMLCode

 

First off, a test of the officially supported browsers:

 

IE8 Firefox 3.0.10
Plugin-IE8 Plugin-FF

 

All good so far. The supported browsers work - IE6 and IE7 are dead to me for the purposes of this test. And in general. Hell, even my dad uses Firefox these days. Stop using IE6. Please.

 

Checking MSDN shows a laundry list of limitations about using windowless plugins. This doesn’t mean “never use windowless mode” but what I read as TEST YOUR PLUGIN IN OTHER BROWSERS.

 

So, I did. And what I found was not good. To ensure this is just a snapshot in time, I’ve included browser versions that I’ve tested this on – the Silverlight plugin I’m using is v2.0.40115.0.

Safari 4 for Windows

I tested this with the public Beta (released 12 May). What do you get? To use a non-technical term, bupkis. I kid you not, nothing gets rendered. Fantastic, here’s a screenshot of what I get. Note that if you right-click the region where the plugin should be, nothing happens.  No Silverlight context menu, no Safari HTML menu, bupkis.

 

Plugin-Safari

The annoying part of Safari 4 for Windows is that the Mac version supports windowless content (side note: it renders all content as windowless irrespective of what the plugin specifies – funky!) and renders the plugin content fine (I don’t have a Mac handy – yet). This may be just an issue with the beta (only been available for a couple of weeks). Safari 3 works fine with Silverlight 2 plugins – so I’m sure that it’ll be resolved between now and then.

 

EDIT 9/6 – Safari 4 for Windows came out of beta to celebrate WWDC. Problem still occurring.

Google Chrome and Chromium

The new browser on the block (and its open-source brother) started out with no support for Silverlight at all. So how does it handle this plugin now? This is using Chrome v2.0.172.30. As the screenshot below shows, the experience is better, but the transparency is being ignored. The same thing occurs on the latest Chromium build I could find (build 17842).

 

Plugin-Chrome

The Moral of the Story

Things I’ve learned from this:

 

1. Avoid using Windowless plugins unless required. This hinges on whether or not a large percentage of your visitors use Safari or Chrome, as well as on the numerous gotchas to keep in mind, such as CPU overhead, mouse events, full-screen mode and others. The situation may also dictate it.

 

2. Wait for Silverlight 3.0 for additional supported browser. I found a few threads on the Chrome boards about Silverlight 2.0 issues - most of them are resolved but this one (see last comment) makes me think that we may have to wait until Silverlight 3 to get full Silverlight 2.0 support in Chrome (which doesn’t sound right unless there are upstream issues).

 

3. Safari for Windows isn’t officially supported.

 

4. There isn’t much documentation around what Silverlight features work/don’t work in unsupported browsers (I haven’t even looked at Opera for this). The MSDN docs are vague, bug reports are sporadic, and most discussions I’ve seen on the Silverlight forums end with a “It doesn’t work” summary. Or have I missed some magic fountain of information about this?

Comments are closed