gpt4 book ai didi

javascript - 为 Thunderbird Firefox 编写 Web 扩展

转载 作者:行者123 更新时间:2023-12-01 01:30:58 26 4
gpt4 key购买 nike

我是 JavaScript/Web 扩展的新手,有人可以告诉我 Web 扩展是如何工作的吗?我如何为自己编写网络扩展?

谢谢。

最佳答案

我建议您阅读 Mozilla 产品的 MDN。

网络扩展

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions

An extension adds features and functions to a browser. It’s created using familiar web-based technologies—HTML, CSS, and JavaScript. It can take advantage of the same web APIs as JavaScript on a web page, but an extension also has access to its own set of JavaScript APIs. This means that you can do a lot more in an extension than you can with code in a web page. To help illustrate how to develop extensions, we maintain a repository of simple example extensions at https://github.com/mdn/webextensions-examples. This article describes the WebExtension APIs used in that repository.

...

These examples work in Firefox Nightly: most work in earlier versions of Firefox, but check the strict_min_version key in the extension's manifest.json to make sure.

If you want to try out these examples, you have three main choices:

  • Clone the repository, then load the extension straight from its source directory, using the "Load Temporary Add-on" feature. The extension will stay loaded until you restart Firefox.
  • Clone the repository, then use the web-ext command line tool to run Firefox with the extension installed.
  • Clone the repository, then go to the build directory. This contains built and signed versions of all the examples, so you can just open them in Firefox (using File/Open File) and install them permanently, just like an extension you would install from addons.mozilla.org.

Thunderbird 扩展

https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Thunderbird_extensions

Getting started with Thunderbird

A brave, young developer wants to develop an add-on for Thunderbird. These links to help through this journey. Note: This documention series is not yet updated for version 60.

Thunderbird 扩展开发

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Developing_WebExtensions_for_Thunderbird

Being both Gecko based, Thunderbird supports many of the APIs Firefox supports, with some differences, see browser compatibility for manifest.json and browser support for JavaScript APIs for details. (https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Browser_compatibility_for_manifest.json)

关于javascript - 为 Thunderbird Firefox 编写 Web 扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53280648/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com