mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
remove named function syntax in addonManager.js
This commit is contained in:
parent
a202619fcf
commit
b285dd8974
1 changed files with 13 additions and 17 deletions
|
|
@ -53,7 +53,7 @@ function amManager() {
|
|||
}
|
||||
|
||||
amManager.prototype = {
|
||||
observe: function AMC_observe(aSubject, aTopic, aData) {
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
if (aTopic == "addons-startup")
|
||||
AddonManagerPrivate.startup();
|
||||
},
|
||||
|
|
@ -61,7 +61,7 @@ amManager.prototype = {
|
|||
/**
|
||||
* @see amIAddonManager.idl
|
||||
*/
|
||||
mapURIToAddonID: function AMC_mapURIToAddonID(uri, id) {
|
||||
mapURIToAddonID: function(uri, id) {
|
||||
id.value = AddonManager.mapURIToAddonID(uri);
|
||||
return !!id.value;
|
||||
},
|
||||
|
|
@ -69,19 +69,15 @@ amManager.prototype = {
|
|||
/**
|
||||
* @see amIWebInstaller.idl
|
||||
*/
|
||||
isInstallEnabled: function AMC_isInstallEnabled(aMimetype, aReferer) {
|
||||
isInstallEnabled: function(aMimetype, aReferer) {
|
||||
return AddonManager.isInstallEnabled(aMimetype);
|
||||
},
|
||||
|
||||
/**
|
||||
* @see amIWebInstaller.idl
|
||||
*/
|
||||
installAddonsFromWebpage: function AMC_installAddonsFromWebpage(aMimetype,
|
||||
aBrowser,
|
||||
aInstallingPrincipal,
|
||||
aUris, aHashes,
|
||||
aNames, aIcons,
|
||||
aCallback) {
|
||||
installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal,
|
||||
aUris, aHashes, aNames, aIcons, aCallback) {
|
||||
if (aUris.length == 0)
|
||||
return false;
|
||||
|
||||
|
|
@ -112,22 +108,22 @@ amManager.prototype = {
|
|||
installs.push(aInstall);
|
||||
if (aCallback) {
|
||||
aInstall.addListener({
|
||||
onDownloadCancelled: function buildNextInstall_onDownloadCancelled(aInstall) {
|
||||
onDownloadCancelled: function(aInstall) {
|
||||
callCallback(uri, USER_CANCELLED);
|
||||
},
|
||||
|
||||
onDownloadFailed: function buildNextInstall_onDownloadFailed(aInstall) {
|
||||
onDownloadFailed: function(aInstall) {
|
||||
if (aInstall.error == AddonManager.ERROR_CORRUPT_FILE)
|
||||
callCallback(uri, CANT_READ_ARCHIVE);
|
||||
else
|
||||
callCallback(uri, DOWNLOAD_ERROR);
|
||||
},
|
||||
|
||||
onInstallFailed: function buildNextInstall_onInstallFailed(aInstall) {
|
||||
onInstallFailed: function(aInstall) {
|
||||
callCallback(uri, EXECUTION_ERROR);
|
||||
},
|
||||
|
||||
onInstallEnded: function buildNextInstall_onInstallEnded(aInstall, aStatus) {
|
||||
onInstallEnded: function(aInstall, aStatus) {
|
||||
callCallback(uri, SUCCESS);
|
||||
}
|
||||
});
|
||||
|
|
@ -144,7 +140,7 @@ amManager.prototype = {
|
|||
return retval;
|
||||
},
|
||||
|
||||
notify: function AMC_notify(aTimer) {
|
||||
notify: function(aTimer) {
|
||||
AddonManagerPrivate.backgroundUpdateTimerHandler();
|
||||
},
|
||||
|
||||
|
|
@ -154,7 +150,7 @@ amManager.prototype = {
|
|||
* Listens to requests from child processes for InstallTrigger
|
||||
* activity, and sends back callbacks.
|
||||
*/
|
||||
receiveMessage: function AMC_receiveMessage(aMessage) {
|
||||
receiveMessage: function(aMessage) {
|
||||
let payload = aMessage.data;
|
||||
|
||||
switch (aMessage.name) {
|
||||
|
|
@ -165,7 +161,7 @@ amManager.prototype = {
|
|||
let callback = null;
|
||||
if (payload.callbackID != -1) {
|
||||
callback = {
|
||||
onInstallEnded: function ITP_callback(url, status) {
|
||||
onInstallEnded: function(url, status) {
|
||||
gParentMM.broadcastAsyncMessage(MSG_INSTALL_CALLBACK, {
|
||||
callbackID: payload.callbackID,
|
||||
url: url,
|
||||
|
|
@ -184,7 +180,7 @@ amManager.prototype = {
|
|||
|
||||
classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
|
||||
_xpcom_factory: {
|
||||
createInstance: function AMC_createInstance(aOuter, aIid) {
|
||||
createInstance: function(aOuter, aIid) {
|
||||
if (aOuter != null)
|
||||
throw Components.Exception("Component does not support aggregation",
|
||||
Cr.NS_ERROR_NO_AGGREGATION);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue