Detect Silverlight plugin in Firefox

hi.. i need to detect the silverlight plugin in client browser's..
if the SL plugin is intalled on the client machine it will show the silverlight gallery if its not installed means, it should show the silverlight image with the installation link..


i have used this following example
 http://www.adefwebserver.com/DotNetNukeHELP/Misc/Silverlight/DetectSilverlight/Default.html.

its detecting the SL in IE and Chrome.,

problem its not detecting in Firefox

LVL 2
Rajeshk_cgmAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rajeshk_cgmAuthor Commented:
Guys actually in Firefox its detected the plugin. but still the message(silverlight is not installed on your system is showing)..

but in the case of IE and Chorme the message is not showing and the SL Gallery is working fine..

Even in Firefox also SL Gallery is working, but its stll showing the message..
SL-in-Firefox.bmp
0
David H.H.LeeCommented:
Hi Rajeshk_cgm,
Ok, i have one simpler solution to detect silverLight plugin in all the browser.
The details can be found here:
http://www.apijunkie.com/APIJunkie/blog/post/2009/04/How-to-programmatically-detect-Silverlight-version.aspx

<script>
//////////////////////////////////////////////////////////////////
// get major Silverlight version
 
// Return values:
 
// 0 -> Silverlight not installed (at least not properly).
 
// 1 -> Silverlight 1 installed
 
// 2-> Silverlight 2 installed
 
// 2-> Silverlight 3 installed
 
//////////////////////////////////////////////////////////////////
 
getSilverlightVersion = function() {
var SLVersion;
 
try {  
 
       try {
            var control = new ActiveXObject('AgControl.AgControl');
 
            if (control.IsVersionSupported("3.0"))                
 
               SLVersion = 3;
            else
 
            if (control.IsVersionSupported("2.0"))               
 
               SLVersion = 2;
            else
 
               SLVersion = 1;           
 
            control = null;
      }
 
      catch (e) {      
 
                     var plugin = navigator.plugins["Silverlight Plug-In"];
                     if (plugin)
 
                     {         
 
                       if (plugin.description === "1.0.30226.2")             
 
                          SLVersion = 2;
                       else
 
                          SLVersion = parseInt(plugin.description[0]);
                      }
 
                      else
 
                         SLVersion = 0;
      }
 
}
 
catch (e) { 
 
      SLVersion = 0;
}
 
return SLVersion;
}
 
if(getSilverlightVersion()=="0"){
 //no silverlight
 document.getElementById("noSilverlight").style.display='block';
}
 
</script>
 
<div id="noSilverlight" style="display:none">
        Silverlight is not installed. Click <a href='http://www.microsoft.com/silverlight/resources/install.aspx' target="_blank">here</a> to install Silverlight plugin.
    </div>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
David H.H.LeeCommented:
Great C? The code tested under all platform and it's working fine. May i know the reason?
0
Rajeshk_cgmAuthor Commented:
hi..

Extremely sorry.. X Com..

Its working very fine... Its such a nice coding which you give.,

And now its working fine with IE, Chrome, and Firefox

i didnt seen the Grade Properly., due to lack of timing, just like that i clicked and accept it as a solution..

Hope it wont happen again..

0
David H.H.LeeCommented:
Sorry for the delay response.

@Vee_Mod,
Thanks for your support.


@Rajeshk_cgm,
Ok, noted with for the grade changes.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.