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

MIME Types and Manifest Files

overview | display modes | examples | API index

MIME Types

MIME (Multipurpose Internet Mail Extensions) redefines the standard US-ASCII format for Internet mail messages. (RFCs 2045-2048 extend RFC 822, the earlier standard). In brief, these extensions allow for:

  • textual message bodies in other character sets
  • body formats other than just text
  • multi-part message bodies
  • textual header information in other character sets

MIME also defines new header fields such as MIME-Version, Content-Type, Content-Transfer Encoding, etc.

Of particular interest, the Content-Type Header Field consists of a (media) type and subtype, separated by a slash (/). Type declares the general media type, while subtype declares the specific format. For example,

video/mpeg

specifies that the general type of the media is video, while the specific format is mpeg.

For a detailed discussion of this topic, see http://www.oac.uci.edu/indiv/ehood/MIME/toc.html.

The above discussion relates abstractly to Internet mail messages, which contain header fields and bodies. The idea of MIME Type (type/subtype) is specifically used by the EMBED and OBJECT elements of an HTML page. TYPE, meaning MIME Type, is an attribute of both elements. It is used to inform the client about the type of data specified by the SCR or DATA attribute so that it can launch the right Plugin or helper application. - SRC is used with the EMBED element - DATA is used with the OBJECT element

Thus TYPE is specifying the MIME Type of the SRC or < code>DATA URL. However, in the case that the element specifies no SCR or DATA attribute (i.e., no external data is to be loaded), then MIME Type is simply being used to inform the browser about what type of Plugin or helper application should be launched. This usage differs from that where MIME Type indicates the Content-Type of a mail message (i.e., the media type of a data object).

One other use of MIME Type relates to browser applications: The navigator object is a browser object used to provide information about the brower and the platform on which it is running. It is not part of the Document Object Model. navigator has an array of objects called mimeTypes[], each of which specifies some MIME Type supported by the browser. A particular mimeType[] element, for example navigator.mimeType[n], has four attributes, one of which is called type. It is a MIME Type of the kind that we have been discussing, i.e., a Content-Type description consisting of a media type and subtype.)

Assuming that an SRC or DATA element is present, then a URL specifies a file to load, and the suffix, as mentioned in the next section, refers to the suffix of the file. For example, animationX.swf has the suffix .swf for a the Shockwave-Flash movie, whose MIME Type is application/x-shockwave-flash.

 

Manifest Files

A manifest file for a Pluglet should be in the following form:

MIMEDescription: type0; type1; ...; typeN: suffix0; suffix1; ... suffixM: Pluglet name
Pluglet-Class: pluglet_class_name

Where

type specifies a MIME Type.

suffix specifies a file suffix, as described above.

name is the Pluglet name and is arbitrary.

pluglet_class_name is the specific class name of the PlugletFactory for the Pluglet.

For example,

MIMEDescription: video/mpeg: mpg; mpeg: Pluglet JavaMediaPlayer
Pluglet-Class: JMPlayer

where JMPlayer corresponds to a JMPlayer.class file that is the factory for the Pluglet.

 


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