You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Pluglet Developers Guide

Pluglet Display Modes

overview | MIME types | examples | API index

There are two basic display modes for a Pluglet (or Plugin):

  • It can be embedded within an HTML page;
  • It can fully occupy a page of its own (hence it is referred to as a full-page Pluglet)

Embedded Pluglet

For Pluglets embedded within an HTML page, either the OBJECT or the EMBED element may be used.

Keep in mind when deciding how you want to embed a Pluglet in an HTML page, that the EMBED element is not part of standard HTML and that neither the Document Object Model (DOM) Specification 1 nor 2 lists it. Also bear in mind that, though both Netscape Communicator and Internet Explorer do support this element, support is not uniform. Currently, the direction is moving away from use of the EMBED element toward the OBJECT element.

Both the OBJECT and EMBED elements offer an extensive list of attributes. However, OBJECT elements may be nested within other OBJECT elements, and content-specific PARAM elements can be used between initial and closing OBJECT elements.

<OBJECT ...>
<PARAM ... > </OBJECT>

More information about the OBJECT element can be found at http://www.w3.org/MarkUp/.

The following shows a simple example of the OBJECT element invoking the (imaginary) ZeePlayer Pluglet when the .zee MIME type (surfZeeMovie.zee) is encountered:

<HTML>
<BODY>
<OBJECT type="video/x-zeemedia" data=" http://www.zee.com/surfZeeMovie.zee" name="ZeePlayer" height="400" width="600" >
// Nested objects and parameters could go here.
</OBJECT>
</BODY>
</HTML>

Nested objects (OBJECT elements) might be used to display other content should the ZeePlayer not be a registered Pluglet in the browser. Parameters (PARAM elements) could be used to pass specific information to the objects (Pluglets) when they are loaded.

The following shows how the EMBED element might handle the same content:

<HTML>
<BODY>
<EMBED type="video/x-zeemedia" src="http://www.zee.com/surfingZeeMovie.zee" name="ZeePlayer" height="400" width="600">
</EMBED>
</BODY>
</HTML>

Full-Page Pluglet

A full-page Pluglet can be invoked in three ways:

  • when a URL pointing to a file of the Pluglet MIME type is entered in the Address/URL field of the browser;
  • when JavaScript sets the document URL (e.g., document.URL=" http://www.zee.com/surfingZeeMovie.zee") to the URL pointing to the file, then opens it (e.g., document.open());
  • when an applet redirects the browser to the URL (via java.net.HttpURLConnection).

The result is a new page fully occupied by the Pluglet.

 


Blackwood Release 0.9/Netscape PR3 Last modified 2/05/2001