2. Getting Started with Firefox Extensions

Created Sunday 19 January 2014

  1. The extensions page:
    1. https://developer.mozilla.org/en-US/Add-ons?redirectlocale=en-US&redirectslug=Extensions
  2. All extensions are add-ons
  3. Add-ons can also be themes, plugins, or language packs
  4. Extensions are developed in a similar ways for Mozilla applications (Firefox, Thunderbird, etc...)
  5. Themes and language packs are developed in a similar way
  6. Plugins are entirely different, and they won't be covered.
    1. More about plugins:
      1. https://developer.mozilla.org/en-US/Add-ons/Plugins?redirectlocale=en-US&redirectslug=Plugins
  7. Extensions exist in 3 different forms:
    1. Add-ons SDK extensions (also known as Jetpacks)
      1. Good for beginners
      2. All extensions created using the Add-on SDK are bootstrapped (bootstrapped code is generated)
      3. https://addons.mozilla.org/en-US/developers/builder
    2. Bootstrapped extensions
      1. A step above traditional in complexity
    3. Traditional extensions
      1. The focus of this tutorial
  8. Download the Hello World extension:
    1. https://developer.mozilla.org/@api/deki/files/5139/=xulschoolhello1.xpi
  9. The web server should use the appropriate content type application/x-xpinstall to trigger an install
  10. XPI (pronounced "zippy") stands for Cross-Platform Installer (can work on all platforms Firefox supports)
  11. XPIs are simply ZIP files that Firefox recognizes to trigger the installation process
  12. Decompress the XPI file (linux):
    1. unzip xulschoolhello1.xpi -d xulschoolhello1
  13. Directory structure
xulschoolhello1
├── chrome.manifest
├── content
│   ├── browserOverlay.js
│   └── browserOverlay.xul
├── install.rdf
├── locale
│   └── en-US
│   ├── browserOverlay.dtd
│   └── browserOverlay.properties
└── skin
└── browserOverlay.css



Backlinks: