Introduction

Microsoft has removed support for Netscape plug-ins from IE 5.5 SP 2 and beyond. If you are a plug-in author, you may find this project saves you a lot of work!

This page describes a control that implements the NP API and hosts most Netscape-compatible plug-ins. Now you can use your plug-ins in any recent version of IE or in any other ActiveX container for that matter. The control itself is implemented in a DLL called pluginhostctrl.dll which is standalone from the rest of the Mozilla project.

If you're wondering how Microsoft used to support the NP API, look for a file called plugin.ocx in your Windows system directory. This 100k ActiveX control contains the entire NP API implementation and probably worked much like pluginhostctrl.dll does now.

The sections below tell you how to fetch, build and use the pluginhostctrl.dll .

Get the source

You need CVS to get the source code. Assuming you have CVS somewhere in your path, type this from a command prompt:

C:\> set CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
C:\> set HOME=\TEMP
C:\> cvs login
(Logging in to anonymous@cvs-mirror.mozilla.org)
CVS password: anonymous
C:\> cvs -z3 co mozilla/embedding/browser/activex/src/pluginhostctrl

This fetches the source for the control into mozilla\embedding\browser\activex\src\pluginhostctrl.

You can also see the code online.

Build it

It is quite simple to build the control

  1. Locate the pluginhostctrl directory:
  2. Open pluginhostctrl.dsp
  3. Build "Win32 Debug" or another target
  4. Open some of the test files under pluginhostctrl\tests in Internet Explorer to verify the control has built and registered correctly.

The control currently reads plug-ins from your most current Netscape 4.x and IE installations. There is no support for Mozilla or NS 6.x yet.

A note to developers

If you intend to modify this control IN ANY WAY then you MUST also change the CLSID from {DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2} to something else and any other GUIDs this control relies upon (IID, LIBIDs etc). This is necessary so that your control may coexist with the generic version and any other versions that other plug-ins vendors may have installed.

It is advisable to rename the control and not to install somewhere like the Windows directory where it is likely to be overridden.

Use a tool such as guidgen.exe or uuidgen.exe to create the new GUIDs.

Package it

There is a subdirectory named cab/ which contains a script and a README.txt for producing your own signed CAB files.

Manual installation

Assuming you have the precompiled pluginhostctrl.dll and wish to install it on a machine, you must register it either through an install script or manually:

regsvr32 pluginhostctrl.dll

You must have administrator privileges to install a new control on operating systems such as Windows NT, 2000 & XP.

Usage

Insert some HTML like this into your content:

    <OBJECT classid="CLSID:DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2"
        width="500" height="300">
      <PARAM name="type" value="video/quicktime"/>
      <PARAM name="src" value="http://www.foobar.com/some_movie.mov"/>
      <!-- Custom arguments -->
      <PARAM name="loop" value="true"/>
    </OBJECT>

The CLASSID attribute tells IE to create an instance of the plug-in hosting control, the WIDTH and HEIGHT specify the dimensions in pixels.

You may optionally specify a CODEBASE attribute if you have packaged the control into a CAB file and wish for it to be installed automatically.

The following <EMBED> attributes have <PARAM> tag equivalents:

You may also supply any custom plug-in parameters as additional <PARAM> elements.

Still to do