<p>How can I efficiently and effectively detect the version and, for that matter, any available information about the instance of <a href="http://silverlight.net/" rel="nofollow noreferrer">Silverlight</a> currently running on the browser?</p>

[{'answer_id': 20729, 'author': 'Stu', 'author_id': 414, 'author_profile': 'https://Stackoverflow.com/users/414', 'pm_score': 0, 'selected': False, 'text': '<p>Look in silverlight.js:</p>\n\n<p><a href="http://forums.asp.net/p/1135746/1997617.aspx#1997617" rel="nofollow noreferrer">http://forums.asp.net/p/1135746/1997617.aspx#1997617</a></p>\n'}, {'answer_id': 20745, 'author': 'Bryan Roth', 'author_id': 299, 'author_profile': 'https://Stackoverflow.com/users/299', 'pm_score': 2, 'selected': False, 'text': '<p>I got this from <a href="http://forums.asp.net/p/1135746/1997617.aspx#1997617" rel="nofollow noreferrer">http://forums.asp.net/p/1135746/1997617.aspx#1997617</a> which is the same link <a href="https://stackoverflow.com/users/414/stu">Stu</a> gave you.  I just included the code snippet.</p>\n\n<pre><code>Silverlight.isInstalled = function(d)\n{\n    var c = false, a = null;\n    try\n    {\n        var b = null;\n        if(Silverlight.ua.Browser == "MSIE")\n            b = new ActiveXObject("AgControl.AgControl");\n        else\n            if(navigator.plugins["Silverlight Plug-In"])\n            {\n                a = document.createElement("div");\n                document.body.appendChild(a);\n                a.innerHTML = \'&lt;embed type="application/x-silverlight" /&gt;\';\n                b = a.childNodes[0]\n            }\n\n        if(b.IsVersionSupported(d))\n            c = true;\n        b = null;\n        Silverlight.available = true\n    }\n    catch(e)\n    {\n        c=false\n    }\n\n    if(a)\n        document.body.removeChild(a);\n    return c\n};\n</code></pre>\n'}, {'answer_id': 26956, 'author': 'Jon Galloway', 'author_id': 5, 'author_profile': 'https://Stackoverflow.com/users/5', 'pm_score': 4, 'selected': True, 'text': '<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>\n\n<pre><code>if(slPlugin.isVersionSupported("2.0")) {\n  alert("I haz some flavour of Silverlight 2");\n</code></pre>\n\n<p>You can be as specific as you want when checking the build, since the version string can include all of the following:</p>\n\n<ul>\n<li>major - the major number</li>\n<li>minor - the minor number</li>\n<li>build - the build number</li>\n<li>revision - the revision number</li>\n</ul>\n\n<p>So we can check for a specific build number as follows:</p>\n\n<pre><code>if(slPlugin.isVersionSupported("2.0.30523")) {\n  alert("I haz Silverlight 2.0.30523, but could be any revision.");\n</code></pre>\n\n<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>\n\n<p>That being said, you can get the Silverlight version number in Firefox by checking the Silverlight plugin description:</p>\n\n<pre><code>alert(navigator.plugins["Silverlight Plug-In"].description);\n</code></pre>\n\n<p>Shows \'2.0.30523.8\' on my computer.</p>\n\n<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>\n'}, {'answer_id': 790573, 'author': 'APIJunkie', 'author_id': 96169, 'author_profile': 'https://Stackoverflow.com/users/96169', 'pm_score': 1, 'selected': False, 'text': '<p>As mentioned in the above comments there is currently no efficient direct way to get the installed Silverlight version number (that works cross browser platform).</p>\n\n<p>I wrote a post on how to workaround this problem and detect the Silverlight major version number (including version 3) programmatically and more efficiently using JavaScript.</p>\n\n<p>You can find the code and the post at:</p>\n\n<p><a href="http://www.apijunkie.com/APIJunkie/blog/post/2009/04/How-to-programmatically-detect-Silverlight-version.aspx" rel="nofollow noreferrer">http://www.apijunkie.com/APIJunkie/blog/post/2009/04/How-to-programmatically-detect-Silverlight-version.aspx</a></p>\n\n<p>Good luck!</p>\n'}, {'answer_id': 1460758, 'author': 'Brady Moritz', 'author_id': 177242, 'author_profile': 'https://Stackoverflow.com/users/177242', 'pm_score': 2, 'selected': False, 'text': '<p>found this site that detects the full version of silverlight- <a href="http://www.silverlightversion.com" rel="nofollow noreferrer">silverlight version</a> (aka silverlightversion.com)</p>\n'}, {'answer_id': 11331849, 'author': 'eFloh', 'author_id': 543303, 'author_profile': 'https://Stackoverflow.com/users/543303', 'pm_score': 1, 'selected': False, 'text': '<p>Environment.Version will do what you want! Supported since Silverlight 2.0</p>\n'}]
['https://Stackoverflow.com/questions/20722', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/375/']