LET'S GO!• Nightly X Nightly
• https://nightly.mozilla.org/
• https://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/latest-mozilla-central-flame-kk/
• Lightsaber
• https://github.com/fxos/lightsaber
• Sample add-on
• https://github.com/mdn/simple-addon
{ "manifest_version": 1, "name": "Add-on banner", "description": "Firefox OS add-on example", "version": "1.0", "author": "Chris Mills", "content_scripts": [{ "matches": ["app://system.gaiamobile.org/index.html"], "css": ["css/style.css"], "js": ["js/index.js"] }], "icons": { "128": "/icons/128.png" }}
{ "manifest_version": 1, "name": "Add-on banner", "description": "Firefox OS add-on example", "version": "1.0", "author": "Chris Mills", "content_scripts": [{ "matches": ["app://system.gaiamobile.org/index.html"], "css": ["css/style.css"], "js": ["js/index.js"] }], "icons": { "128": "/icons/128.png" }}
if (document.documentElement) { initialize();} else { window.addEventListener('DOMContentLoaded', initialize);}
function initialize() { // ...}
if (document.documentElement) { initialize();} else { window.addEventListener('DOMContentLoaded', initialize);}
function initialize() { // ...}
function initialize() { if (document.querySelector('.fxos-banner')) { // Already injected, abort. return; } else { var body = document.querySelector('body'); var fxosBanner = document.createElement('div'); fxosBanner.classList.add('fxos-banner'); var bannerText = document.createElement('p'); var closeBtn = document.createElement('button');
fxosBanner.appendChild(bannerText); fxosBanner.appendChild(closeBtn); body.appendChild(fxosBanner);
…… }}
function initialize() { if (document.querySelector('.fxos-banner')) { // Already injected, abort. return; } else { var body = document.querySelector('body'); var fxosBanner = document.createElement('div'); fxosBanner.classList.add('fxos-banner'); var bannerText = document.createElement('p'); var closeBtn = document.createElement('button');
fxosBanner.appendChild(bannerText); fxosBanner.appendChild(closeBtn); body.appendChild(fxosBanner);
…… }}