Detecting Plugins in Internet Explorer - IE's Approach
(Page 3 of 7 )
Unfortunately, Microsoft's Internet Explorer is not quite as helpful; the browser itself has no plugins array (and doesn't actually support plug-ins) so JavaScript cannot be employed quickly and easily to provide a report of any installed plug-ins. ActiveX objects (often called activeX controls) are implemented in Explorer in much the same way as plug-ins; however, it should be noted that they are separate things. Makers of plug-ins will have to produce separate activeX objects for use specifically in IE.
One of the things plug-in makers need to do when creating their activeX objects is to assign these objects a unique value known as the CLSID or classid. One of the ways in which we can test the browser for installed objects is through the use of this CLSID value, which is different for all activeX objects. Some differing versions of the same activeX object will have the same CLSID value, however; Windows Media Player 7 and 8 are an example of this, which have a CLSID of {6BF52A52-394A-11D3-B153-00C04F79FAA6}. You can find this value and others in the Windows registry using RegEdit or a similar tool.
Another value that these objects will has is the progID; again, these strings are unique to the object they represent, but different versions of the same object may share the same progID, and the versions that a progID refer to may not be logical. For example, the progID for Shockwave Player version 6 is SWCtl.SWCtl.1, whereas the progID for version 7 is SWCtl.SWCtl.7 which makes detecting player versions prior to version 6 somewhat difficult. In reality however, it is unlikely that many people have a version this old installed on their systems.
In truth, you could probably get away with writing an expression that tested for versions 8, 7, 6 or less than 6, rather than testing for every single version. This is just an example however; Shockwave Player is now at version 10, and tests for this will be worked into our object tester. Another thing to watch for is that applications may suddenly change their progID values between versions for no logical reason; Adobe’s Acrobat Reader version 6 has a progID of PDF.PdfCtrl.6, whereas Acrobat Reader version 7 has the progID AcroPDF.PDF.1 which again, can make things tricky if you don’t arm yourself with the correct information each time a new version of the plug-in is released.
You could, of course, have a page on your site that had embedded files of all major plug-ins on it, and some text below each one that says something like: if this file fails to play, you do not have an appropriate player/plug-in installed. But frankly, this is rubbish.
Next: Getting started >>
More Windows Scripting Articles
More By Dan Wellman