Determine if Silverlight can be installed

I am developing a page that should work in various scripts that are defined using JavaScript. First, if Silverlight is installed, it must use Silverlight. Plain.

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

Next, I need to determine if Silverlight can be installed. This is a hard bit. Basically, if I look at this, say, for example, iPad (but can be any device that does not support Silverlight), I want to use simple HTML. But if I am on a desktop computer that does not have Silverlight installed, but I can install it, I will not install the usual Silverlight material.

Silverlight.getSilverlight();

I saw Silverlight.supportedUserAgent.js , but, like most UA sniffing methods, a bit back. Is there any way to detect such a thing?

+3
source share
1 answer

I'm not quite sure that this is possible using function detection. In any case, reliable. Instead, I decided to use the Silverlight.supportedUserAgent.js above.

+1
source

Source: https://habr.com/ru/post/1774319/


All Articles