如何让 Firefox 扩展自动安装在导航栏中?
我正在开发 Firefox 扩展。 我想让它在用户安装时自动安装在导航栏的最右侧位置。 就目前情况而言,用户必须转到“查看”>“查看”>“查看”。 工具栏> 自定义...安装后将扩展拖到导航栏。 我想取消这一步。
扩展程序在这里: http://madan.org/tickertool
我的扩展程序的 XUL 基本上如下所示它覆盖 browser.xul:
<overlay id="my-ext-overlay" ... >
<toolbarpalette id="BrowserToolbarPalette">
<toolbaritem id="my-ext-container" ... >
<toolbarbutton id="my-ext-customize-image" ... />
<textbox id="my-ext-textbox" ... />
<hbox id="my-ext-buttons">
<image id="my-ext-button1" ... />
<image id="my-ext-button2" ... />
<image id="my-ext-button3" ... />
</hbox>
</toolbaritem>
</toolbarpalette>
</overlay>
我在这里看到了代码( https://developer.mozilla.org /en/Code_snippets/Toolbar )据说可以实现我正在寻找的功能,但此代码是如果您的扩展只是一个按钮而我无法让它为我工作。 我的问题的答案可能是对这段代码的一些修改,但我还没有弄清楚。
I'm working on a Firefox extension. I'd like to make it auto-install in the far right position on the nav bar when a user installs it. As it stands, a user has to go to View > Toolbars > Customize... and drag the extension to the nav bar once it's installed. I'd like to eliminate this step.
The extension is here: http://madan.org/tickertool
The XUL for my extension looks basically like this and it overlays browser.xul:
<overlay id="my-ext-overlay" ... >
<toolbarpalette id="BrowserToolbarPalette">
<toolbaritem id="my-ext-container" ... >
<toolbarbutton id="my-ext-customize-image" ... />
<textbox id="my-ext-textbox" ... />
<hbox id="my-ext-buttons">
<image id="my-ext-button1" ... />
<image id="my-ext-button2" ... />
<image id="my-ext-button3" ... />
</hbox>
</toolbaritem>
</toolbarpalette>
</overlay>
I've seen code here ( https://developer.mozilla.org/en/Code_snippets/Toolbar ) that supposedly does what I'm looking for, but this code is if your extension is just a single button and I can't get it to work for me. The answer to my question is likely some modification of this code, but I haven't figured it out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想我明白了。 它基本上在我在原始帖子中提到的链接中详细说明。 我不知道为什么我认为还有更多的事情。
I think I got it. It's basically spelled out in the link I mentioned in the original post. I'm not sure why I thought there was more to it than that.