Add support to turn on/off the add-ons toolbar



8 years ago
7 years ago


(Reporter: mozdev, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [lib])



8 years ago
User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: 

Recently I needed to code a function to open the addonbar of Firefox 4.0. This is needed to test addons that rely on the open state of the addonbar.

And to be really useful this code should work on all versions of Firefox, ie not choke on Firefox versions < 4.0.

Reproducible: Always

Here is the code that I have written really fast to give you an idea.
Of course it would be better if it didn't relied on the use of a keypress, but I didn't went further as soon as it worked. I'm waiting for your advice first.

  openAddonBarIfExisting: function() {
    var addon_bar = new elementslib.ID(
      controller.window.document, 'addon-bar');
    var node = addon_bar.getNode();
    if (addon_bar && node) {
      if (node.collapsed == 'true' || node.collapsed == true) {
        controller.keypress(null, '/', { accelKey: true });
That's nothing which should be implemented in Mozmill core. It will be part of our shared modules in the mozmill-tests repository.
Component: Mozmill → Mozmill Tests
Product: Testing → Mozilla QA
QA Contact: mozmill → mozmill-tests
Ever confirmed: true
Summary: Have a Mozmill open addonbar utility → Add support to turn on/off the add-ons toolbar
Whiteboard: [shared module]

Comment 2

8 years ago
At first I thought that opening the addon-bar was something a little bit complicated and not multi-platform resilient because of the need to use a keypress. So having it in Mozmill shared modules was making sense.

But inspection of browser.js indicates that opening/closing/toggling the addon-bar (and any other toolbar) is really easy, foolproof, and only done in 2 lines of code:

let addonbar = document.getElementById('addon-bar');
// The addon bar only exists in Firefox >= 4.0
if (addonbar)
  setToolbarVisibility(addonbar, true);

And if an extension needs to have the addon-bar to be opened, then it needs to have this code shipped with it anyway.

That's why I mark this ticket as WONTFIX.

And sorry for the disturbance.
Last Resolved: 8 years ago
Resolution: --- → WONTFIX
This will use back-end code. In most of our cases we will rely on ui elements and actions performed on those. I will keep it as wontfix for now but we should investigate that topic for our API refactoring project.
Component: Mozmill Tests → Mozmill Shared Modules
Component: Mozmill Shared Modules → Mozmill Tests
Whiteboard: [shared module] → [lib]
You need to log in before you can comment on or make changes to this bug.