The PageActions object is only available to privileged code running on Firefox for Android, and is intended for use by Firefox for Android add-ons.
NOTE: PageActions.jsm replaces NativeWindow.pageactions in Firefox 34. To maintain backward compatibility NativeWindow.pageaction will still return a reference to the PageActions object, but new code should use the new JSM.


Contains the PageActions object, which can be used to add items to the Firefox for Android url/title bar, and subsequently remove them. You can add an item using PageActions.add() and remove it using PageActions.remove(). Import the script by inserting:


PageActions.add() returns a uuid which you can subsequently pass into PageActions.remove() to remove the item.

NOTE: A maximum of two page action items will be shown to users at a time. If users have three page actions showing, an overflow menu will appear to handle the extra ones. Your action has NO control over whether its shown in the urlbar or overflow. Don't depend on your page action always showing in the main urlbar.


The following example adds a pageaction item which is displayed whenever the user is viewing a page from a domain. Selecting the page action shows an alert.


var uuid = null;
function pageLoad(event) {
  var win = event.originalTarget.defaultView;

  if ( == "" && !uuid) {
    uuid = Pageactions.add({
      icon: "drawable://alert_app",
      title: "My page action",
      clickCallback: function() { win.alert("Clicked!"); }
  } else if (uuid) {



id add(options)

Adds a page action to the urlbar.


The options object describes the page action. It may contain:
Attribute Description
title The name shown to the use when your pageaction is shown as a menuitem
icon The icon shown to the use when your pageaction is shown in the urlbar. This icon will also be shown on the menuitem if page actions are overflowing. This icon should be 24x24dip to match the default icons that are included with the browser.
clickCallback The function to call if your page action is clicked.
longClickCallback Optional: The function to call if your page action is long tapped. Only page actions that are shown in the urlbar can be long tapped. Ones shown in the overflow menu can NOT be long pressed. Since you have no control over whether your icon is shown in the urlbar or in overflow, don't depend on this behaviour being available to users.


Returns the id of the page action that was added. You should store this if you want to remove the page action in the future


void remove(id)

Removes the page action associated with an id.


The id of the page action to remove

Document Tags and Contributors

 Contributors to this page: wbamberg, alex_johnson, wesj
 Last updated by: wbamberg,