Windows Scripting
  Home arrow Windows Scripting arrow Page 4 - Detecting Plugins in Internet Explorer
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Detecting Plugins in Internet Explorer
By: Dan Wellman
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 28
    2005-04-18

    Table of Contents:
  • Detecting Plugins in Internet Explorer
  • How Navigator Handles the Problem
  • IE's Approach
  • Getting started
  • The heart of plug-in detection
  • Displaying the results
  • Extending the Script

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Detecting Plugins in Internet Explorer - Getting started


    (Page 4 of 7 )

    Detecting plug-ins in IE is not actually that difficult; ideally, you need to use VBScript. In fact, even if you use JavaScript, you still have to get the script to write the VBScript code, so for now we’ll cut out the middle-man and stick with the proprietary script language. Since you're targeting Microsoft Internet Explorer users only with the script, it will work. Please note that this article is not an article discussing cross-browser interoperability; I’m assuming that you already have a half-decent browser vendor detection and redirection or similar system.  This script will only work on MSIE browsers (ideally version 6)!

    It should be noted at this point also that it is not possible to detect these kinds of things using PHP, because of the way that server-side scripting works; the page is created before it is passed to the browser, so there is no way for the script on the server to get this kind of information until after the page has been created, and by then, it's too late.

    So, to begin, get yourself a basic HTML page set up; we’re not worried about presentation at this stage, so the following will do:

    <html>

    <head>

    <title>MSIE Plug-in Detection</title>

    </head>

    <body>

    <h1>Welcome to the Plug-in Detection Page</h1>

    </body>

    </html>

    The script is fairly long and fairly repetitive, but it is very basic considering and is easy enough to follow.  Yes, there are better ways of doing it to reduce the amount of code, but again, this is not an article discussing clean and efficient code, it’s about writing a script that has a specific purpose and works.

    Set the script tags in the body of the document and begin by adding the on error resume next statement:

    <script type="text/vbscript">

    on error resume next

    The script will not work without this statement.  Next, you can declare all of your variables, using the Dim statement followed by the name of each variable, but as we are including some version checking where possible, there are rather a lot of them and the script is long enough as it is. We’ll leave them out because, fortunately, variables do not have to be explicitly declared in VBScript. 

    More Windows Scripting Articles
    More By Dan Wellman


       · Thanks for the article. Its a big help, confirmed my suspicions that yet again IE is...
       · Thanks, I'm glad the article helped
       · createObject("Word.Application") will actually fire up WINWORD.EXE in the...
       · Interesting, thanks for pointing that out AllanDan
     

    WINDOWS SCRIPTING ARTICLES

    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH
    - Advanced Word Object Scripting
    - Reading and Printing Word Documents in WSH
    - Scripting Microsoft Word
    - Using WSH to Catalog MP3 Files
    - Reading MP3 ID3 Tags in WSH
    - A Brief Look at Menus in WPF
    - More Examples of Simplified Image Processing...
    - Completing a WPF To-Do List Application
    - Simplified Image Processing in GDI+





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
    Stay green...Green IT