Created
August 24, 2012 07:31
-
-
Save xabolcs/3447122 to your computer and use it in GitHub Desktop.
NTT Issue #60: Langpack auto updater for daily builds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Components.utils.import("resource:///modules/XPCOMUtils.jsm"); | |
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource:///modules/Services.jsm"); | |
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource:///modules/AddonManager.jsm"); | |
AddonManager.getAddonsByTypes(["locale"] , function (aAddons) { | |
aAddons.forEach(function(aAddon){ | |
Services.console.logStringMessage(aAddon.name + " ("+ aAddon.id +") is " + (aAddon.isCompatible ? "compatible" : "not compatible") ); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Components.utils.import("resource:///modules/XPCOMUtils.jsm"); | |
XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource:///modules/AddonManager.jsm"); | |
var langpackURL = "https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora-l10n/win32/xpi/firefox-16.0a2.hu.langpack.xpi"; | |
AddonManager.getInstallForURL(langpackURL , function(aInstall) { | |
/* After installation a notification about restart would be needed! */ | |
aInstall.install(); | |
}, "application/x-xpinstall"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment