Terjemahan ini belum lengkap. Sila bantu terjemahkan artikel ini daripada Bahasa Inggeris.
There are a couple of differences between desktop Firefox and Firefox for Android that are particularly relevant to add-on developers:
- there is no visible XUL in the user interface, so you can't use XUL overlays to create your add-on's UI
gBrowserobject does not exist, so you can't use
tabbrowserto interact with browser tabs
Instead, Firefox for Android provides its own APIs:
NativeWindowenables you to manipulate parts of the native Android UI
BrowserAppenables you to interact with browser tabs
- PageActions.jsm allows you to add buttons to the urlbar.
Prompt.jsmallows you to easily show native prompts, dialogs, menus, and lists
Notifications.jsmallows you to handle system notifcations
Home.jsmallows you to customize the home page
HomeProvider.jsmallows you to store data to show on the home page
Accounts.jsmallows you to start the Firefox Account set-up process
JavaAddonManager.jsmallows you to dynamically load and interface with compiled Java code.
Snackbars.jsmallows you to show Snackbar notification.
In these pages we've documented the main functions and properties exposed by these objects. To see all the details, refer to the code at
We also have some modules that don't ship with Firefox for Android but can be used in addons:
Sound.jsmlets you play sounds in the browser simply