如何从引导的Firefox插件添加UI元素 [英] How to add UI elements from a bootstraped Firefox addon

查看:199
本文介绍了如何从引导的Firefox插件添加UI元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Firefox 4编写一个Firefox插件,它允许您创建引导程序插件 (不需要重新启动浏览器的插件),但是,它们不允许您使用XUL来创建UI元素。
在工具菜单(使用JavaScript)的地方创建UI元素的简单方法是什么,以及如何让我的插件打开一个新的窗口来与浏览器接口?

I am writing a Firefox addon for Firefox 4 which allows you to create bootstraped addons (addons that do not require a restart of the browser), however, they do not allow you to use XUL to create UI elements. What is an easy way to create UI elements in places like the tools menu (with JavaScript), and how do I make my addon open a new window to interface with the browser?

推荐答案

Mozilla附加SDK 也被称为JetPack已经发展到可以用来创建整个附加组件的程度。不仅附件快速简单,而且还可以重新启动。

The Mozilla Add-on SDK which is also known as JetPack has evolved to the point where it can be used to create entire add-ons. Not only are the add-ons fast and simple to create, but they are also restartless.

使用SDK添加UI元素的最佳方式是使用 Widget API 这将很容易让你添加一个图标到状态栏。还有其他的API用于上下文菜单和创建面板。

The best way to add UI elements with the SDK is to use the Widget API which will easily allow you to add an icon to the status bar. There are also other APIs for the context-menu and creating panels.

这篇关于如何从引导的Firefox插件添加UI元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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