Bug 963216 - Uplift Add-on SDK

This commit is contained in:
Erik Vold
2014-01-24 15:51:44 -08:00
parent 1b4260fe31
commit dd43da4dbb
79 changed files with 882 additions and 6139 deletions

View File

@@ -9,7 +9,7 @@ module.metadata = {
const { CC } = require('chrome');
const { id, name, prefixURI, rootURI, metadata,
version, loadReason } = require('@loader/options');
version, loadReason, preferencesBranch } = require('@loader/options');
const { readURISync } = require('./net/url');
@@ -24,16 +24,16 @@ const uri = (path="") =>
// associated unique URI string that can be used for that.
exports.uri = 'addon:' + id;
exports.id = id;
exports.preferencesBranch = preferencesBranch || id;
exports.name = name;
exports.loadReason = loadReason;
exports.version = version;
// If `rootURI` is jar:file://...!/ than add-on is packed.
exports.packed = rootURI.indexOf('jar:') === 0
exports.packed = (rootURI || '').indexOf('jar:') === 0;
exports.data = Object.freeze({
url: uri,
load: function read(path) {
return readURISync(uri(path));
}
});
exports.isPrivateBrowsingSupported = ((metadata.permissions || {})['private-browsing'] === true) ?
true : false;
exports.isPrivateBrowsingSupported = ((metadata || {}).permissions || {})['private-browsing'] === true;