开发者

firefox sidebar menu or list of elements. resources/help

开发者 https://www.devze.com 2022-12-31 18:36 出处:网络
I am struggling to find anyresources on firefox extensions which construct a sidebar and put elements into them. plus tyhe other functionalities within a sidebar. I have made a emptysidebar. Now i nee

I am struggling to find any resources on firefox extensions which construct a sidebar and put elements into them. plus tyhe other functionalities within a sidebar. I have made a emptysidebar. Now i need to display a dynamic array(which is formed using a JS function). I have absolutely no idea how to go about it. Can someone please help! this is the code of the sidebar page. I need a xul element like the menuitem where i can display a list of items. How do i get that in a sidebar?

<page id="sbEmptySidebar" title="emptysidebar"
         xmlns=开发者_如何学C"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>   <vbox flex="1">
        <label id ="l1">

  </vbox> </page>


You should used a list box, it would be the best way to display an array of elements in the sidebar. You can check here for more details on the XUL element:

https://developer.mozilla.org/en/XUL_Tutorial/List_Controls

In order to add elements dynamically from JavaScript you can use the appendItem() function on the listbox object, check here for more details and examples:

https://developer.mozilla.org/en/XUL_Tutorial/Manipulating_Lists

0

精彩评论

暂无评论...
验证码 换一张
取 消