Introduction

This is the Embedding distribution of Mozilla. It serves as a reference and smoketest distribution to demonstrate a typical subset of Mozilla needed to embed it into another application. The distribution contains sample applications for testing and development purposes.

Please note the phrase typical subset! If you want to use a different subset then see the customizing the embedding distribution section below.

Where can I find more information about embedding?

Mozilla.org - http://www.mozilla.org/.

The Embedding project page - http://www.mozilla.org/projects/embedding/. This page should serve as your main point of information for learning how to embed Mozilla in your own applications.

The Embedding Frequently Asked Questions (FAQ) page - http://www.mozilla.org/projects/embedding/faq.html

The Embedding newsgroup - news:netscape.public.mozilla.embedding.

The Embedding QA page - http://www.mozilla.org/quality/embed/.

Instructions for building Mozilla (including Embedding) - http://www.mozilla.org/build/.

Instructions for fetching Mozilla source code (including Embedding) - http://www.mozilla.org/source.html.

Contents

The distribution contains, libraries, resources and chrome. All of this is a subset of Mozilla, repackaged for embedding. The layout follows the usual Mozilla directory, i.e.

Unix

TestGtkEmbed

A simple browser application built using the GTK+ Browser Widget.

GTK+ Browser Widget

A GTK+ widget for embedding Mozilla into GTK+/GNOME applications such as Galeon. More information about the widget may be found here http://www.mozilla.org/unix/gtk-embedding.html.

Windows

MFCEmbed

A complete browser application written in MFC and the Gecko embedding APIs. This application demonstrates and exercises the functionality necessary to put together a fully featured browser using Gecko.

Mozilla ActiveX Control

An ActiveX browser control built with the embedding APIs. You may use the control to embed a browser inside applications written in VB, Delphi etc. More information about the control including installation instructions may be found at http://www.iol.ie/~locka/mozilla/mozilla.htm.

Macintosh

There is no Macintosh distribution at present, though an embedding test application PPEmbed is built as part of a standard Mac build. Work on Fizilla Mach may also yield a Mac embedding distribution in the future.

Installation and Usage

Unix

  1. Untar the embedding distribution into an empty directory of your choice.
  2. From the command-line, cd into the directory and type './run-mozilla.sh ./TestGtkEmbed'

Windows

  1. Unzip the embedding distribution into an empty directory of your choice.
  2. Double-click on mfcembed.exe

Customizing the embedding distribution

The embedding distribution is produced by first building the full Mozilla source and cherry picking files and chrome into a separate embedding directory. Basically the steps are:

  1. Build Mozilla as usual
  2. cd mozilla/embedding/config
  3. make

The embedding distribution will appear in mozilla/dist/Embed.

The build process works by reading a file called basebrowser-win (or basebrowser-unix, basebrowser-mac-macho etc.) and copying the listed files from mozilla/dist/bin into mozilla/dist/Embed. It then reads a file called embed-jar.mn and repackages the specified chrome files and directories into a single embed.jar.

The build process also also looks for a file called client-win (or client-unix, client-mac-macho etc.) and if present copies from there as well. This file allows embedders to specify files to be added or removed from the default embedding distribution.

For example if you wanted a distribution containing character converters for various character sets, but not the ActiveX control you might define a client-win like this:

[Embed]
components\ucvja.dll
components\ucvko.dll
components\ucvcn.dll
components\ucvtw.dll
components\ucvtw2.dll
components\ucvibm.dll
-mozctl.dll
-mozctlx.dll

When the build process is run, the files from embed-win will be copied first and then those in client-win. Minus signs in front of filenames delete the files, so the previous example would delete mozctl.dll and mozctlx.dll.