Skip to content

AbdullahDiaa/BarButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

BarButton for Addons SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published