Access Keys:
Skip to content (Access Key - 0)
Log in (Access Key - 5)



Toggle Sidebar

Plugins

Molybdenum Plugins (Proposal)

Introduction

It should be possible to extend Molybdenum with plugins. Possible types of plugins are:

  • Reporters
  • Commands
  • Recorder Plugins
    • Locators
    • Filters
    • EventHandler

The Firefox extension mechanism should be used for Molybdenum plugins, so we do not reinvent the wheel again. Version handling installation, updating should word out of the box. Additionally we can use already existing platforms like AMO to spread the plugins.

Concept

Each Molybdenum plugin must have a file named MolybdenumPlugin.js in the root of the chrome content directory. This file is a regular Javascript file containing exactly one Javascript object named PluginDescriptor.

/**
 * Get information about provided functionality.
 */
function PluginDescriptor {}

/**
 * Return an array of reporters provided. 
 * @result [Reporter] Can be null or empty.
 */
PluginDescriptor.prototype.getReporters()

/**
 * Write a report.
 */
function Reporter {}

/**
 * @param doc {XMLDocument} the document containing the results to be written to a report.
 * @param file {String} path of the report file to be written. Additional files have to be stored relative to this file.
 */
Reporter.prototype.writeReport(doc, file)

Realization

Plugin lookup
  1. find all extensions dependent on Molybdenum
  2. scan the chrome manifest if present
  3. try to load the MolybdenumPlugin.js
  4. process the PluginDescriptor
Transitive dependencies

There is no xul or html to manage transitive dependencies of javascript for plugins.

If your plugin is compatible with Firefox 3.x and upwards you can use Javascript modules.
If the plugin should run in Firefox 2.x as well, copy the MolyBase.js from Molybdenum components directory to your directory and change the following:

const CLASS_ID = Components.ID("{<your own uuid for this service}");
const CLASS_NAME = "Service to organize javascript modules in <your plugin>";
const CONTRACT_ID = "<contract id for your service>";

const BASEURI = "<chrome content url of your plugin>/modules/";
UI

Overlays, preferences can be used as for a normal Firefox extension.

last edited on May 03, 2009 19:46
Adaptavist Theme Builder Powered by Atlassian Confluence