Open Bug 910146 Opened 11 years ago Updated 2 years ago

Add a method to add buttons to toolbox toolbar

Categories

(DevTools :: Framework, defect)

defect

Tracking

(Not tracked)

People

(Reporter: harth, Unassigned)

Details

Right now to add a button to the toolbar (like Tilt), we have to use gcli. There should be a method to do this without needing to add a gcli command.

Otherwise, it's confusing for an addon trying add a button to the toolbar. It would be confused about what "gcli" is, and it would have to change the "toolbarSpec" preference for the button to even show up. Also if we convert all the buttons to use addButton() instead of gcli.addCommand(), we wouldn't need to import gcli when we open the toolbox.
Adding Irakli, he's actually working on the devtools sdk.
Just adding some info about about the various ways that are being used to add buttons to the tab bar today.

When the toolbox is built, it processes gcli certain commands based on the "devtools.toolbox.toolbarSpec" preference.  One such command is 'splitconsole' (https://mxr.mozilla.org/mozilla-central/source/browser/devtools/commandline/BuiltinCommands.jsm#2279) - it will be processed by the toolbox in _buildButtons (https://mxr.mozilla.org/mozilla-central/source/browser/devtools/framework/toolbox.js#532).

The element creation is happening in CommandUtils.createButtons (https://mxr.mozilla.org/mozilla-central/source/browser/devtools/shared/DeveloperToolbar.jsm#79).  However, a similar element is constructed and appended to the tab bar by plugins like OpenWith (https://addons.mozilla.org/en-US/firefox/addon/open-with/), or in the toolbox for non-gcli buttons like the inspect element button in _buildPickerButton (https://mxr.mozilla.org/mozilla-central/source/browser/devtools/framework/toolbox.js#552).

Ideally, all of the use cases could be serviced by a single function to make sure that all buttons get registered consistently.
Product: Firefox → DevTools
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.