WebExtensions: Difference between revisions

"WebExtensions add-on" -> "WebExtension"
("WebExtensions add-on" -> "WebExtension")
Line 19: Line 19:
** double-click the preference, or right-click and selected "Toggle", to set it to <code>false</code>.
** double-click the preference, or right-click and selected "Toggle", to set it to <code>false</code>.


===Example WebExtensions add-on===
===Example WebExtension===
To help get you started, we've created a very simple example add-on at https://github.com/mdn/webextensions-examples. Clone this repo and navigate to the "borderify" directory.
To help get you started, we've created a very simple example WebExtension at https://github.com/mdn/webextensions-examples. Clone this repo and navigate to the "borderify" directory.


   git clone https://github.com/mdn/webextensions-examples
   git clone https://github.com/mdn/webextensions-examples
Line 28: Line 28:


====manifest.json====
====manifest.json====
Every WebExtensions add-on must contain a <code>manifest.json</code> file. This one looks like:
Every WebExtension must contain a <code>manifest.json</code> file. This one looks like:


     {
     {
Line 62: Line 62:
===Packaging===
===Packaging===


Firefox extensions are packaged as XPI files, which are just ZIP files with an "xpi" extension.
Firefox add-ons are packaged as XPI files, which are just ZIP files with an "xpi" extension.


One trick is that the ZIP file must be a ZIP of the files in the add-on, not of the containing directory. So to create an XPI from the borderify files, at the command prompt type, from inside the `borderify` directory, type:
One trick is that the ZIP file must be a ZIP of the files in the add-on, not of the containing directory. So to create an XPI from the borderify files, at the command prompt type, from inside the `borderify` directory, type:
canmove, Confirmed users
737

edits