mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-21 06:37:30 +09:00
remove named function syntax in AddonManager.jsm
This commit is contained in:
parent
b285dd8974
commit
1807b14725
1 changed files with 107 additions and 116 deletions
|
|
@ -123,13 +123,13 @@ function providerName(aProvider) {
|
||||||
* parent 'addons' level logger accordingly.
|
* parent 'addons' level logger accordingly.
|
||||||
*/
|
*/
|
||||||
var PrefObserver = {
|
var PrefObserver = {
|
||||||
init: function PrefObserver_init() {
|
init: function() {
|
||||||
Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false);
|
Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false);
|
||||||
Services.obs.addObserver(this, "xpcom-shutdown", false);
|
Services.obs.addObserver(this, "xpcom-shutdown", false);
|
||||||
this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
|
this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
|
||||||
},
|
},
|
||||||
|
|
||||||
observe: function PrefObserver_observe(aSubject, aTopic, aData) {
|
observe: function(aSubject, aTopic, aData) {
|
||||||
if (aTopic == "xpcom-shutdown") {
|
if (aTopic == "xpcom-shutdown") {
|
||||||
Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
|
Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
|
||||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||||
|
|
@ -323,7 +323,7 @@ AsyncObjectCaller.prototype = {
|
||||||
* Passes the next object to the listener or calls noMoreObjects if there
|
* Passes the next object to the listener or calls noMoreObjects if there
|
||||||
* are none left.
|
* are none left.
|
||||||
*/
|
*/
|
||||||
callNext: function AOC_callNext() {
|
callNext: function() {
|
||||||
if (this.objects.length == 0) {
|
if (this.objects.length == 0) {
|
||||||
this.listener.noMoreObjects(this);
|
this.listener.noMoreObjects(this);
|
||||||
return;
|
return;
|
||||||
|
|
@ -449,7 +449,7 @@ AddonAuthor.prototype = {
|
||||||
url: null,
|
url: null,
|
||||||
|
|
||||||
// Returns the author's name, defaulting to the empty string
|
// Returns the author's name, defaulting to the empty string
|
||||||
toString: function AddonAuthor_toString() {
|
toString: function() {
|
||||||
return this.name || "";
|
return this.name || "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,7 +493,7 @@ AddonScreenshot.prototype = {
|
||||||
caption: null,
|
caption: null,
|
||||||
|
|
||||||
// Returns the screenshot URL, defaulting to the empty string
|
// Returns the screenshot URL, defaulting to the empty string
|
||||||
toString: function AddonScreenshot_toString() {
|
toString: function() {
|
||||||
return this.url || "";
|
return this.url || "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -640,11 +640,11 @@ var AddonManagerInternal = {
|
||||||
// Store telemetry details per addon provider
|
// Store telemetry details per addon provider
|
||||||
telemetryDetails: {},
|
telemetryDetails: {},
|
||||||
|
|
||||||
recordTimestamp: function AMI_recordTimestamp(name, value) {
|
recordTimestamp: function(name, value) {
|
||||||
this.TelemetryTimestamps.add(name, value);
|
this.TelemetryTimestamps.add(name, value);
|
||||||
},
|
},
|
||||||
|
|
||||||
validateBlocklist: function AMI_validateBlocklist() {
|
validateBlocklist: function() {
|
||||||
let appBlocklist = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]);
|
let appBlocklist = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]);
|
||||||
|
|
||||||
// If there is no application shipped blocklist then there is nothing to do
|
// If there is no application shipped blocklist then there is nothing to do
|
||||||
|
|
@ -771,7 +771,7 @@ var AddonManagerInternal = {
|
||||||
* Initializes the AddonManager, loading any known providers and initializing
|
* Initializes the AddonManager, loading any known providers and initializing
|
||||||
* them.
|
* them.
|
||||||
*/
|
*/
|
||||||
startup: function AMI_startup() {
|
startup: function() {
|
||||||
try {
|
try {
|
||||||
if (gStarted)
|
if (gStarted)
|
||||||
return;
|
return;
|
||||||
|
|
@ -925,7 +925,7 @@ var AddonManagerInternal = {
|
||||||
* @param aTypes
|
* @param aTypes
|
||||||
* An optional array of add-on types
|
* An optional array of add-on types
|
||||||
*/
|
*/
|
||||||
registerProvider: function AMI_registerProvider(aProvider, aTypes) {
|
registerProvider: function(aProvider, aTypes) {
|
||||||
if (!aProvider || typeof aProvider != "object")
|
if (!aProvider || typeof aProvider != "object")
|
||||||
throw Components.Exception("aProvider must be specified",
|
throw Components.Exception("aProvider must be specified",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -977,7 +977,7 @@ var AddonManagerInternal = {
|
||||||
* For providers that have async shutdown methods returning Promises,
|
* For providers that have async shutdown methods returning Promises,
|
||||||
* the caller should wait for that Promise to resolve.
|
* the caller should wait for that Promise to resolve.
|
||||||
*/
|
*/
|
||||||
unregisterProvider: function AMI_unregisterProvider(aProvider) {
|
unregisterProvider: function(aProvider) {
|
||||||
if (!aProvider || typeof aProvider != "object")
|
if (!aProvider || typeof aProvider != "object")
|
||||||
throw Components.Exception("aProvider must be specified",
|
throw Components.Exception("aProvider must be specified",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -1032,7 +1032,7 @@ var AddonManagerInternal = {
|
||||||
*
|
*
|
||||||
* @param aProvider Provider object to mark safe
|
* @param aProvider Provider object to mark safe
|
||||||
*/
|
*/
|
||||||
markProviderSafe: function AMI_markProviderSafe(aProvider) {
|
markProviderSafe: function(aProvider) {
|
||||||
if (!gStarted) {
|
if (!gStarted) {
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1062,7 +1062,7 @@ var AddonManagerInternal = {
|
||||||
* The method name to call
|
* The method name to call
|
||||||
* @see callProvider
|
* @see callProvider
|
||||||
*/
|
*/
|
||||||
callProviders: function AMI_callProviders(aMethod, ...aArgs) {
|
callProviders: function(aMethod, ...aArgs) {
|
||||||
if (!aMethod || typeof aMethod != "string")
|
if (!aMethod || typeof aMethod != "string")
|
||||||
throw Components.Exception("aMethod must be a non-empty string",
|
throw Components.Exception("aMethod must be a non-empty string",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -1163,7 +1163,7 @@ var AddonManagerInternal = {
|
||||||
*
|
*
|
||||||
* @see nsIObserver
|
* @see nsIObserver
|
||||||
*/
|
*/
|
||||||
observe: function AMI_observe(aSubject, aTopic, aData) {
|
observe: function(aSubject, aTopic, aData) {
|
||||||
switch (aData) {
|
switch (aData) {
|
||||||
case PREF_EM_CHECK_COMPATIBILITY: {
|
case PREF_EM_CHECK_COMPATIBILITY: {
|
||||||
let oldValue = gCheckCompatibility;
|
let oldValue = gCheckCompatibility;
|
||||||
|
|
@ -1247,7 +1247,7 @@ var AddonManagerInternal = {
|
||||||
* The optional application version to use for %APP_VERSION%
|
* The optional application version to use for %APP_VERSION%
|
||||||
* @return The appropriately escaped URI.
|
* @return The appropriately escaped URI.
|
||||||
*/
|
*/
|
||||||
escapeAddonURI: function AMI_escapeAddonURI(aAddon, aUri, aAppVersion)
|
escapeAddonURI: function(aAddon, aUri, aAppVersion)
|
||||||
{
|
{
|
||||||
if (!aAddon || typeof aAddon != "object")
|
if (!aAddon || typeof aAddon != "object")
|
||||||
throw Components.Exception("aAddon must be an Addon object",
|
throw Components.Exception("aAddon must be an Addon object",
|
||||||
|
|
@ -1318,7 +1318,7 @@ var AddonManagerInternal = {
|
||||||
* @return Promise{null} Resolves when the background update check is complete
|
* @return Promise{null} Resolves when the background update check is complete
|
||||||
* (the resulting addon installations may still be in progress).
|
* (the resulting addon installations may still be in progress).
|
||||||
*/
|
*/
|
||||||
backgroundUpdateCheck: function AMI_backgroundUpdateCheck() {
|
backgroundUpdateCheck: function() {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1347,7 +1347,7 @@ var AddonManagerInternal = {
|
||||||
// be applied
|
// be applied
|
||||||
updates.push(new Promise((resolve, reject) => {
|
updates.push(new Promise((resolve, reject) => {
|
||||||
addon.findUpdates({
|
addon.findUpdates({
|
||||||
onUpdateAvailable: function BUC_onUpdateAvailable(aAddon, aInstall) {
|
onUpdateAvailable: function(aAddon, aInstall) {
|
||||||
// Start installing updates when the add-on can be updated and
|
// Start installing updates when the add-on can be updated and
|
||||||
// background updates should be applied.
|
// background updates should be applied.
|
||||||
logger.debug("Found update for add-on ${id}", aAddon);
|
logger.debug("Found update for add-on ${id}", aAddon);
|
||||||
|
|
@ -1389,7 +1389,7 @@ var AddonManagerInternal = {
|
||||||
* @param aID
|
* @param aID
|
||||||
* The ID of the add-on
|
* The ID of the add-on
|
||||||
*/
|
*/
|
||||||
addStartupChange: function AMI_addStartupChange(aType, aID) {
|
addStartupChange: function(aType, aID) {
|
||||||
if (!aType || typeof aType != "string")
|
if (!aType || typeof aType != "string")
|
||||||
throw Components.Exception("aType must be a non-empty string",
|
throw Components.Exception("aType must be a non-empty string",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -1418,7 +1418,7 @@ var AddonManagerInternal = {
|
||||||
* @param aID
|
* @param aID
|
||||||
* The ID of the add-on
|
* The ID of the add-on
|
||||||
*/
|
*/
|
||||||
removeStartupChange: function AMI_removeStartupChange(aType, aID) {
|
removeStartupChange: function(aType, aID) {
|
||||||
if (!aType || typeof aType != "string")
|
if (!aType || typeof aType != "string")
|
||||||
throw Components.Exception("aType must be a non-empty string",
|
throw Components.Exception("aType must be a non-empty string",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -1444,7 +1444,7 @@ var AddonManagerInternal = {
|
||||||
* @param aMethod
|
* @param aMethod
|
||||||
* The method on the listeners to call
|
* The method on the listeners to call
|
||||||
*/
|
*/
|
||||||
callManagerListeners: function AMI_callManagerListeners(aMethod, ...aArgs) {
|
callManagerListeners: function(aMethod, ...aArgs) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1475,7 +1475,7 @@ var AddonManagerInternal = {
|
||||||
* An optional array of extra InstallListeners to also call
|
* An optional array of extra InstallListeners to also call
|
||||||
* @return false if any of the listeners returned false, true otherwise
|
* @return false if any of the listeners returned false, true otherwise
|
||||||
*/
|
*/
|
||||||
callInstallListeners: function AMI_callInstallListeners(aMethod,
|
callInstallListeners: function(aMethod,
|
||||||
aExtraListeners, ...aArgs) {
|
aExtraListeners, ...aArgs) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
|
|
@ -1517,7 +1517,7 @@ var AddonManagerInternal = {
|
||||||
* @param aMethod
|
* @param aMethod
|
||||||
* The method on the listeners to call
|
* The method on the listeners to call
|
||||||
*/
|
*/
|
||||||
callAddonListeners: function AMI_callAddonListeners(aMethod, ...aArgs) {
|
callAddonListeners: function(aMethod, ...aArgs) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1551,7 +1551,7 @@ var AddonManagerInternal = {
|
||||||
* A boolean indicating if the change will only take place the next
|
* A boolean indicating if the change will only take place the next
|
||||||
* time the application is restarted
|
* time the application is restarted
|
||||||
*/
|
*/
|
||||||
notifyAddonChanged: function AMI_notifyAddonChanged(aID, aType, aPendingRestart) {
|
notifyAddonChanged: function(aID, aType, aPendingRestart) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1588,7 +1588,7 @@ var AddonManagerInternal = {
|
||||||
* their add-ons in response to an application change such as a blocklist
|
* their add-ons in response to an application change such as a blocklist
|
||||||
* update.
|
* update.
|
||||||
*/
|
*/
|
||||||
updateAddonAppDisabledStates: function AMI_updateAddonAppDisabledStates() {
|
updateAddonAppDisabledStates: function() {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1603,7 +1603,7 @@ var AddonManagerInternal = {
|
||||||
* @param aCallback
|
* @param aCallback
|
||||||
* Function to call when operation is complete.
|
* Function to call when operation is complete.
|
||||||
*/
|
*/
|
||||||
updateAddonRepositoryData: function AMI_updateAddonRepositoryData(aCallback) {
|
updateAddonRepositoryData: function(aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1613,11 +1613,11 @@ var AddonManagerInternal = {
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
||||||
new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", {
|
new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", {
|
||||||
nextObject: function updateAddonRepositoryData_nextObject(aCaller, aProvider) {
|
nextObject: function(aCaller, aProvider) {
|
||||||
callProviderAsync(aProvider, "updateAddonRepositoryData",
|
callProviderAsync(aProvider, "updateAddonRepositoryData",
|
||||||
aCaller.callNext.bind(aCaller));
|
aCaller.callNext.bind(aCaller));
|
||||||
},
|
},
|
||||||
noMoreObjects: function updateAddonRepositoryData_noMoreObjects(aCaller) {
|
noMoreObjects: function(aCaller) {
|
||||||
safeCall(aCallback);
|
safeCall(aCallback);
|
||||||
// only tests should care about this
|
// only tests should care about this
|
||||||
Services.obs.notifyObservers(null, "TEST:addon-repository-data-updated", null);
|
Services.obs.notifyObservers(null, "TEST:addon-repository-data-updated", null);
|
||||||
|
|
@ -1646,7 +1646,7 @@ var AddonManagerInternal = {
|
||||||
* An optional nsILoadGroup to associate any network requests with
|
* An optional nsILoadGroup to associate any network requests with
|
||||||
* @throws if the aUrl, aCallback or aMimetype arguments are not specified
|
* @throws if the aUrl, aCallback or aMimetype arguments are not specified
|
||||||
*/
|
*/
|
||||||
getInstallForURL: function AMI_getInstallForURL(aUrl, aCallback, aMimetype,
|
getInstallForURL: function(aUrl, aCallback, aMimetype,
|
||||||
aHash, aName, aIcons,
|
aHash, aName, aIcons,
|
||||||
aVersion, aBrowser) {
|
aVersion, aBrowser) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
|
|
@ -1716,7 +1716,7 @@ var AddonManagerInternal = {
|
||||||
* An optional mimetype hint for the add-on
|
* An optional mimetype hint for the add-on
|
||||||
* @throws if the aFile or aCallback arguments are not specified
|
* @throws if the aFile or aCallback arguments are not specified
|
||||||
*/
|
*/
|
||||||
getInstallForFile: function AMI_getInstallForFile(aFile, aCallback, aMimetype) {
|
getInstallForFile: function(aFile, aCallback, aMimetype) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1734,7 +1734,7 @@ var AddonManagerInternal = {
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
||||||
new AsyncObjectCaller(this.providers, "getInstallForFile", {
|
new AsyncObjectCaller(this.providers, "getInstallForFile", {
|
||||||
nextObject: function getInstallForFile_nextObject(aCaller, aProvider) {
|
nextObject: function(aCaller, aProvider) {
|
||||||
callProviderAsync(aProvider, "getInstallForFile", aFile,
|
callProviderAsync(aProvider, "getInstallForFile", aFile,
|
||||||
function getInstallForFile_safeCall(aInstall) {
|
function getInstallForFile_safeCall(aInstall) {
|
||||||
if (aInstall)
|
if (aInstall)
|
||||||
|
|
@ -1744,7 +1744,7 @@ var AddonManagerInternal = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
noMoreObjects: function getInstallForFile_noMoreObjects(aCaller) {
|
noMoreObjects: function(aCaller) {
|
||||||
safeCall(aCallback, null);
|
safeCall(aCallback, null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -1760,7 +1760,7 @@ var AddonManagerInternal = {
|
||||||
* A callback which will be passed an array of AddonInstalls
|
* A callback which will be passed an array of AddonInstalls
|
||||||
* @throws If the aCallback argument is not specified
|
* @throws If the aCallback argument is not specified
|
||||||
*/
|
*/
|
||||||
getInstallsByTypes: function AMI_getInstallsByTypes(aTypes, aCallback) {
|
getInstallsByTypes: function(aTypes, aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1776,7 +1776,7 @@ var AddonManagerInternal = {
|
||||||
let installs = [];
|
let installs = [];
|
||||||
|
|
||||||
new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
|
new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
|
||||||
nextObject: function getInstallsByTypes_nextObject(aCaller, aProvider) {
|
nextObject: function(aCaller, aProvider) {
|
||||||
callProviderAsync(aProvider, "getInstallsByTypes", aTypes,
|
callProviderAsync(aProvider, "getInstallsByTypes", aTypes,
|
||||||
function getInstallsByTypes_safeCall(aProviderInstalls) {
|
function getInstallsByTypes_safeCall(aProviderInstalls) {
|
||||||
if (aProviderInstalls) {
|
if (aProviderInstalls) {
|
||||||
|
|
@ -1786,7 +1786,7 @@ var AddonManagerInternal = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
noMoreObjects: function getInstallsByTypes_noMoreObjects(aCaller) {
|
noMoreObjects: function(aCaller) {
|
||||||
safeCall(aCallback, installs);
|
safeCall(aCallback, installs);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -1798,7 +1798,7 @@ var AddonManagerInternal = {
|
||||||
* @param aCallback
|
* @param aCallback
|
||||||
* A callback which will be passed an array of AddonInstalls
|
* A callback which will be passed an array of AddonInstalls
|
||||||
*/
|
*/
|
||||||
getAllInstalls: function AMI_getAllInstalls(aCallback) {
|
getAllInstalls: function(aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1818,7 +1818,7 @@ var AddonManagerInternal = {
|
||||||
* @return string containing the Addon ID or null
|
* @return string containing the Addon ID or null
|
||||||
* @see amIAddonManager.mapURIToAddonID
|
* @see amIAddonManager.mapURIToAddonID
|
||||||
*/
|
*/
|
||||||
mapURIToAddonID: function AMI_mapURIToAddonID(aURI) {
|
mapURIToAddonID: function(aURI) {
|
||||||
if (!(aURI instanceof Ci.nsIURI)) {
|
if (!(aURI instanceof Ci.nsIURI)) {
|
||||||
throw Components.Exception("aURI is not a nsIURI",
|
throw Components.Exception("aURI is not a nsIURI",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -1843,7 +1843,7 @@ var AddonManagerInternal = {
|
||||||
* The mimetype to check
|
* The mimetype to check
|
||||||
* @return true if installation is enabled for the mimetype
|
* @return true if installation is enabled for the mimetype
|
||||||
*/
|
*/
|
||||||
isInstallEnabled: function AMI_isInstallEnabled(aMimetype) {
|
isInstallEnabled: function(aMimetype) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1871,7 +1871,7 @@ var AddonManagerInternal = {
|
||||||
* The nsIPrincipal that initiated the install
|
* The nsIPrincipal that initiated the install
|
||||||
* @return true if the source is allowed to install this mimetype
|
* @return true if the source is allowed to install this mimetype
|
||||||
*/
|
*/
|
||||||
isInstallAllowed: function AMI_isInstallAllowed(aMimetype, aInstallingPrincipal) {
|
isInstallAllowed: function(aMimetype, aInstallingPrincipal) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -1906,10 +1906,7 @@ var AddonManagerInternal = {
|
||||||
* @param aInstalls
|
* @param aInstalls
|
||||||
* The array of AddonInstalls to be installed
|
* The array of AddonInstalls to be installed
|
||||||
*/
|
*/
|
||||||
installAddonsFromWebpage: function AMI_installAddonsFromWebpage(aMimetype,
|
installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal, aInstalls) {
|
||||||
aBrowser,
|
|
||||||
aInstallingPrincipal,
|
|
||||||
aInstalls) {
|
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -2011,7 +2008,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The InstallListener to add
|
* The InstallListener to add
|
||||||
*/
|
*/
|
||||||
addInstallListener: function AMI_addInstallListener(aListener) {
|
addInstallListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be a InstallListener object",
|
throw Components.Exception("aListener must be a InstallListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2027,7 +2024,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The InstallListener to remove
|
* The InstallListener to remove
|
||||||
*/
|
*/
|
||||||
removeInstallListener: function AMI_removeInstallListener(aListener) {
|
removeInstallListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be a InstallListener object",
|
throw Components.Exception("aListener must be a InstallListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2050,7 +2047,7 @@ var AddonManagerInternal = {
|
||||||
* The callback to pass the retrieved add-on to
|
* The callback to pass the retrieved add-on to
|
||||||
* @throws if the aID or aCallback arguments are not specified
|
* @throws if the aID or aCallback arguments are not specified
|
||||||
*/
|
*/
|
||||||
getAddonByID: function AMI_getAddonByID(aID, aCallback) {
|
getAddonByID: function(aID, aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -2064,7 +2061,7 @@ var AddonManagerInternal = {
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
||||||
new AsyncObjectCaller(this.providers, "getAddonByID", {
|
new AsyncObjectCaller(this.providers, "getAddonByID", {
|
||||||
nextObject: function getAddonByID_nextObject(aCaller, aProvider) {
|
nextObject: function(aCaller, aProvider) {
|
||||||
callProviderAsync(aProvider, "getAddonByID", aID,
|
callProviderAsync(aProvider, "getAddonByID", aID,
|
||||||
function getAddonByID_safeCall(aAddon) {
|
function getAddonByID_safeCall(aAddon) {
|
||||||
if (aAddon)
|
if (aAddon)
|
||||||
|
|
@ -2074,7 +2071,7 @@ var AddonManagerInternal = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
noMoreObjects: function getAddonByID_noMoreObjects(aCaller) {
|
noMoreObjects: function(aCaller) {
|
||||||
safeCall(aCallback, null);
|
safeCall(aCallback, null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -2089,7 +2086,7 @@ var AddonManagerInternal = {
|
||||||
* The callback to pass the retrieved add-on to.
|
* The callback to pass the retrieved add-on to.
|
||||||
* @throws if the aGUID or aCallback arguments are not specified
|
* @throws if the aGUID or aCallback arguments are not specified
|
||||||
*/
|
*/
|
||||||
getAddonBySyncGUID: function AMI_getAddonBySyncGUID(aGUID, aCallback) {
|
getAddonBySyncGUID: function(aGUID, aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -2103,7 +2100,7 @@ var AddonManagerInternal = {
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
||||||
new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", {
|
new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", {
|
||||||
nextObject: function getAddonBySyncGUID_nextObject(aCaller, aProvider) {
|
nextObject: function(aCaller, aProvider) {
|
||||||
callProviderAsync(aProvider, "getAddonBySyncGUID", aGUID,
|
callProviderAsync(aProvider, "getAddonBySyncGUID", aGUID,
|
||||||
function getAddonBySyncGUID_safeCall(aAddon) {
|
function getAddonBySyncGUID_safeCall(aAddon) {
|
||||||
if (aAddon) {
|
if (aAddon) {
|
||||||
|
|
@ -2114,7 +2111,7 @@ var AddonManagerInternal = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
noMoreObjects: function getAddonBySyncGUID_noMoreObjects(aCaller) {
|
noMoreObjects: function(aCaller) {
|
||||||
safeCall(aCallback, null);
|
safeCall(aCallback, null);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -2129,7 +2126,7 @@ var AddonManagerInternal = {
|
||||||
* The callback to pass an array of Addons to
|
* The callback to pass an array of Addons to
|
||||||
* @throws if the aID or aCallback arguments are not specified
|
* @throws if the aID or aCallback arguments are not specified
|
||||||
*/
|
*/
|
||||||
getAddonsByIDs: function AMI_getAddonsByIDs(aIDs, aCallback) {
|
getAddonsByIDs: function(aIDs, aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -2145,7 +2142,7 @@ var AddonManagerInternal = {
|
||||||
let addons = [];
|
let addons = [];
|
||||||
|
|
||||||
new AsyncObjectCaller(aIDs, null, {
|
new AsyncObjectCaller(aIDs, null, {
|
||||||
nextObject: function getAddonsByIDs_nextObject(aCaller, aID) {
|
nextObject: function(aCaller, aID) {
|
||||||
AddonManagerInternal.getAddonByID(aID,
|
AddonManagerInternal.getAddonByID(aID,
|
||||||
function getAddonsByIDs_getAddonByID(aAddon) {
|
function getAddonsByIDs_getAddonByID(aAddon) {
|
||||||
addons.push(aAddon);
|
addons.push(aAddon);
|
||||||
|
|
@ -2153,7 +2150,7 @@ var AddonManagerInternal = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
noMoreObjects: function getAddonsByIDs_noMoreObjects(aCaller) {
|
noMoreObjects: function(aCaller) {
|
||||||
safeCall(aCallback, addons);
|
safeCall(aCallback, addons);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -2168,7 +2165,7 @@ var AddonManagerInternal = {
|
||||||
* The callback to pass an array of Addons to.
|
* The callback to pass an array of Addons to.
|
||||||
* @throws if the aCallback argument is not specified
|
* @throws if the aCallback argument is not specified
|
||||||
*/
|
*/
|
||||||
getAddonsByTypes: function AMI_getAddonsByTypes(aTypes, aCallback) {
|
getAddonsByTypes: function(aTypes, aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -2184,7 +2181,7 @@ var AddonManagerInternal = {
|
||||||
let addons = [];
|
let addons = [];
|
||||||
|
|
||||||
new AsyncObjectCaller(this.providers, "getAddonsByTypes", {
|
new AsyncObjectCaller(this.providers, "getAddonsByTypes", {
|
||||||
nextObject: function getAddonsByTypes_nextObject(aCaller, aProvider) {
|
nextObject: function(aCaller, aProvider) {
|
||||||
callProviderAsync(aProvider, "getAddonsByTypes", aTypes,
|
callProviderAsync(aProvider, "getAddonsByTypes", aTypes,
|
||||||
function getAddonsByTypes_concatAddons(aProviderAddons) {
|
function getAddonsByTypes_concatAddons(aProviderAddons) {
|
||||||
if (aProviderAddons) {
|
if (aProviderAddons) {
|
||||||
|
|
@ -2194,7 +2191,7 @@ var AddonManagerInternal = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
noMoreObjects: function getAddonsByTypes_noMoreObjects(aCaller) {
|
noMoreObjects: function(aCaller) {
|
||||||
safeCall(aCallback, addons);
|
safeCall(aCallback, addons);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -2206,7 +2203,7 @@ var AddonManagerInternal = {
|
||||||
* @param aCallback
|
* @param aCallback
|
||||||
* A callback which will be passed an array of Addons
|
* A callback which will be passed an array of Addons
|
||||||
*/
|
*/
|
||||||
getAllAddons: function AMI_getAllAddons(aCallback) {
|
getAllAddons: function(aCallback) {
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -2228,8 +2225,7 @@ var AddonManagerInternal = {
|
||||||
* The callback to pass the array of Addons to
|
* The callback to pass the array of Addons to
|
||||||
* @throws if the aCallback argument is not specified
|
* @throws if the aCallback argument is not specified
|
||||||
*/
|
*/
|
||||||
getAddonsWithOperationsByTypes:
|
getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
|
||||||
function AMI_getAddonsWithOperationsByTypes(aTypes, aCallback) {
|
|
||||||
if (!gStarted)
|
if (!gStarted)
|
||||||
throw Components.Exception("AddonManager is not initialized",
|
throw Components.Exception("AddonManager is not initialized",
|
||||||
Cr.NS_ERROR_NOT_INITIALIZED);
|
Cr.NS_ERROR_NOT_INITIALIZED);
|
||||||
|
|
@ -2245,8 +2241,7 @@ var AddonManagerInternal = {
|
||||||
let addons = [];
|
let addons = [];
|
||||||
|
|
||||||
new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
|
new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
|
||||||
nextObject: function getAddonsWithOperationsByTypes_nextObject
|
nextObject: function(aCaller, aProvider) {
|
||||||
(aCaller, aProvider) {
|
|
||||||
callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes,
|
callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes,
|
||||||
function getAddonsWithOperationsByTypes_concatAddons
|
function getAddonsWithOperationsByTypes_concatAddons
|
||||||
(aProviderAddons) {
|
(aProviderAddons) {
|
||||||
|
|
@ -2257,7 +2252,7 @@ var AddonManagerInternal = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
noMoreObjects: function getAddonsWithOperationsByTypes_noMoreObjects(caller) {
|
noMoreObjects: function(caller) {
|
||||||
safeCall(aCallback, addons);
|
safeCall(aCallback, addons);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -2269,7 +2264,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The listener to add
|
* The listener to add
|
||||||
*/
|
*/
|
||||||
addManagerListener: function AMI_addManagerListener(aListener) {
|
addManagerListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be an AddonManagerListener object",
|
throw Components.Exception("aListener must be an AddonManagerListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2285,7 +2280,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The listener to remove
|
* The listener to remove
|
||||||
*/
|
*/
|
||||||
removeManagerListener: function AMI_removeManagerListener(aListener) {
|
removeManagerListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be an AddonManagerListener object",
|
throw Components.Exception("aListener must be an AddonManagerListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2305,7 +2300,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The AddonListener to add
|
* The AddonListener to add
|
||||||
*/
|
*/
|
||||||
addAddonListener: function AMI_addAddonListener(aListener) {
|
addAddonListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be an AddonListener object",
|
throw Components.Exception("aListener must be an AddonListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2321,7 +2316,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The AddonListener to remove
|
* The AddonListener to remove
|
||||||
*/
|
*/
|
||||||
removeAddonListener: function AMI_removeAddonListener(aListener) {
|
removeAddonListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be an AddonListener object",
|
throw Components.Exception("aListener must be an AddonListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2341,7 +2336,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The TypeListener to add
|
* The TypeListener to add
|
||||||
*/
|
*/
|
||||||
addTypeListener: function AMI_addTypeListener(aListener) {
|
addTypeListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be a TypeListener object",
|
throw Components.Exception("aListener must be a TypeListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2357,7 +2352,7 @@ var AddonManagerInternal = {
|
||||||
* @param aListener
|
* @param aListener
|
||||||
* The TypeListener to remove
|
* The TypeListener to remove
|
||||||
*/
|
*/
|
||||||
removeTypeListener: function AMI_removeTypeListener(aListener) {
|
removeTypeListener: function(aListener) {
|
||||||
if (!aListener || typeof aListener != "object")
|
if (!aListener || typeof aListener != "object")
|
||||||
throw Components.Exception("aListener must be a TypeListener object",
|
throw Components.Exception("aListener must be a TypeListener object",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -2496,23 +2491,23 @@ var AddonManagerInternal = {
|
||||||
* subject to change at any time.
|
* subject to change at any time.
|
||||||
*/
|
*/
|
||||||
this.AddonManagerPrivate = {
|
this.AddonManagerPrivate = {
|
||||||
startup: function AMP_startup() {
|
startup: function() {
|
||||||
AddonManagerInternal.startup();
|
AddonManagerInternal.startup();
|
||||||
},
|
},
|
||||||
|
|
||||||
registerProvider: function AMP_registerProvider(aProvider, aTypes) {
|
registerProvider: function(aProvider, aTypes) {
|
||||||
AddonManagerInternal.registerProvider(aProvider, aTypes);
|
AddonManagerInternal.registerProvider(aProvider, aTypes);
|
||||||
},
|
},
|
||||||
|
|
||||||
unregisterProvider: function AMP_unregisterProvider(aProvider) {
|
unregisterProvider: function(aProvider) {
|
||||||
AddonManagerInternal.unregisterProvider(aProvider);
|
AddonManagerInternal.unregisterProvider(aProvider);
|
||||||
},
|
},
|
||||||
|
|
||||||
markProviderSafe: function AMP_markProviderSafe(aProvider) {
|
markProviderSafe: function(aProvider) {
|
||||||
AddonManagerInternal.markProviderSafe(aProvider);
|
AddonManagerInternal.markProviderSafe(aProvider);
|
||||||
},
|
},
|
||||||
|
|
||||||
backgroundUpdateCheck: function AMP_backgroundUpdateCheck() {
|
backgroundUpdateCheck: function() {
|
||||||
return AddonManagerInternal.backgroundUpdateCheck();
|
return AddonManagerInternal.backgroundUpdateCheck();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2526,32 +2521,32 @@ this.AddonManagerPrivate = {
|
||||||
AddonManagerInternal.backgroundUpdateCheck();
|
AddonManagerInternal.backgroundUpdateCheck();
|
||||||
},
|
},
|
||||||
|
|
||||||
addStartupChange: function AMP_addStartupChange(aType, aID) {
|
addStartupChange: function(aType, aID) {
|
||||||
AddonManagerInternal.addStartupChange(aType, aID);
|
AddonManagerInternal.addStartupChange(aType, aID);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeStartupChange: function AMP_removeStartupChange(aType, aID) {
|
removeStartupChange: function(aType, aID) {
|
||||||
AddonManagerInternal.removeStartupChange(aType, aID);
|
AddonManagerInternal.removeStartupChange(aType, aID);
|
||||||
},
|
},
|
||||||
|
|
||||||
notifyAddonChanged: function AMP_notifyAddonChanged(aID, aType, aPendingRestart) {
|
notifyAddonChanged: function(aID, aType, aPendingRestart) {
|
||||||
AddonManagerInternal.notifyAddonChanged(aID, aType, aPendingRestart);
|
AddonManagerInternal.notifyAddonChanged(aID, aType, aPendingRestart);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateAddonAppDisabledStates: function AMP_updateAddonAppDisabledStates() {
|
updateAddonAppDisabledStates: function() {
|
||||||
AddonManagerInternal.updateAddonAppDisabledStates();
|
AddonManagerInternal.updateAddonAppDisabledStates();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateAddonRepositoryData: function AMP_updateAddonRepositoryData(aCallback) {
|
updateAddonRepositoryData: function(aCallback) {
|
||||||
AddonManagerInternal.updateAddonRepositoryData(aCallback);
|
AddonManagerInternal.updateAddonRepositoryData(aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
callInstallListeners: function AMP_callInstallListeners(...aArgs) {
|
callInstallListeners: function(...aArgs) {
|
||||||
return AddonManagerInternal.callInstallListeners.apply(AddonManagerInternal,
|
return AddonManagerInternal.callInstallListeners.apply(AddonManagerInternal,
|
||||||
aArgs);
|
aArgs);
|
||||||
},
|
},
|
||||||
|
|
||||||
callAddonListeners: function AMP_callAddonListeners(...aArgs) {
|
callAddonListeners: function(...aArgs) {
|
||||||
AddonManagerInternal.callAddonListeners.apply(AddonManagerInternal, aArgs);
|
AddonManagerInternal.callAddonListeners.apply(AddonManagerInternal, aArgs);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2563,16 +2558,16 @@ this.AddonManagerPrivate = {
|
||||||
|
|
||||||
AddonType: AddonType,
|
AddonType: AddonType,
|
||||||
|
|
||||||
recordTimestamp: function AMP_recordTimestamp(name, value) {
|
recordTimestamp: function(name, value) {
|
||||||
AddonManagerInternal.recordTimestamp(name, value);
|
AddonManagerInternal.recordTimestamp(name, value);
|
||||||
},
|
},
|
||||||
|
|
||||||
_simpleMeasures: {},
|
_simpleMeasures: {},
|
||||||
recordSimpleMeasure: function AMP_recordSimpleMeasure(name, value) {
|
recordSimpleMeasure: function(name, value) {
|
||||||
this._simpleMeasures[name] = value;
|
this._simpleMeasures[name] = value;
|
||||||
},
|
},
|
||||||
|
|
||||||
recordException: function AMP_recordException(aModule, aContext, aException) {
|
recordException: function(aModule, aContext, aException) {
|
||||||
let report = {
|
let report = {
|
||||||
module: aModule,
|
module: aModule,
|
||||||
context: aContext
|
context: aContext
|
||||||
|
|
@ -2592,15 +2587,15 @@ this.AddonManagerPrivate = {
|
||||||
this._simpleMeasures.exception = report;
|
this._simpleMeasures.exception = report;
|
||||||
},
|
},
|
||||||
|
|
||||||
getSimpleMeasures: function AMP_getSimpleMeasures() {
|
getSimpleMeasures: function() {
|
||||||
return this._simpleMeasures;
|
return this._simpleMeasures;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTelemetryDetails: function AMP_getTelemetryDetails() {
|
getTelemetryDetails: function() {
|
||||||
return AddonManagerInternal.telemetryDetails;
|
return AddonManagerInternal.telemetryDetails;
|
||||||
},
|
},
|
||||||
|
|
||||||
setTelemetryDetails: function AMP_setTelemetryDetails(aProvider, aDetails) {
|
setTelemetryDetails: function(aProvider, aDetails) {
|
||||||
AddonManagerInternal.telemetryDetails[aProvider] = aDetails;
|
AddonManagerInternal.telemetryDetails[aProvider] = aDetails;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2619,7 +2614,7 @@ this.AddonManagerPrivate = {
|
||||||
* This can be used as an implementation for Addon.findUpdates() when
|
* This can be used as an implementation for Addon.findUpdates() when
|
||||||
* no update mechanism is available.
|
* no update mechanism is available.
|
||||||
*/
|
*/
|
||||||
callNoUpdateListeners: function (addon, listener, reason, appVersion, platformVersion) {
|
callNoUpdateListeners: function(addon, listener, reason, appVersion, platformVersion) {
|
||||||
if ("onNoCompatibilityUpdateAvailable" in listener) {
|
if ("onNoCompatibilityUpdateAvailable" in listener) {
|
||||||
safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon);
|
safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon);
|
||||||
}
|
}
|
||||||
|
|
@ -2830,14 +2825,13 @@ this.AddonManager = {
|
||||||
return gStartupComplete && !gShutdownInProgress;
|
return gStartupComplete && !gShutdownInProgress;
|
||||||
},
|
},
|
||||||
|
|
||||||
getInstallForURL: function AM_getInstallForURL(aUrl, aCallback, aMimetype,
|
getInstallForURL: function(aUrl, aCallback, aMimetype, aHash, aName, aIcons,
|
||||||
aHash, aName, aIcons,
|
aVersion, aBrowser) {
|
||||||
aVersion, aBrowser) {
|
|
||||||
AddonManagerInternal.getInstallForURL(aUrl, aCallback, aMimetype, aHash,
|
AddonManagerInternal.getInstallForURL(aUrl, aCallback, aMimetype, aHash,
|
||||||
aName, aIcons, aVersion, aBrowser);
|
aName, aIcons, aVersion, aBrowser);
|
||||||
},
|
},
|
||||||
|
|
||||||
getInstallForFile: function AM_getInstallForFile(aFile, aCallback, aMimetype) {
|
getInstallForFile: function(aFile, aCallback, aMimetype) {
|
||||||
AddonManagerInternal.getInstallForFile(aFile, aCallback, aMimetype);
|
AddonManagerInternal.getInstallForFile(aFile, aCallback, aMimetype);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2848,94 +2842,91 @@ this.AddonManager = {
|
||||||
* The type of startup change to get
|
* The type of startup change to get
|
||||||
* @return An array of add-on IDs
|
* @return An array of add-on IDs
|
||||||
*/
|
*/
|
||||||
getStartupChanges: function AM_getStartupChanges(aType) {
|
getStartupChangesAM_ge: function(aType) {
|
||||||
if (!(aType in AddonManagerInternal.startupChanges))
|
if (!(aType in AddonManagerInternal.startupChanges))
|
||||||
return [];
|
return [];
|
||||||
return AddonManagerInternal.startupChanges[aType].slice(0);
|
return AddonManagerInternal.startupChanges[aType].slice(0);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAddonByID: function AM_getAddonByID(aID, aCallback) {
|
getAddonByID: function(aID, aCallback) {
|
||||||
AddonManagerInternal.getAddonByID(aID, aCallback);
|
AddonManagerInternal.getAddonByID(aID, aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAddonBySyncGUID: function AM_getAddonBySyncGUID(aGUID, aCallback) {
|
getAddonBySyncGUID: function(aGUID, aCallback) {
|
||||||
AddonManagerInternal.getAddonBySyncGUID(aGUID, aCallback);
|
AddonManagerInternal.getAddonBySyncGUID(aGUID, aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAddonsByIDs: function AM_getAddonsByIDs(aIDs, aCallback) {
|
getAddonsByIDs: function(aIDs, aCallback) {
|
||||||
AddonManagerInternal.getAddonsByIDs(aIDs, aCallback);
|
AddonManagerInternal.getAddonsByIDs(aIDs, aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAddonsWithOperationsByTypes:
|
getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
|
||||||
function AM_getAddonsWithOperationsByTypes(aTypes, aCallback) {
|
|
||||||
AddonManagerInternal.getAddonsWithOperationsByTypes(aTypes, aCallback);
|
AddonManagerInternal.getAddonsWithOperationsByTypes(aTypes, aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAddonsByTypes: function AM_getAddonsByTypes(aTypes, aCallback) {
|
getAddonsByTypes: function(aTypes, aCallback) {
|
||||||
AddonManagerInternal.getAddonsByTypes(aTypes, aCallback);
|
AddonManagerInternal.getAddonsByTypes(aTypes, aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAllAddons: function AM_getAllAddons(aCallback) {
|
getAllAddons: function(aCallback) {
|
||||||
AddonManagerInternal.getAllAddons(aCallback);
|
AddonManagerInternal.getAllAddons(aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
getInstallsByTypes: function AM_getInstallsByTypes(aTypes, aCallback) {
|
getInstallsByTypes: function(aTypes, aCallback) {
|
||||||
AddonManagerInternal.getInstallsByTypes(aTypes, aCallback);
|
AddonManagerInternal.getInstallsByTypes(aTypes, aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
getAllInstalls: function AM_getAllInstalls(aCallback) {
|
getAllInstalls: function(aCallback) {
|
||||||
AddonManagerInternal.getAllInstalls(aCallback);
|
AddonManagerInternal.getAllInstalls(aCallback);
|
||||||
},
|
},
|
||||||
|
|
||||||
mapURIToAddonID: function AM_mapURIToAddonID(aURI) {
|
mapURIToAddonID: function(aURI) {
|
||||||
return AddonManagerInternal.mapURIToAddonID(aURI);
|
return AddonManagerInternal.mapURIToAddonID(aURI);
|
||||||
},
|
},
|
||||||
|
|
||||||
isInstallEnabled: function AM_isInstallEnabled(aType) {
|
isInstallEnabled: function(aType) {
|
||||||
return AddonManagerInternal.isInstallEnabled(aType);
|
return AddonManagerInternal.isInstallEnabled(aType);
|
||||||
},
|
},
|
||||||
|
|
||||||
isInstallAllowed: function AM_isInstallAllowed(aType, aInstallingPrincipal) {
|
isInstallAllowed: function(aType, aInstallingPrincipal) {
|
||||||
return AddonManagerInternal.isInstallAllowed(aType, ensurePrincipal(aInstallingPrincipal));
|
return AddonManagerInternal.isInstallAllowed(aType, ensurePrincipal(aInstallingPrincipal));
|
||||||
},
|
},
|
||||||
|
|
||||||
installAddonsFromWebpage: function AM_installAddonsFromWebpage(aType, aBrowser,
|
installAddonsFromWebpage: function(aType, aBrowser, aInstallingPrincipal, aInstalls) {
|
||||||
aInstallingPrincipal,
|
|
||||||
aInstalls) {
|
|
||||||
AddonManagerInternal.installAddonsFromWebpage(aType, aBrowser,
|
AddonManagerInternal.installAddonsFromWebpage(aType, aBrowser,
|
||||||
ensurePrincipal(aInstallingPrincipal),
|
ensurePrincipal(aInstallingPrincipal),
|
||||||
aInstalls);
|
aInstalls);
|
||||||
},
|
},
|
||||||
|
|
||||||
addManagerListener: function AM_addManagerListener(aListener) {
|
addManagerListener: function(aListener) {
|
||||||
AddonManagerInternal.addManagerListener(aListener);
|
AddonManagerInternal.addManagerListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeManagerListener: function AM_removeManagerListener(aListener) {
|
removeManagerListener: function(aListener) {
|
||||||
AddonManagerInternal.removeManagerListener(aListener);
|
AddonManagerInternal.removeManagerListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
addInstallListener: function AM_addInstallListener(aListener) {
|
addInstallListener: function(aListener) {
|
||||||
AddonManagerInternal.addInstallListener(aListener);
|
AddonManagerInternal.addInstallListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeInstallListener: function AM_removeInstallListener(aListener) {
|
removeInstallListener: function(aListener) {
|
||||||
AddonManagerInternal.removeInstallListener(aListener);
|
AddonManagerInternal.removeInstallListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
addAddonListener: function AM_addAddonListener(aListener) {
|
addAddonListener: function(aListener) {
|
||||||
AddonManagerInternal.addAddonListener(aListener);
|
AddonManagerInternal.addAddonListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeAddonListener: function AM_removeAddonListener(aListener) {
|
removeAddonListener: function(aListener) {
|
||||||
AddonManagerInternal.removeAddonListener(aListener);
|
AddonManagerInternal.removeAddonListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
addTypeListener: function AM_addTypeListener(aListener) {
|
addTypeListener: function(aListener) {
|
||||||
AddonManagerInternal.addTypeListener(aListener);
|
AddonManagerInternal.addTypeListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeTypeListener: function AM_removeTypeListener(aListener) {
|
removeTypeListener: function(aListener) {
|
||||||
AddonManagerInternal.removeTypeListener(aListener);
|
AddonManagerInternal.removeTypeListener(aListener);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -2950,7 +2941,7 @@ this.AddonManager = {
|
||||||
* The Addon representing the add-on
|
* The Addon representing the add-on
|
||||||
* @return true if the addon should auto-update, false otherwise.
|
* @return true if the addon should auto-update, false otherwise.
|
||||||
*/
|
*/
|
||||||
shouldAutoUpdate: function AM_shouldAutoUpdate(aAddon) {
|
shouldAutoUpdate: function(aAddon) {
|
||||||
if (!aAddon || typeof aAddon != "object")
|
if (!aAddon || typeof aAddon != "object")
|
||||||
throw Components.Exception("aAddon must be specified",
|
throw Components.Exception("aAddon must be specified",
|
||||||
Cr.NS_ERROR_INVALID_ARG);
|
Cr.NS_ERROR_INVALID_ARG);
|
||||||
|
|
@ -3008,7 +2999,7 @@ this.AddonManager = {
|
||||||
AddonManagerInternal.autoUpdateDefault = aValue;
|
AddonManagerInternal.autoUpdateDefault = aValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
escapeAddonURI: function AM_escapeAddonURI(aAddon, aUri, aAppVersion) {
|
escapeAddonURI: function(aAddon, aUri, aAppVersion) {
|
||||||
return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion);
|
return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue