Open Bug 636859 Opened 13 years ago Updated 2 years ago

Simplify adding toolbarbuttons to toolbars on extension firstrun.

Categories

(Firefox :: Toolbars and Customization, defect)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: pjdkrunkt, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.14) Gecko/20110218 Firefox/3.6.14

Currently, in order to add a toolbar button to a toolbar on the first run of an extension but allow it to be moved around, authors must do several steps:

- Add the button to the customize palette.  This is pretty easy and works the same way Firefox adds button to the palette.

- Use a first-run script to add the button to the currentset of the desired toolbar.

There is quite a bit of documentation on this:

https://developer.mozilla.org/en/Code_snippets/Toolbar#Adding_button_by_default

https://developer.mozilla.org/en/Code_snippets/On_page_load#Running_code_on_an_extension%27s_first_run_or_after_an_extension%27s_update

https://developer.mozilla.org/en/XUL_School/Adding_Toolbars_and_Toolbar_Buttons#Adding_toolbar_buttons_to_existing_toolbars

However, none of this documentation is currently provided on the MDN article about the addon-bar, which is leading to quite a bit of confusion:

https://developer.mozilla.org/en/The_add-on_bar

Authors may choose basically any method they want for adding buttons to toolbars, including forcing them to appear on certain toolbars in certain positions, or adding them to the palette but not automatically putting them on the toolbar.  It would be good if Firefox was handling the first-run part for the extensions.  Perhaps there could be an attribute added to toolbar buttons in the customize palette like:

onfirstrun

The properties for that attribute could be the name of the toolbar the button should appear on, like:

onfirstrun="addon-bar"

A button in the customize palette with that attribute would be automatically added to the addon bar on the first run of the extension, but would be free to be moved where-ever the user wants.  Perhaps these could also be restored when the "Restore Default Set" button is pressed?  In addition, this would be a good way to detect whether or not to show a hidden toolbar.  

Reproducible: Always
OS: Windows XP → All
Hardware: x86 → All
Version: unspecified → Trunk
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.