Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determine if Silverlight CAN be installed

I am developing a page that needs to work in a variety of scenarios that is determined using JavaScript. Firstly if Silverlight is installed it should use Silverlight. Simple.

if(Silverlight.isInstalled()){
    // do stuff
}

Next I need to be able to determine if Silverlight CAN be installed. This is the hard bit. Basically if I am viewing the on, say for example, an iPad (but could be any non-Silverlight capable device) I want to use plain HTML. But if I am on a desktop machine that doesn't have Silverlight installed but can install it I wan't the usual install Silverlight stuff

Silverlight.getSilverlight();

I have seen the Silverlight.supportedUserAgent.js but like most UA sniffing techniques is a bit backwards. Is there a way feature detect such a thing?

like image 377
James Hughes Avatar asked Nov 20 '25 06:11

James Hughes


1 Answers

I am not entirely sure this is possible using feature detection. Not reliably anyway. I have decided to use the above Silverlight.supportedUserAgent.js library instead.

like image 75
James Hughes Avatar answered Nov 21 '25 20:11

James Hughes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!