如何在firefox的右上角制作一个扩展小部件?
我将 Chrome 扩展移植到 Firefox。因为基于 XUL 的 API 与 Chrome API 有很大不同,所以我使用 Firefox 的新附加 SDK。
有一个叫做“widget”的接口可以用来制作一个像Chrome的“BrowserAction”一样的小图标按钮,但是“widget”在窗口的底部,“BrowserAction”在窗口的右上角。
某些 Firefox 扩展(例如 GreaseMonkey )在顶部有小部件是的,所以我问如何使用附加 SDK 来实现它,而不是基于 XUL 的 API?
I port a Chrome extension to Firefox. Because the XUL-based API is quite different from Chrome API, so I use the new add-on SDK of firefox.
There is a interface called "widget" can be used to make a little icon button like "BrowserAction" of Chrome, but "widget" is on the bottom of window, "BrowserAction" is on the top right side of window.
Some firefox extensions, for example, GreaseMonkey , have widgets on the top right, so I'm asking how to implement it using add-on SDK, not XUL based API?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Erik Vold 创建了一个库,允许您执行此操作:
https: //github.com/erikvold/toolbarbutton-jplib/blob/master/lib/toolbarbutton.js
虽然此代码未包含在 SDK 库中,但可以使用它来获取您想要的结果SDK 的当前版本。您可以在此处查看使用 Erik 库的快速示例:
https://builder.addons.mozilla .org/addon/1031142/latest/
Erik Vold has created a library that allows you to do this:
https://github.com/erikvold/toolbarbutton-jplib/blob/master/lib/toolbarbutton.js
While this code isn't included in the SDK libraries, it can be used to get the result you want with the current version of the SDK. You can see a quick example using Erik's library here:
https://builder.addons.mozilla.org/addon/1031142/latest/