Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
uiolee committed Jul 4, 2023
1 parent 7e62da1 commit 7afae28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ slug: Mozilla/Add-ons/WebExtensions/What_are_WebExtensions

**提升或者补充网站功能**: 利用扩展来实现额外的浏览器内特性或者来自你网站的信息。允许用户搜集他们访问过的页面细节来提升你所提供的服务。

![图例中的 Amazon 扩展提供比价功能](amazon_add_on.png)
![图中的 Amazon 扩展提供比价功能](amazon_add_on.png)

示例:[亚马逊助手](https://addons.mozilla.org/zh-CN/firefox/addon/amazon-browser-bar/)[OneNote Web Clipper](https://addons.mozilla.org/zh-CN/firefox/addon/onenote-clipper/)[Grammarly for Firefox](https://addons.mozilla.org/zh-CN/firefox/addon/grammarly-1/)

**让用户展现他们的个性**: 浏览器扩展可以操控网页的内容;例如,让用户在每个他们访问的页面上添加最喜欢的 logo 或者图片作为背景。扩展也可以让用户更新 Firefox 的界面,就像独立的[主题扩展](https://extensionworkshop.com/documentation/themes/)一样。

![图例中的 My Web New Tab 扩展展现蝙蝠侠主题](myweb_new_tab_add_on.png)
![图中的 My Web New Tab 扩展展现蝙蝠侠主题](myweb_new_tab_add_on.png)

示例:[MyWeb New Tab](https://addons.mozilla.org/zh-CN/firefox/addon/myweb-new-tab/), [Tabliss](https://addons.mozilla.org/zh-CN/firefox/addon/tabliss/), 和 [VivaldiFox](https://addons.mozilla.org/zh-CN/firefox/addon/vivaldifox/)

**从网页中添加或者删除内容**: 你可能想要帮助用户从网页中阻止一些侵扰的广告,当网页中提到一个国家或者城市的时候提供旅游指南,或者重组页面的内容来提供一个连续的阅读体验。利用可以访问和更新一个页面里的 HTML 和 CSS 的能力,扩展可以帮助用户以他们想要的形式来查看网页。

![图例中的 uBlock origin 扩展能够拦截跟踪器统计](ublock_origin_add_on.png)
![图中的 uBlock origin 扩展能够拦截跟踪器统计](ublock_origin_add_on.png)

示例:[uBlock Origin](https://addons.mozilla.org/zh-CN/firefox/addon/ublock-origin/), [Reader](https://addons.mozilla.org/zh-CN/firefox/addon/reader/), 和 [Toolbox for Google Play Store™](https://addons.mozilla.org/zh-CN/firefox/addon/toolbox-google-play-store/)

**添加工具和新的浏览特性**: 给任务面板添加新特性,或者从 URL 地址,超链接,或者页面文字生成二维码。有了灵活的界面选项和 [WebExtensions APIs](/zh-CN/docs/Mozilla/Add-ons/WebExtensions) 的能力,你可以很容易的向浏览器添加新的特性。并且,你可以改善几乎任何网站的特性和功能,而不必是你自己的网站。

![图例中的扩展是一个二维码生成器](qr_code_image_generator_add_on.png)
![图中的扩展是一个二维码生成器](qr_code_image_generator_add_on.png)

示例:[Swimlanes for Trello](https://addons.mozilla.org/zh-CN/firefox/addon/swimlanes-for-trello/) and [Tomato Clock](https://addons.mozilla.org/zh-CN/firefox/addon/tomato-clock/)

Expand All @@ -41,7 +41,7 @@ slug: Mozilla/Add-ons/WebExtensions/What_are_WebExtensions

**添加开发工具**: 你可以为你的业务提供网站开发工具或者开发一个有用的技术或者你想分享的网站开发方法。无论如何,你可以通过在开发者工具栏上添加一个新的标签来增强内置的 Firefox 开发者工具。

![图例中是 axe 无障碍功能测试扩展](axe_developer_tools_add_on.png)
![图中是 axe 无障碍功能测试扩展](axe_developer_tools_add_on.png)

示例:[Web Developer](https://addons.mozilla.org/zh-CN/firefox/addon/web-developer/), [Web React Developer Tools](https://addons.mozilla.org/zh-CN/firefox/addon/react-devtools/), 和 [aXe Developer Tools](https://addons.mozilla.org/zh-CN/firefox/addon/axe-devtools/)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ cd beastify
"version": "1.0",

"description": "在工具栏添加一个互动图标。点击按钮选择一个动物,然后当前活动的标签页的内容会被替换成被选择的动物的图片。参见 https://developer.mozilla.org/zh-CN/Add-ons/WebExtensions/Examples#beastify",
"homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/beastify",
"homepage_url": "https://github.com/mdn/webextensions-examples/tree/main/beastify",
"icons": {
"48": "icons/beasts-48.png"
},
Expand Down Expand Up @@ -102,7 +102,7 @@ cd beastify

插件应该有一个图标。这个图标被用于显示在附加组件管理器中(可以通过"about:addons"来访问)。当前插件中 manifest.json 指定了我们插件的图标位于"icons/beasts-48.png"。

创建“icons”文件夹,并将图标命名为“beasts-48.png”。你可以使用我们例子中的[图标](https://raw.githubusercontent.com/mdn/webextensions-examples/master/beastify/icons/beasts-48.png),它是从 [Aha-Soft’s Free Retina iconset](http://www.aha-soft.com/free-icons/free-retina-icon-set/) 截取的,使用需要遵循该网站的许可证。
创建“icons”文件夹,并将图标命名为“beasts-48.png”。你可以使用我们例子中的[图标](https://raw.githubusercontent.com/mdn/webextensions-examples/main/beastify/icons/beasts-48.png),它是从 [Aha-Soft’s Free Retina iconset](http://www.aha-soft.com/free-icons/free-retina-icon-set/) 截取的,使用需要遵循该网站的许可证。

如果你使用自己的图标,它的尺寸应该是 48<math><semantics><mo>×</mo><annotation encoding="TeX">\times</annotation></semantics></math>48 像素的。同时,对于高分辨率的设备,可以提供 96<math><semantics><mo>×</mo><annotation encoding="TeX">\times</annotation></semantics></math>96 像素的图片。此时,manifest.json 应当这样配置:

Expand All @@ -117,7 +117,7 @@ cd beastify

工具栏按钮也需要一个图标,并且我们的 manifest.json 承诺我们会为该工具栏在 "icons/beasts-32.png" 提供一个图标。

将一个图标命名为为 "beasts-32.png"并保存到"icons"文件夹。你可以使用例子中的[图片](https://github.com/mdn/webextensions-examples/blob/master/beastify/icons/beasts-32.png),它是取自 [IconBeast Lite 图标集](http://www.iconbeast.com/free)并按其[许可协议](http://www.iconbeast.com/faq/)授权使用。
将一个图标命名为为 "beasts-32.png"并保存到"icons"文件夹。你可以使用例子中的[图片](https://github.com/mdn/webextensions-examples/blob/main/beastify/icons/beasts-32.png),它是取自 [IconBeast Lite 图标集](http://www.iconbeast.com/free)并按其[许可协议](http://www.iconbeast.com/faq/)授权使用。

如果你没有弹出窗,用户点击的事件会直接分派到你的插件中。如果你制作了弹出窗,用户点击会直接打开这个弹出窗,而不会被分派给插件。本例中我们需要弹出窗,因此我们现在开始写它。

Expand Down

0 comments on commit 7afae28

Please sign in to comment.