示例#1
0
文件: acr.js 项目: kmaglione/ACR
        var callback = function(installedExtensions)
        {
            var uninstalledC = 0;

            for (var extension of installedExtensions)
            {
                if (extensions.type == "locale")
                {
                    Logger.info("Disabling locale '" + extensions.id + "'");

                    extensions.userDisabled = true;
                    uninstalledC++;
                }
            }

            prefService.reset("general.useragent.locale");
            prefService.reset("intl.locale.matchOS");

            if (uninstalledC > 0)
            {
                Services.startup.quit(
                    Services.startup.eForceQuit |
                    Services.startup.eRestart);
            }
        };
示例#2
0
文件: acr.js 项目: kmaglione/ACR
    var disableLangPacks = function()
    {
        Logger.info("Detected application upgrade (to/from alpha/beta or major upgrade); disabling langpacks.");

        var callback = function(installedExtensions)
        {
            var uninstalledC = 0;

            for (var extension of installedExtensions)
            {
                if (extensions.type == "locale")
                {
                    Logger.info("Disabling locale '" + extensions.id + "'");

                    extensions.userDisabled = true;
                    uninstalledC++;
                }
            }

            prefService.reset("general.useragent.locale");
            prefService.reset("intl.locale.matchOS");

            if (uninstalledC > 0)
            {
                Services.startup.quit(
                    Services.startup.eForceQuit |
                    Services.startup.eRestart);
            }
        };

        Util.getInstalledExtensions(callback);
    };
示例#3
0
文件: acr.js 项目: kmaglione/ACR
    var setPromptTimeout = function(currAppVersion)
    {
        // So... let me get this straight... whenever someone switches
        // to/from beta/aurora, we wait 3 weeks and then nag them to
        // file compat reports? And at no other time? ...
        ss.storage.promptTimeout = Date.now() + PROMPT_TIMEOUT;
        exports.checkForPromptTimeout();

        Logger.info("Detected application upgrade (to aurora/beta); setting prompt timeout for " + new Date(ss.storage.promptTimeout));

    };
示例#4
0
文件: acr.js 项目: kmaglione/ACR
exports.setAMOShowIncompatibleAddons = function ()
{
    Logger.info("Setting AMO show incompatible addons");

    // see bug 675762
    try
    {
        Util.getLocalStorageForOrigin(SHOW_INCOMPATIBLE_ADDONS_STORAGE_ORIGIN).setItem(SHOW_INCOMPATIBLE_ADDONS_STORAGE_NAME, 1);
    }
    catch (e)
    {
        Logger.warn("ShowIncompatibleAddons: Local storage disabled ('" + e + "') falling back to cookies.");

        var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
        var cookieUri = ios.newURI(SHOW_INCOMPATIBLE_ADDONS_STORAGE_ORIGIN, null, null);
        var cookieSvc = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
        cookieSvc.setCookieString(cookieUri, null, SHOW_INCOMPATIBLE_ADDONS_STORAGE_NAME + "=1", null);
    }
}
示例#5
0
文件: acr.js 项目: kmaglione/ACR
 var resetCompatibilityInformation = function(currAppVersion)
 {
     Logger.info("Detected application upgrade (to/from alpha/beta or major upgrade); cleared previous compatibility information.");
     AddonReportStorage.clearAllAddonReports();
 };