Lobo Browser Plugin HOWTO
Lobo can be extended via plugins written in
Java (or a language compiled to
Since version 0.97 of Lobo, the browser can be
extended in the following ways.
- Alteration of browser window: Addition and modification
of top-level menues, address bar components, tool bars,
and status bar components.
- Clientlet selectors: You can add handlers
for various content types. This can be leveraged
to have Lobo render UI languages other than
HTML. The HTML and JavaFX rendering capabilities of Lobo are
implemented as clientlets.
- URL protocol stream handlers: You can add
protocol handler factories for protocols other
than HTTP, FTP, etc.
- Events: You can add listeners for various browser
navigation and error events.
Lobo extensions have access to the standard Java API, plus the
Lobo Clientlet and Extensions API.
The JAR file that accompanies this API is
is found in the installation directory of the Lobo browser.
Extensions are required to implement
the NavigatorExtension interface.
Extensions are packaged as JAR files, with the peculiarty that
the root level of the JAR file must include an entry
the following properties.
- extension.class: The fully-qualified name of a class
that implements NavigatorExtension.
- extension.name: The name of the extension.
- extension.description: A description of the extension.
- extension.version: The version of the extension.
- extension.priority: The priority of the extension, which
is a number from 0 to 9.
As of version 0.97 of Lobo, extension JAR files are installed
by copying them into the
ext directory that is
found in a Lobo installation.
Separate library JAR files that the extension relies on can
be copied into the
ext directory as well.
Each extension JAR file is loaded by a separate class loader.
Libraries in the
ext directory (i.e. JAR files
lobo-extension.properties file) are
all loaded by a single class loader that is the parent of all
extension class loaders.
For testing purposes, the
ext directory may also
contain directories in place of JAR files.
Each extension has a priority, which is a number from 0 to 9, as specified
extension.priority property in
The primary browser extension (identified as a JAR file whose
primary.jar) is allowed to have a priority of 10.
The primary extension in Lobo is in charge of rendering HTML, images, processing
downloads, showing most of the browser GUI, implementing all default menues, etc.
The API documentation indicates how priorities are used by different facilities.
When Lobo starts up, it looks for extension JAR files by scanning
ext directory. The class specified by the
extension.class property in
is loaded, and its init() method executed.
At this point the extension can register clientlet selectors, custom protocol handlers or add listeners for
generic browser events.
Execution of the
init() method can occur in any thread, and several
extensions could have their
init() methods execute concurrently.
When a Lobo window is about to be opened, the
method is called. At this point, the extension can add menues, toolbars and other components
to the browser window. Lobo invokes the
windowOpening() method sequentially in
order of descending extension priority.
It is possible for one extension
to look up a menu added by a previously initialized extension, and add menu items to it.
There is a standard identification convention for Lobo menues,
as explained in the
When a Lobo window is about to be closed, the
method is called.
While the Lobo browser and its API are released under the GPL license, and Cobra
is released under a LGPL license, the clientlet and extensions API (lobo-pub.jar)
is released under a FreeBSD style license. The FreeBSD license is
a permissive license that is compatible with the GPL according to
Note that the clientlet and extensions API is not dependent
on any other part of the Lobo Project. Instead, the Lobo browser is
an "implementor" of the API.
Support The Project