Git Product home page Git Product logo

webextensions-examples's Introduction

webextensions-examples Build Status

https://github.com/mdn/webextensions-examples

Maintained by Mozilla's Add-ons team.

WebExtensions are a way to write browser extensions: that is, programs installed inside a web browser that modify the behavior of the browser or web pages loaded by the browser. WebExtensions are built on a set of cross-browser APIs, so WebExtensions written for Google Chrome, Opera, or Edge will, in most cases, run in Firefox too.

The "webextensions-examples" repository is a collection of simple, complete, and installable WebExtensions. The examples show how to use the WebExtensions APIs, and you can use them as a starting point for your WebExtensions.

For an index of all the examples, see the "Example extensions" page on MDN.

The examples are made available under the Mozilla Public License 2.0.

How to use "webextensions-examples"

To use the repository, first clone it.

Each example is in a top-level folder and includes a short README explaining what it does. To see how an example works, install it in Firefox by following the installation instructions.

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, use the most recent release of Firefox. However, most examples work with earlier releases.

A few examples rely on APIs that are only available in pre-release versions of Firefox. Where this is the case, the example declares the minimum version that it needs in the strict_min_version attribute of the browser_specific_settings key in the extension's manifest.json file.

Installing an example

Some examples work only on specific domains or pages. Details of any restrictions are provided in each example's README file. None of the examples work in private browsing windows by default, see Extensions in Private Browsing for details.

To run an example extension:

  1. Open Firefox and load the about:debugging page. Click Load Temporary Add-on and select the manifest.json file within the folder of an example extension. Here is a video that demonstrates how to do this.
  2. Install the web-ext tool. At the command line, open the example extension's folder and type web-ext run. This launches Firefox and installs the extension automatically. This tool provides some additional development features, such as automatic reloading.

Support for other browsers

These examples are tested in Firefox. They may work in other browsers, if the browser supports the APIs used. Note that these examples all use the browser namespace and promises to work with asynchronous functions. This means the examples won't work in Chrome unless you use the polyfill provided by Mozilla. See the overview of WebExtension APIs for more information.

Learn more

To learn more about developing WebExtensions, see the WebExtensions documentation on MDN for getting started guides, tutorials, and full API reference docs.

Problems?

If you encounter an issue:

If you cannot resolve the issue, file a bug.

Contributing

We welcome contributions, whether they are new examples, new features, bug fixes, or translations of localizable strings. Please see the CONTRIBUTING.md file for more details.

webextensions-examples's People

Contributors

chrisdavidmills avatar rpl avatar rebloor avatar yfdyh000 avatar rob--w avatar bsmth avatar kumar303 avatar caitmuenster avatar freaktechnik avatar matthewjwein avatar nistath avatar kartik95 avatar minj avatar anaran avatar flavio88 avatar lv7777 avatar nt1m avatar interysy avatar zlatin avatar makyen avatar madnificent avatar aduntong avatar neonvoice avatar oeekker avatar phil-r avatar rahulyesantharao avatar rumyra avatar sebastianz avatar shubheksha avatar siimpragi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.