https://github.com/mdn/webextensions-examples
Maintained by the MDN team at Mozilla.
WebExtensions are a way to write browser extensions: that is, programs installed inside a web browser that modify the behaviour of the browser or of web pages loaded by the browser. They are built on a set of cross-browser APIs, so WebExtensions written for Google Chrome or Opera will in most cases run in Firefox or Edge too.
The "webextensions-examples" repository is a collection of simple but complete and installable WebExtensions. You can use the examples to see how to use the WebExtensions APIs, and as a starting point for your own WebExtensions.
The examples are made available under the Mozilla Public License 2.0.
To use the repository, first clone it.
Each example is in its own top-level directory. Install an example in your favourite web browser (installation instructions are below), and see how it works. Each example has its own short README explaining what it does.
To find your way around a WebExtension's internal structure, have a look at the Anatomy of a WebExtension page on MDN.
To use these examples in Firefox, you should use the most recent release of Firefox. Some examples work with earlier releases.
A few examples rely on APIs that are currently only available in pre-release
versions of Firefox. Where this is the case, the example should declare
the minimum version that it needs in the strict_min_version
part of the
applications key
in its manifest.json file.
There are a couple ways to try out the example extensions in this repository.
about:debugging
in the URL bar. Click the
Load Temporary Add-on
button and select the manifest.json
file within the
directory of an example extension you'd like to install.
Here is a video
that demonstrates how to do this.web-ext run
. This will launch Firefox and
install the extension automatically. This tool gives you some
additional development features such as
automatic reloading.alarms
and tabs
.tabs
functions: open, close, move, etc.windows
functions: create, close, resize, etc.To learn more about developing WebExtensions, see the WebExtensions documentation on MDN for getting started guides, tutorials, and full API reference docs.
If you find a problem, please file a bug.
If you need help, email the dev-addons mailing list or contact the WebExtensions team in the #webextensions IRC channel on irc.mozilla.org.
We welcome contributions, whether they are whole new examples, new features, bug fixes, or translations of localizable strings into new languages. Please see the CONTRIBUTING.md file for more details.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Комментарии ( 0 )