ActiveX Control for Hosting Netscape Plug-ins in IE

  • Revision slug: ActiveX_Control_for_Hosting_Netscape_Plug-ins_in_IE
  • Revision title: ActiveX Control for Hosting Netscape Plug-ins in IE
  • Revision id: 186601
  • Created:
  • Creator: Ptak82
  • Is current revision? Yes
  • Comment Undo revision 52503 by [[Special:Contributions/NvhD4a]] ([[User talk:NvhD4a]])

Revision Content

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:

  • <PARAM name="type" ...> is equivalent to TYPE
    Specifies the MIME type of the plug-in. The control uses this value to determine which plug-in it should create to handle the content.
  • <PARAM name="src" ...> is equivalent to SRC
    Specifies an URL for the initial stream of data to feed the plug-in. If you havent't specified a "type" PARAM, the control will attempt to use the MIME type of this stream to create the correct plug-in.
  • <PARAM name="pluginspage" ...> is equivalent to PLUGINSPAGE
    Specifies a URL where the plug-in may be installed from. The default plug-in will redirect you to this page when you do not have the correct plug-in installed.

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

Still to do

  • Only hosts windowed plug-ins.
  • An official pluginhostctrl.cab file.
  • Doesn't work for the Adobe Acrobat plug-in yet.
  • Plug-ins cannot create writeable streams or seek in readable streams.
  • LiveConnect scripting is not supported. If you need scripting functionality, consider shipping a modified pluginhostctrl.dll that exposes methods you wish to call on your plugin.

Revision Source

<h2 id="Introduction" name="Introduction">Introduction</h2>
<p>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!
</p><p>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. </p><p>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.
</p><p>The sections below tell you how to fetch, build and use the pluginhostctrl.dll .
</p>
<h2 id="Get_the_source" name="Get_the_source">Get the source</h2>
<p>You need CVS to get the source code. Assuming you have CVS somewhere in your path, type this from a command prompt:
</p>
<pre>C:\&gt; set CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot
C:\&gt; set HOME=\TEMP
C:\&gt; cvs login
(Logging in to anonymous@cvs-mirror.mozilla.org)
CVS password: anonymous
C:\&gt; cvs -z3 co mozilla/embedding/browser/activex/src/pluginhostctrl
</pre>
<p>This fetches the source for the control into mozilla\embedding\browser\activex\src\pluginhostctrl. </p><p>You can also see the code <a class="external" href="http://lxr.mozilla.org/seamonkey/source/embedding/browser/activex/src/pluginhostctrl/">online</a>.
</p>
<h2 id="Build_it" name="Build_it">Build it</h2>
<p>It is quite simple to build the control
</p>
<ol><li> Locate the pluginhostctrl directory:
</li><li> Open pluginhostctrl.dsp
</li><li> Build "Win32 Debug" or another target
</li><li> Open some of the test files under pluginhostctrl\tests in Internet Explorer to verify the control has built and registered correctly.
</li></ol>
<p>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.
</p>
<h2 id="A_note_to_developers" name="A_note_to_developers">A note to developers</h2>
<p>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.
</p><p>It is advisable to rename the control and not to install somewhere like the Windows directory where it is likely to be overridden.
</p><p>Use a tool such as guidgen.exe or uuidgen.exe to create the new GUIDs.
</p>
<h2 id="Package_it" name="Package_it">Package it</h2>
<p>There is a subdirectory named cab/ which contains a script and a README.txt for producing your own signed CAB files.
</p>
<h2 id="Manual_installation" name="Manual_installation">Manual installation</h2>
<p>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:
</p> <pre>regsvr32 pluginhostctrl.dll</pre>
<p>You must have administrator privileges to install a new control on operating systems such as Windows NT, 2000 &amp; XP.
</p>
<h2 id="Usage" name="Usage">Usage</h2>
<p>Insert some HTML like this into your content:
</p>
<pre>    &lt;OBJECT classid="CLSID:DBB2DE32-61F1-4F7F-BEB8-A37F5BC24EE2"
        width="500" height="300"&gt;
      &lt;PARAM name="type" value="video/quicktime"/&gt;
      &lt;PARAM name="src" value="http://www.foobar.com/some_movie.mov"/&gt;
      &lt;!-- Custom arguments --&gt;
      &lt;PARAM name="loop" value="true"/&gt;
    &lt;/OBJECT&gt;
</pre>
<p>The CLASSID attribute tells IE to create an instance of the plug-in hosting control, the WIDTH and HEIGHT specify the dimensions in pixels.
</p><p>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. </p><p>The following &lt;EMBED&gt; attributes have &lt;PARAM&gt; tag equivalents:
</p>
<ul><li> &lt;PARAM name="type" ...&gt; is equivalent to TYPE<br>Specifies the MIME type of the plug-in. The control uses this value to determine which plug-in it should create to handle the content.
</li><li> &lt;PARAM name="src" ...&gt; is equivalent to SRC<br>Specifies an URL for the initial stream of data to feed the plug-in. If you havent't specified a "type" PARAM, the control will attempt to use the MIME type of this stream to create the correct plug-in.
</li><li> &lt;PARAM name="pluginspage" ...&gt; is equivalent to PLUGINSPAGE<br>Specifies a URL where the plug-in may be installed from. The default plug-in will redirect you to this page when you do not have the correct plug-in installed.
</li></ul>
<p>You may also supply any custom plug-in parameters as additional &lt;PARAM&gt; elements.
</p>
<h2 id="Still_to_do" name="Still_to_do">Still to do</h2>
<ul><li> Only hosts windowed plug-ins.
</li><li> An official pluginhostctrl.cab file.
</li><li> Doesn't work for the Adobe Acrobat plug-in yet.
</li><li> Plug-ins cannot create writeable streams or seek in readable streams.
</li><li> LiveConnect scripting is not supported. If you need scripting functionality, consider shipping a modified pluginhostctrl.dll that exposes methods you wish to call on your plugin.
</li></ul>
Revert to this revision