google-chrome-extension

Topics related to google-chrome-extension:

Getting started with google-chrome-extension

TODO: Short description of Chrome Extensions

Official documentation

Further reading

TODO: Populate with links to important overview topics

manifest.json

Official documentation

Manifest File Format

Format

Manifest file is written in JSON (JavaScript Object Notation) format.

This format differs from more loose rules of writing object literals in JavaScript code. Among important differences:

  • Every key name and string literal must be in double quotes.

    • Correct: "key": "value"

    • Wrong: key: "value", 'key': 'value'

  • No comments are allowed by the format.

    • Wrong: "key": "value" // This controls feature foo
  • Strict comma rules: items separated by commas, no dangling commas.

    • Correct:

      {
        "foo": "bar",
        "baz": "qux"
      }
      
    • Wrong (comma missing):

      {
        "foo": "bar"
        "baz": "qux"
      }
      
    • Wrong (dangling comma):

      {
        "foo": "bar",
        "baz": "qux",
      }
      

Message Passing

Official documentation

Content scripts

Background pages

Debugging Chrome Extensions

Porting to/from Firefox

If you're using a Firefox version before 48, you'll also need an additional key in manifest.json called applications:

"applications": {
  "gecko": {
    "id": "[email protected]",
    "strict_min_version": "42.0",
    "strict_max_version": "50.*",
    "update_url": "https://example.com/updates.json"
  }
}

applications


Note:

Extension Signing:

With the release of Firefox 48, extension signing can no longer be disabled in the release and beta channel builds by using a preference. As outlined when extension signing was announced, we are publishing specialized builds that support this preference so developers can continue to test against the code that beta and release builds are generated from.

Status of WebExtensions:

WebExtensions are currently in an experimental alpha state. From Firefox 46, you can publish WebExtensions to Firefox users, just like any other add-on. We're aiming for a first stable release in Firefox 48.

UPD: Firefox 48 released 02.08.2016.


Links:

API support status - The list of APIs and their status.

Chrome incompatibilities

WebExtensions - JavaScript APIs, keys of manifest.json, tutorials, etc.

Developer Tool Integration