BarButton for Addons SDK
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
data
doc
lib
test
README.md
barbutton.xpi
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