This repository was archived by the owner on Feb 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 260
JEP Menuitems
Erik Vold edited this page Aug 20, 2013
·
9 revisions
It should be possible to create menuitems for browser windows on Firefox and Fennec.
Sidebars and Toolbars require menuitems in the (View - > Sidebar/Toolbar) menu. DevTools require a menuitem in Tools -> Web Developer. Firefox itself, and many add-ons, provide toolbarbutton-menus for which other add-ons would like to extend (example: the Bookmarks toolbar button).
The design would closely match that for Context Menuitems, but leave out all of the extra context related events and message passing.
- options
-
Stringlabel: the text displayed in the menuitem. -
ArrayIntegerorStringmenu: describes menu which the menuitem will live under. If a array is used then the first valid parent in the array will be used. -
Boolean[enabled]: this should befalseif you want the menuitem to be displayed and unclickable. -
Boolean[visible]: this should befalseif you want the menuitem to be hidden, default istrue.
-
-
Stringid (only getter): the id for the menuitem. -
Stringlabel (only getter): the text displayed in the menuitem. -
Booleanenabled (getter and setter): the enabled state of the menuitem. -
Booleanvisible (getter and setter): the visible state of the menuitem.
- destroy: destroys the menuitem
- click
var { Menuitem } = require('sdk/ui');
var menuitem = Menuitem({
label: "Not Checked",
menu: [ Menuitem.FILE_MENU, Menuitem.APP_MENU ],
onClick: function() {
// do something..
}
})var { Menuitem } = require('sdk/ui');
var menuitem = Menuitem({
label: "Not Checked",
menu: [ 'file', 'application' ],
onClick: function() {
// do something..
}
})