Firefox 侧边栏菜单或元素列表。资源/帮助

发布于 2024-09-02 12:53:48 字数 435 浏览 3 评论 0原文

我正在努力寻找有关 Firefox 扩展的任何资源,这些扩展可以构建侧边栏并将元素放入其中。加上侧边栏中的其他功能。我做了一个空的侧边栏。现在我需要显示一个动态数组(它是使用 JS 函数形成的)。 我完全不知道该怎么做。有人可以帮忙吗! 这是侧边栏页面的代码。我需要一个像 menuitem 这样的 xul 元素,我可以在其中显示项目列表。我如何将其放在侧边栏中?

<page id="sbEmptySidebar" title="emptysidebar"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>   <vbox flex="1">
        <label id ="l1">

  </vbox> </page>

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="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>   <vbox flex="1">
        <label id ="l1">

  </vbox> </page>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空心↖ 2024-09-09 12:53:48

您应该使用列表框,这将是在侧边栏中显示元素数组的最佳方式。您可以在此处查看有关 XUL 元素的更多详细信息:

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

为了从 JavaScript 动态添加元素,您可以在列表框对象上使用appendItem() 函数,请在此处查看更多详细信息和示例:

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文