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 767187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:10:16+00:00 2026-05-14T17:10:16+00:00

I am developing a Firefox extension. On one <menupopup> , the onpopupshowing calls a

  • 0

I am developing a Firefox extension. On one <menupopup>, the onpopupshowing calls a JavaScript function. The JavaScript function extracts a list of names. Now these names have to be displayed in the same popup.

How can I get this? Basically I will need to pass the data (just as we use beans in Java) to the browser from the JavaScript function. The data can change every time the popup is called.

  • 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-05-14T17:10:16+00:00Added an answer on May 14, 2026 at 5:10 pm

    You need to modify the DOM rapresenting your menupopup.
    For example:

    <menulist>
      <menupopup id="myMenuPopup">
        <menuitem id="firstItem" label="Mozilla" value="http://mozilla.org"/>
        <menuitem id="secondItem" label="Slashdot" value="http://slashdot.org"/>
        <menuitem id="thirdItem" label="Sourceforge" value="http://sf.net"/>
      </menupopup>
    </menulist>
    

    Now if you want to add another item:

    var myMenuPopup = document.getElementById("myMenuPopup");
    var newItem = document.createElement("menuitem");
    newItem.setAttribute("id", "anotherItem");
    myMenuPopup.appendChild(newItem);
    

    If you want to remove an item:

    var itemToRemove = myMenuPopup.getElementById("anotherItem");
    myMenuPopup.appendChild(itemToRemove);
    

    Here you can find much more:

    https://developer.mozilla.org/en/Dynamically_modifying_XUL-based_user_interface

    Edit:

    I assume thet your function returns an array of names:

    var nameLists = yourFunction();
    
    for (var i=0; i<nameList.length; i++){
      var newItem = document.createElement("menuitem");
      newItem.setAttribute("label", nameList[i]);
      newItem.setAttribute("id", "item" + i);
      myMenuPopup.appendChild(newItem);
    }
    

    I think is better if you call the function that make items before user click on menupopup, not on the event invocation, because if you have many items it may takes a little to construct the items list.

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

Sidebar

Related Questions

I'm developing a Firefox extension and have the following code: function initialize() { //
What the minimum basic setup required to begin developing a Firefox extension?
I'm developing a site-specific Firefox extension. The official hosting/updating mechanism at addons.mozilla.org forces my
I'm am developing a Firefox extension which interfaces with an underlying Windows service (which
I'm developing a firefox extension based on this tutorial which is a FF 2.0
While developing a firefox extension, I create a wizard window from overlay.js using: this.wizard
I am developing a firefox extension and I need to include the Google Search
I'm currently developing a firefox extension which checks some server side XML-File on a
I am developing a small extension that has to redirect certain URLs to another
We have plans of developing a web application that will have to communicate with

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.