diff options
Diffstat (limited to 'files/zh-cn/mozilla/add-ons/webextensions/examples/index.html')
-rw-r--r-- | files/zh-cn/mozilla/add-ons/webextensions/examples/index.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/files/zh-cn/mozilla/add-ons/webextensions/examples/index.html b/files/zh-cn/mozilla/add-ons/webextensions/examples/index.html new file mode 100644 index 0000000000..ce413198ea --- /dev/null +++ b/files/zh-cn/mozilla/add-ons/webextensions/examples/index.html @@ -0,0 +1,31 @@ +--- +title: 扩展示例 +slug: Mozilla/Add-ons/WebExtensions/Examples +tags: + - firefox extension + - firefox 扩展 + - 扩展案例 + - 火狐扩展 +translation_of: Mozilla/Add-ons/WebExtensions/Examples +--- +<div>{{AddonSidebar}}</div> + +<p>为帮助了解如何开发扩展,我们维护了一个包含简单扩展示例的代码仓库在<a href="https://github.com/mdn/webextensions-examples">https://github.com/mdn/webextensions-examples</a>. 本文描述了仓库代码中所使用的 WebExtension APIs。</p> + +<p>这些示例工作在 Firefox Nightly 下: 大部分示例在 Firefox 的早期版本中也能够运行, 请检查扩展 manifest.json 文件中的 <a href="/en-US/Add-ons/WebExtensions/manifest.json/applications">strict_min_version</a> 键。</p> + +<p>如果你想尝试这些示例,有下面三个选择:</p> + +<ol> + <li>克隆代码库,通过 <a href="/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox">"临时载入附加组件"</a> 功能直接从源文件夹中载入扩展组件。再重启浏览器前该扩展将一直存在。</li> + <li>克隆代码库,使用 <a href="/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext">web-ext</a> 命令行工具运行安装了扩展的 Firefox。</li> + <li>克隆代码库,进入 <a href="https://github.com/mdn/webextensions-examples/tree/master/build">build</a> 文件夹。该文件夹包含所有示例的已构建、带签名版本。你可以在Firefox中打开(菜单栏->文件->打开文件)并且永久安装这些扩展。这些扩展和直接从 <a href="https://addons.mozilla.org/en-US/firefox/">addons.mozilla.org</a> 安装的扩展别无二致。</li> +</ol> + +<div class="blockIndicator warning"> +<p><strong>重要</strong>:不要提交这些关于 WebExtension 例子的示例到 AMO (addons.mozilla.org) 上去,你无需为附加组件签名就能运行 WebExtension 的示例。只要按照上面的步骤来就可以了。</p> +</div> + +<p>如果你想对代码仓库贡献,<a href="https://github.com/mdn/webextensions-examples/blob/master/CONTRIBUTING.md">给我们发送 pull request!</a></p> + +<p>{{WebExtAllExamples}}</p> |