--- title: 附加组件 SDK slug: Mozilla/Add-ons/SDK tags: - More Example - Need Tanslate - TopicStub translation_of: Archive/Add-ons/Add-on_SDK ---

Support for extensions using XUL/XPCOM or the Add-on SDK was removed in Firefox 57, released November 2017. As there is no supported version of Firefox enabling these technologies, this page will be removed by December 2020.

Add-ons using the techniques described in this document are considered a legacy technology in Firefox. Don't use these techniques to develop new add-ons. Use WebExtensions instead. If you maintain an add-on which uses the techniques described here, consider migrating it to use WebExtensions.

Starting from Firefox 53, no new legacy add-ons will be accepted on addons.mozilla.org (AMO) for desktop Firefox and Firefox for Android.

Starting from Firefox 57, only extensions developed using WebExtensions APIs will be supported on Desktop Firefox and Firefox for Android.

Even before Firefox 57, changes coming up in the Firefox platform will break many legacy extensions. These changes include multiprocess Firefox (e10s), sandboxing, and multiple content processes. Legacy extensions that are affected by these changes should migrate to use WebExtensions APIs if they can. See the "Compatibility Milestones" document for more information.

A wiki page containing resources, migration paths, office hours, and more, is available to help developers transition to the new technologies.

你可以使用Add-on SDK来开发Firefox的附加组件。你可以使用各种各样的标准Web技术:JavaScript, HTML和CSS。该SDK不仅包括一些用来创建附加组件的 JavaScript API,还提供了开发、运行、测试、打包附加组件的一些工具。


教程

快速入门
如何安装SDK使用jpm工具开发、测试、打包附加组件
与浏览器交互
打开网页监听页面加载列出打开的标签页
开发技术
学习常用开发技术,如单元测试日志创建可复用模块本地化移动开发
创建用户界面组件
创建用户界面组件如工具条按钮, 上下文菜单菜单项对话框
修改网页

通过URL匹配修改页面或者动态修改某个tab选项卡

将其组合在一起
关于注释器的附加组件的例子演示.

指南

贡献者指南
学习如何开始构建 SDK和关于SDK最重要的术语, 如 模块 类和继承, 私有属性, 内容处理.
SDK的基础构建
SDK的底层技术方面: 模块,程序ID, Firefox 兼容的规则定义.
内容脚本

一个详细的指南内容脚本

SDK语法
SDK的事件框架和插件的脚本和内容脚本之间的区别。
SDK的 事件框架add-on scripts 和 content scripts 的区别.
XUL 迁移
指导  移植 XUL add-ons 到 SDK. 本指南包括 两工具 和 一个 工作实例 比较 XUL 和 add-on.

参考

高级API
高级SDK API的参考文档.
工具参考
用于 jpm工具 开发的参考文档, 测试, 打包add-ons, 全局 控制台记录, 和package.json 文件.
低级API
低级SDK API的参考文档.