Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Aug 2003
    scotland, edinburgh
    Thanked 1 Time in 1 Post

    Best way to detect Shockwave in IE


    I am wanting to detect if the users browser has the Shockwave plug-in installed. At the moment I am focussing on detecting it within IE.

    I have found two methods and I am not sure which one is the best.

    One method simply detects if the browser supports ActiveX in which case I create a new ActiveX object:

    var shockwaveInstalled = new ActiveXObject('SWCtl.SWCtl');
    Then check if it returns TRUE
    if(shockwaveInstalled) installed = true;
    else installed = false;
    Meanwhile there is a script that Adobe suggests I use which I found here:

    What differs in this script is it use JavaScript to write out VBScript that essentially calls the same ActiveX Object e.g.
    } else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
    	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
    	document.write('on error resume next \n');
    	document.write('set tSWControl = CreateObject("SWCtl.SWCtl") \n');
    	document.write('if IsObject(tSWControl) then \n');
    	document.write('tVersionString = tSWControl.ShockwaveVersion("") \n');
    	document.write('end if');
    	document.write('</SCRIPT\> \n');
    My feeling is I should avoid the VBScript method but I am not sure if it has a better compatibility with older versions of IE installed on older versions of Windows.

    Any thoughts?

    Last edited by tsclan; 06-25-2009 at 10:36 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts