Mozilla::DOM - Perl wrapping of the Mozilla/Gecko DOM
# In Makefile.PL (see Gtk2::MozEmbed for an example) my $embed = ExtUtils::Depends->new('Mozilla::DOM'); $embed->set_inc(...); ... # You also need to compile with C++ WriteMakefile( ... CC => 'c++', XSOPT => '-C++', $embed->get_makefile_vars, );
The current purpose of this module is to wrap DOM event methods to be used with the Gtk2::MozEmbed module, which allows you to use GtkMozEmbed from Perl. GtkMozEmbed in turn allows you to use Mozilla's Gecko as a Gtk widget. Gtk2::MozEmbed has signal marshallers which rely on this module to map between the nsIDOM* interfaces and Gtk-Perl. There's nothing in this module (as far as I know) that is specific to GtkMozEmbed, however, so other Perl modules based on Gecko could use this (if they existed).
Future plans include wrapping more DOM interfaces such as nsIWebBrowser (requiring support in Gtk2::MozEmbed for gtk_moz_embed_get_nsIWebBrowser), nsIDOMWindow, and nsIDOMDocument. With this, you'd get access to the DOM, with methods such as GetElementsByTagName. Adding more support for DOM events would allow finding out more about an event and its targets, initiating events, and adding listeners. The idea is to then be able to script a Gecko-based browser from Perl. However, for the moment the functionality provided by this module probably isn't very useful.
In particular the sections on Key and Mouse events.
The header files for GtkMozEmbed.
A C++ example of using GtkMozEmbed to make a minimal browser.
The header files for Mozilla's interfaces. Generally, if a module is called Mozilla::DOM::Something, the corresponding header file is named 'nsIDOMSomething.h'. Three exceptions are nsISupports, nsIWebBrowser, and nsISelection.
Description of the Mozilla Public API
Gecko Embedding FAQ
GtkMozEmbed: Gtk Mozilla Embedding Widget
with a lot of help from Torsten Schoenfeld <kaffeetisch at gmx dot de>.
Copyright (C) 2005 by Scott Lanning
To install Mozilla::DOM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mozilla::DOM
CPAN shell
perl -MCPAN -e shell install Mozilla::DOM
For more information on module installation, please visit the detailed CPAN module installation guide.