Last Comment Bug 650777 - Add support to turn on/off the add-ons toolbar
: Add support to turn on/off the add-ons toolbar
Product: Mozilla QA
Classification: Other
Component: Mozmill Tests (show other bugs)
: unspecified
: All All
-- enhancement (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
  Show dependency treegraph
Reported: 2011-04-18 06:51 PDT by Marc-Aurèle DARCHE
Modified: 2012-04-17 17:32 PDT (History)
1 user (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Description User image Marc-Aurèle DARCHE 2011-04-18 06:51:44 PDT
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 });
Comment 1 User image Henrik Skupin (:whimboo) 2011-04-18 07:04:46 PDT
That's nothing which should be implemented in Mozmill core. It will be part of our shared modules in the mozmill-tests repository.
Comment 2 User image Marc-Aurèle DARCHE 2011-07-12 06:05:40 PDT
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.
Comment 3 User image Henrik Skupin (:whimboo) 2011-07-12 06:38:46 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.