Firefox for Android supports add-ons using the same extension system used by all other Gecko-based applications. You can use the Add-on SDK or build manually bootstrapped restartless add-ons. You can even develop traditional restart-required add-ons, although the other two approaches are preferable.
Add-ons that work with desktop Firefox do not automatically work in Firefox for Android:
- There is no visible XUL in the UI, so you can't use an overlay to create the UI.
- Internal code and objects, like
gBrowser, do not exist. Look at the Firefox on Android
browser.jsfile to learn about the internals. Much of the same fundamental functionality exists.
- Services like
nsIAlertsServiceare implemented to use native Android UI.
NativeWindow, that allows you to manipulate parts of the native Android UI.
The following articles provide help with developing extensions for Firefox on Android. In addition, please refer to the general extension documentation that applies to all Mozilla applications.
- Developing, packaging and installing a simple add-on for Firefox for Android.
- Initialization and Cleanup
- How to initialize your add-on when it is started and clean up when it is shut down.
- Add-on SDK
- How to develop Firefox for Android add-ons using the Add-on SDK.