如何在Firefox的右上角做一个扩展部件? [英] How to make a extension widget on the top right side of firefox?

查看:103
本文介绍了如何在Firefox的右上角做一个扩展部件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将Chrome扩展程序移植到Firefox。由于基于XUL的API与Chrome API完全不同,所以我使用 firefox的新插件SDK

有一个名为widget的界面可以用来制作一个像Chrome浏览器的BrowserAction的小图标按钮,而widget则位于窗口的底部, BrowserAction位于窗口的右上角。

一些Firefox扩展,例如 GreaseMonkey ,在右上角有小部件,所以我问如何使用附加SDK实现它,而不是基于XUL的API?



https://github.com/erikvold/toolbarbutton-jplib/blob/master/lib/toolbarbutton.js < a>



虽然此代码不包含在SDK库中,但可用于使用当前版本的SDK获取所需的结果。你可以在这里看到一个使用Erik的库的简单例子:



https://builder.addons.mozilla.org/addon/1031142/latest/


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?

解决方案

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/

这篇关于如何在Firefox的右上角做一个扩展部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆