Firefox-扩展 - 如何制作侧边栏

时间:2012-04-20 07:52:24

标签: javascript firefox firefox-addon xul

任何人都可以告诉我如何制作侧边栏。 XUL参考中的侧边栏没有任何内容。我提到了一些旧代码。但是,我无法在哪里编辑。在那些代码中,我必须经常创建jar文件,这很烦人。任何人都可以向我显示指导,只需在侧栏中添加列表框的简单代码吗?

修改    This代码有效。我编辑了“emptysidebar.xul”中的代码。但它没有用。

欢迎任何在侧边栏中添加元素的解决方案。

1 个答案:

答案 0 :(得分:1)

我甚至没有想到解决方案会如此简单。这是解决方案。

var sidebarWindow = document.getElementById("sidebar").contentWindow;

if(sidebarWindow)
{
    sidebarWindow.location = "chrome://custombutton/content/login.xul"; 
                                 // your xul location
}
else
{
    alert("sidebar window is not null");
}
相关问题