Skip to content

Instantly share code, notes, and snippets.

@Noitidart
Last active August 29, 2015 13:56
Show Gist options
  • Save Noitidart/9025999 to your computer and use it in GitHub Desktop.
Save Noitidart/9025999 to your computer and use it in GitHub Desktop.
ff-addon-template: Bare bones of bootstrap addon.
function startup(aData, aReason) {}
function shutdown(aData, aReason) {
if (aReason == APP_SHUTDOWN) return;
}
function install() {}
function uninstall() {}
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:em="http://www.mozilla.org/2004/em-rdf#">
<Description about="urn:mozilla:install-manifest">
<em:id>Bootstrap-Skeleton@jetpack</em:id>
<em:version>initial</em:version>
<em:type>2</em:type>
<em:bootstrap>true</em:bootstrap>
<em:unpack>false</em:unpack>
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>7.0</em:minVersion>
<em:maxVersion>27.0</em:maxVersion>
</Description>
</em:targetApplication>
<!-- Front End MetaData -->
<em:name>Bootstrap Skeleton</em:name>
<em:description>How all bootstrap addons start.</em:description>
<em:creator>Noitidart</em:creator>
<em:contributor>Pat for Icon</em:contributor>
<em:optionsType>2</em:optionsType>
</Description>
</RDF>
@Noitidart
Copy link
Author

README

Bootstrap Reasons

aReason Integer
APP_STARTUP 1
APP_SHUTDOWN 2
ADDON_ENABLE 3
ADDON_DISABLE 4
ADDON_INSTALL 5
ADDON_UNINSTALL 6
ADDON_UPGRADE 7
ADDON_DOWNGRADE 8

Source: http://mxr.mozilla.org/mozilla-release/source/toolkit/mozapps/extensions/test/xpcshell/test_bootstrap.js#5

Icon

There is no need for iconURL or icon64URL in install.rdf. Simply place an image in the main folder named icon.png and it will automatically be read. This icon.png size should be 48x48. Also drop in a icon64.png in this same folder and it will be used if a larger size is more applicable.
For instance I included a different image for icon.png nad icon64.png to test where if both are taken rather then one taken and scaled everywhere else and it turns out the applicable size is taken so this is good, no resizing. So the icon64.png got used here:

And the icon.png got used here:

aData - Startup

Key Comment Value
id Bootstrap-Skeleton@jetpack
version initial
installPath [xpconnect wrapped nsIFile]
resourceURI [xpconnect wrapped nsIURI]
oldVersion Available if there was a previously installed instance, could be same version like in this case initial

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment