Plugins (or plug-ins) are shared libraries that users can install to display content that the application itself can't display natively. For example, the Adobe Reader plugin lets the user open PDF files directly inside the browser, and the QuickTime and RealPlayer plugins are used to play special format videos in a web page.
Plugins can be useful when building an application using the Mozilla framework. For example ActiveState Komodo uses plugins to embed the Scintilla editor in its XUL-based UI.
Plugins are written using NPAPI, the cross-browser API for plugins. The main source of documentation for NPAPI is the Gecko Plugin API Reference. To make your plugin scriptable from web pages, use npruntime. The older XPCOM- and LiveConnect-based APIs for plugins should not be used. The technologies themselves continue to be used, just not for plugins.
Plugins can be written completely from scratch using C APIs (usually in C or C++) or they may be built on a plugin framework such as Firebreath, JUCE, or QtBrowserPlugin. There are also some code generation tools that may be helpful. More information about these tools can be found External Resources page.
You can use SVG or Canvas for simpler tasks of script-driven graphics and animation.
Plugins are different from extensions, which modify or enhance the functionality of the browser itself. Plugins are also different from search plugins, which plug additional search engines in the search bar.
- Gecko Plugin API Reference (NPAPI)
- This reference describes the application programming interfaces for NPAPI plugins and provides information about how to use these interfaces.
- Scripting plugins (npruntime)
- This reference describes the new cross-browser NPAPI extensions that let plugins be scriptable and also let them access the script objects in the browser.
- Gecko SDK
- The Gecko SDK contains all of the tools and headers needed for making scriptable plugins for Gecko, including latest
npapi.h and associated headers and tools.
- Out of process plugins
- Firefox 3.6.4 introduced out-of-process plugins which execute in a separate process so that a crashing plugin does not crash the browser.
- Shipping a plugin as a Toolkit bundle
- Plugins can be shipped as a Toolkit bundle, allowing a user to easily install, uninstall and manage their personal plugins.
- Detecting Plugins
- Supporting private browsing in plugins
- Firefox 3.5 introduced support for private browsing; learn how to make your plugin respect the user's privacy wishes.
- Multi-Process Plugin Architecture
- How Firefox loads plugins into a separate process
- Logging and Debugging for Multi-Process Plugins
- How to create a plugin log to aid in debugging problems with multi-process plugins.
- Writing a plugin for Mac OS X
- Learn how to write a plugin for Mac OS X; a template Xcode project is provided.
- Monitoring Plugins
- Use an observer service notification to monitor the amount of time spent executing calls in plugins. This can be useful when trying to determine if a plug-in is consuming too many resources.
- Scripting Plugins: Macromedia Flash
- Plugins: The First Install Problem
- The First Install Problem is the name given to the conditions arising when a plugin or embeddable software installs itself on a system first, before any other Gecko-based browser.
- ActiveX Control for Hosting Netscape Plug-ins in IE
- Microsoft has removed support for Netscape plug-ins from IE 5.5 SP2 and beyond. If you are a plugin author, you may find this project saves you a lot of work!
- Plugins: Samples and Test Cases
- NPAPI plugin samples and test cases.
- External Resources for Plugin Creation
- External projects, frameworks, and blog posts that may be useful.
- XEmbed Extension for Mozilla Plugins
- Recent versions of Mozilla on *nix-based systems include an extension for writing plugins that use XEmbed instead of using the old Xt-based main loop that most plugins have been using since the Netscape 3.x days.