Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
BarButton for Addons SDK
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
data
doc
lib
test revision 3
README.md
barbutton.xpi revision 3
package.json
package.json.backup

README.md

BarButton for Mozilla Add-on SDK

Usage

exports.main = function() {
    var bb = require("barbutton");
    var data = require("self").data;

    // create the panel
    var panel = require("panel").Panel({
        width: 180,
        height: 180,
        contentURL: "https://en.wikipedia.org/w/index.php?title=Jetpack&useformat=mobile"
    });

    // create the barButton with "id , image and Panel"
    let barbutton = bb.BarButton({
        id: "firefox-barbutton",
        image: data.url("image.png"),
        panel:panel
    });

};

Screenshot

BarButton screenshot

Options

  • id (required)
  • image (required)
  • panel - a panel to be shown when the user click on the barbutton . (optional)

Methods

collapsed

// hide the barbutton
barbutton.collapsed(true);

// show the barbutton
barbutton.collapsed(false);

setImage

// set Image of the barButton
barbutton.setImage(data.url("image.png"));

Addons using it

Something went wrong with that request. Please try again.