Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The Silverlight control only has an <a href="http://msdn.microsoft.com/en-us/library/system.windows.interop.silverlighthost.isversionsupported(VS.95).aspx" rel="nofollow noreferrer">IsVersionSupported function</a>, which returns true / false when you give it a version number, e.g.:</p> <pre><code>if(slPlugin.isVersionSupported("2.0")) { alert("I haz some flavour of Silverlight 2"); </code></pre> <p>You can be as specific as you want when checking the build, since the version string can include all of the following:</p> <ul> <li>major - the major number</li> <li>minor - the minor number</li> <li>build - the build number</li> <li>revision - the revision number</li> </ul> <p>So we can check for a specific build number as follows:</p> <pre><code>if(slPlugin.isVersionSupported("2.0.30523")) { alert("I haz Silverlight 2.0.30523, but could be any revision."); </code></pre> <p><a href="http://msdn.microsoft.com/en-us/library/bb693297.aspx#replace_version" rel="nofollow noreferrer">Silverlight 1.0 Beta included a control.settings.version property, which was replaced with the isVersionSupported() method</a>. The idea is that you shouldn't be programming against specific versions of Silverlight. Rather, you should be checking if the client has <em>at least</em> verion 1.0, or 2.0, etc.</p> <p>That being said, you can get the Silverlight version number in Firefox by checking the Silverlight plugin description:</p> <pre><code>alert(navigator.plugins["Silverlight Plug-In"].description); </code></pre> <p>Shows '2.0.30523.8' on my computer.</p> <p>Note that it is possible to brute force it by iterating through all released version numbers. <a href="http://pages.citebite.com/w3o7qsydtr" rel="nofollow noreferrer">Presumably that's what BrowserHawk does</a> - they'll report which version of Silverlight the client has installed.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload