Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7802403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:15:15+00:00 2026-06-02T01:15:15+00:00

I am developing a toolbar for a customer, that wants a traditional IE style

  • 0

I am developing a toolbar for a customer, that wants a traditional IE style toolbar at the top of the window under the address bar.

This is what I have:
What I have http://www.hellometro.com/toolbar/now.png

Notice that because of vertical limitations of the status bar I have to write in all-caps for the letters to be legible while being small enough to fit. (two left most elements in status bar, text field and SEARCH button)

This is what I need:
What I need http://www.hellometro.com/toolbar/whatiwant.png

Notice the toolbar added to the top that has enough vertical space for legible text within text field and button. (Top left below browser’s back button).

I’m looking for a way for positioning the search component at the status bar as a default location, and allow the user to change its position in the options page to let them pick top or bottom (because many if not most Firefox users don’t know they can move Add-ons around).

My question is: Does Firefox Add-on SDK support what I want to do, or do I have to switch languages and approach solution from a different angle?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T01:15:17+00:00Added an answer on June 2, 2026 at 1:15 am

    This isn’t something that you can do with the available Add-on SDK API, with good reason – add-ons shouldn’t waste screen estate unnecessarily and adding a toolbar is just that. You can achieve this goal by using low-level modules and going to the browser’s XUL directly. Something like this should work (untested code and very hacky):

    var widgetID = "foobar";
    var buttonID = "widget:" + require("self").id + "-" + widgetID;
    var toolbarName = "My Extension Toolbar";
    require("widget").Widget({
      id: widgetID,
      ...
    });
    
    if (firstRun)
    {
      var winUtils = require("window-utils");
      for (var window in winUtils.browserWindowIterator())
      {
        var toolbox = window.gNavToolbox;
        if (toolbox)
        {
          // Does the button exist already?
          var button = toolbox.ownerDocument.getElementById(buttonID);
          if (button && button.parentNode.getAttribute("toolbarname") == toolbarName)
            continue;  // Button already in the right toolbar
          else if (button)
          {
            // Remove button from its current location
            var toolbar = button.parentNode;
            toolbar.removeChild(button);
    
            // Make sure this change is persisted
            toolbar.setAttribute("currentset", toolbar.currentSet);
            toolbar.ownerDocument.persist(toolbar.id, "currentset");
          }
    
          var toolbar = toolbox.appendCustomToolbar("My Extension Toolbar", buttonID);
          toolbar.currentSet = toolbar.getAttribute("currentset");
          toolbar.ownerDocument.persist(toolbar.id, "currentset");
    
          // Send change notification, the widget needs reinitializing
          var event = toolbox.ownerDocument.createEvent("Events");
          event.initEvent("customizationchange", true, true);
          toolbox.dispatchEvent(event);
        }
      }
    }
    

    Note the undefined firstRun variable – you want to do this only once, otherwise you will revert user’s choice to move your widget elsewhere (you can store a flag via simple-prefs module or something like that). Also note that buttonID calculation uses internal details from the addon-kit/lib/widget.js file in the SDK – the way the toolbar button ID is calculated can change in a future SDK version but I think that this is the only way to get hold of a widget you create with the SDK. There are plenty of internals in the other parts of the code as well of course.

    Documentation: window-utils module (browserWindowIterator is undocumented), <xul:toolbox>, <xul:toolbar>.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
I am currently developing an IE toolbar button in C# that is supposed to
For the app that i am developing i have used a UISplitViewController as my
I'm currently developing a toolbar for chrome and i have some issues with my
I am developing a tab Bar based Application.On a particular view controller I have
I am developing a Window-based application in which, I added tabBarController and have table
I have a question about Symfony2 performance. I have been developing with Symfony2 under
I am developing a cocoa application for mac. I have created a preference window
Developing a project of mine I realize I have a need for some level
Currently developing an application using the newest version of symfony, obtained through PEAR. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.