如何在firefox的右上角制作一个扩展小部件?

发布于 2024-12-22 18:36:47 字数 479 浏览 1 评论 0原文

我将 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 技术交流群。

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

发布评论

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

评论(1

一张白纸 2024-12-29 18:36:47

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/

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