Clean up try/catch blocks for preferences.
This commit is contained in:
parent
f434591ded
commit
7474601f4c
|
@ -83,10 +83,7 @@ var gSyncUI = {
|
||||||
_wasDelayed: false,
|
_wasDelayed: false,
|
||||||
|
|
||||||
_needsSetup: function SUI__needsSetup() {
|
_needsSetup: function SUI__needsSetup() {
|
||||||
let firstSync = "";
|
let firstSync = Services.prefs.getCharPref("services.sync.firstSync", "");
|
||||||
try {
|
|
||||||
firstSync = Services.prefs.getCharPref("services.sync.firstSync");
|
|
||||||
} catch (e) { }
|
|
||||||
return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
|
return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
|
||||||
firstSync == "notReady";
|
firstSync == "notReady";
|
||||||
},
|
},
|
||||||
|
|
|
@ -2586,15 +2586,9 @@ var gMenuButtonUpdateBadge = {
|
||||||
cancelObserverRegistered: false,
|
cancelObserverRegistered: false,
|
||||||
|
|
||||||
init: function () {
|
init: function () {
|
||||||
try {
|
this.enabled = Services.prefs.getBoolPref("app.update.badge", false);
|
||||||
this.enabled = Services.prefs.getBoolPref("app.update.badge");
|
|
||||||
} catch (e) {}
|
|
||||||
if (this.enabled) {
|
if (this.enabled) {
|
||||||
try {
|
this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime", 345600); // 4 days
|
||||||
this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime");
|
|
||||||
} catch (e) {
|
|
||||||
this.badgeWaitTime = 345600; // 4 days
|
|
||||||
}
|
|
||||||
Services.obs.addObserver(this, "update-staged", false);
|
Services.obs.addObserver(this, "update-staged", false);
|
||||||
Services.obs.addObserver(this, "update-downloaded", false);
|
Services.obs.addObserver(this, "update-downloaded", false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4135,11 +4135,7 @@
|
||||||
return true;
|
return true;
|
||||||
if (this._logInit)
|
if (this._logInit)
|
||||||
return this._shouldLog;
|
return this._shouldLog;
|
||||||
let result = false;
|
let result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming", false);
|
||||||
try {
|
|
||||||
result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming");
|
|
||||||
} catch (ex) {
|
|
||||||
}
|
|
||||||
this._shouldLog = result;
|
this._shouldLog = result;
|
||||||
this._logInit = true;
|
this._logInit = true;
|
||||||
return this._shouldLog;
|
return this._shouldLog;
|
||||||
|
@ -5208,11 +5204,7 @@
|
||||||
window.addEventListener("resize", this, false);
|
window.addEventListener("resize", this, false);
|
||||||
window.addEventListener("load", this, false);
|
window.addEventListener("load", this, false);
|
||||||
|
|
||||||
try {
|
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false);
|
||||||
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled");
|
|
||||||
} catch (ex) {
|
|
||||||
this._tabAnimationLoggingEnabled = false;
|
|
||||||
}
|
|
||||||
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
|
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
|
||||||
]]>
|
]]>
|
||||||
</constructor>
|
</constructor>
|
||||||
|
|
|
@ -158,10 +158,7 @@ var gUIStateBeforeReset = {
|
||||||
XPCOMUtils.defineLazyGetter(this, "log", () => {
|
XPCOMUtils.defineLazyGetter(this, "log", () => {
|
||||||
let scope = {};
|
let scope = {};
|
||||||
Cu.import("resource://gre/modules/Console.jsm", scope);
|
Cu.import("resource://gre/modules/Console.jsm", scope);
|
||||||
let debug;
|
let debug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false);
|
||||||
try {
|
|
||||||
debug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
|
|
||||||
} catch (ex) {}
|
|
||||||
let consoleOptions = {
|
let consoleOptions = {
|
||||||
maxLogLevel: debug ? "all" : "log",
|
maxLogLevel: debug ? "all" : "log",
|
||||||
prefix: "CustomizableUI",
|
prefix: "CustomizableUI",
|
||||||
|
@ -1914,16 +1911,10 @@ var CustomizableUIInternal = {
|
||||||
// state immediately when a browser window opens, which is important for
|
// state immediately when a browser window opens, which is important for
|
||||||
// other consumers of this API.
|
// other consumers of this API.
|
||||||
loadSavedState: function() {
|
loadSavedState: function() {
|
||||||
let state = null;
|
let state = Services.prefs.getCharPref(kPrefCustomizationState, "");
|
||||||
try {
|
|
||||||
state = Services.prefs.getCharPref(kPrefCustomizationState);
|
|
||||||
} catch (e) {
|
|
||||||
log.debug("No saved state found");
|
|
||||||
// This will fail if nothing has been customized, so silently fall back to
|
|
||||||
// the defaults.
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!state) {
|
if (!state) {
|
||||||
|
log.debug("No saved state found");
|
||||||
|
// Nothing has been customized, so silently fall back to the defaults.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -2208,10 +2199,7 @@ var CustomizableUIInternal = {
|
||||||
this.notifyListeners("onWidgetAdded", widget.id, widget.currentArea,
|
this.notifyListeners("onWidgetAdded", widget.id, widget.currentArea,
|
||||||
widget.currentPosition);
|
widget.currentPosition);
|
||||||
} else if (widgetMightNeedAutoAdding) {
|
} else if (widgetMightNeedAutoAdding) {
|
||||||
let autoAdd = true;
|
let autoAdd = Services.prefs.getBoolPref(kPrefCustomizationAutoAdd, true);
|
||||||
try {
|
|
||||||
autoAdd = Services.prefs.getBoolPref(kPrefCustomizationAutoAdd);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
// If the widget doesn't have an existing placement, and it hasn't been
|
// If the widget doesn't have an existing placement, and it hasn't been
|
||||||
// seen before, then add it to its default area so it can be used.
|
// seen before, then add it to its default area so it can be used.
|
||||||
|
|
|
@ -40,10 +40,7 @@ const kWidePanelItemClass = "panel-wide-item";
|
||||||
XPCOMUtils.defineLazyGetter(this, "log", () => {
|
XPCOMUtils.defineLazyGetter(this, "log", () => {
|
||||||
let scope = {};
|
let scope = {};
|
||||||
Cu.import("resource://gre/modules/Console.jsm", scope);
|
Cu.import("resource://gre/modules/Console.jsm", scope);
|
||||||
let debug;
|
let debug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false);
|
||||||
try {
|
|
||||||
debug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
|
|
||||||
} catch (ex) {}
|
|
||||||
let consoleOptions = {
|
let consoleOptions = {
|
||||||
maxLogLevel: debug ? "all" : "log",
|
maxLogLevel: debug ? "all" : "log",
|
||||||
prefix: "CustomizableWidgets",
|
prefix: "CustomizableWidgets",
|
||||||
|
|
|
@ -40,9 +40,7 @@ let gDebug;
|
||||||
XPCOMUtils.defineLazyGetter(this, "log", () => {
|
XPCOMUtils.defineLazyGetter(this, "log", () => {
|
||||||
let scope = {};
|
let scope = {};
|
||||||
Cu.import("resource://gre/modules/Console.jsm", scope);
|
Cu.import("resource://gre/modules/Console.jsm", scope);
|
||||||
try {
|
gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug, false);
|
||||||
gDebug = Services.prefs.getBoolPref(kPrefCustomizationDebug);
|
|
||||||
} catch (ex) {}
|
|
||||||
let consoleOptions = {
|
let consoleOptions = {
|
||||||
maxLogLevel: gDebug ? "all" : "log",
|
maxLogLevel: gDebug ? "all" : "log",
|
||||||
prefix: "CustomizeMode",
|
prefix: "CustomizeMode",
|
||||||
|
@ -1503,10 +1501,7 @@ CustomizeMode.prototype = {
|
||||||
if (!AppConstants.CAN_DRAW_IN_TITLEBAR) {
|
if (!AppConstants.CAN_DRAW_IN_TITLEBAR) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let drawInTitlebar = true;
|
let drawInTitlebar = Services.prefs.getBoolPref(kDrawInTitlebarPref, true);
|
||||||
try {
|
|
||||||
drawInTitlebar = Services.prefs.getBoolPref(kDrawInTitlebarPref);
|
|
||||||
} catch (ex) { }
|
|
||||||
let button = this.document.getElementById("customization-titlebar-visibility-button");
|
let button = this.document.getElementById("customization-titlebar-visibility-button");
|
||||||
// Drawing in the titlebar means 'hiding' the titlebar:
|
// Drawing in the titlebar means 'hiding' the titlebar:
|
||||||
if (drawInTitlebar) {
|
if (drawInTitlebar) {
|
||||||
|
|
|
@ -22,10 +22,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
|
||||||
this.DistributionCustomizer = function DistributionCustomizer() {
|
this.DistributionCustomizer = function DistributionCustomizer() {
|
||||||
// For parallel xpcshell testing purposes allow loading the distribution.ini
|
// For parallel xpcshell testing purposes allow loading the distribution.ini
|
||||||
// file from the profile folder through an hidden pref.
|
// file from the profile folder through an hidden pref.
|
||||||
let loadFromProfile = false;
|
loadFromProfile = Services.prefs.getBoolPref("distribution.testing.loadFromProfile", false);
|
||||||
try {
|
|
||||||
loadFromProfile = Services.prefs.getBoolPref("distribution.testing.loadFromProfile");
|
|
||||||
} catch (ex) {}
|
|
||||||
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
|
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
|
||||||
getService(Ci.nsIProperties);
|
getService(Ci.nsIProperties);
|
||||||
try {
|
try {
|
||||||
|
@ -60,13 +57,7 @@ DistributionCustomizer.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
get _locale() {
|
get _locale() {
|
||||||
let locale;
|
let locale = this._prefs.getCharPref("general.useragent.locale", "en-US");
|
||||||
try {
|
|
||||||
locale = this._prefs.getCharPref("general.useragent.locale");
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
locale = "en-US";
|
|
||||||
}
|
|
||||||
this.__defineGetter__("_locale", () => locale);
|
this.__defineGetter__("_locale", () => locale);
|
||||||
return this._locale;
|
return this._locale;
|
||||||
},
|
},
|
||||||
|
@ -291,11 +282,7 @@ DistributionCustomizer.prototype = {
|
||||||
this._ini.getString("Global", "id") + ".bookmarksProcessed";
|
this._ini.getString("Global", "id") + ".bookmarksProcessed";
|
||||||
}
|
}
|
||||||
|
|
||||||
let bmProcessed = false;
|
let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false);
|
||||||
try {
|
|
||||||
bmProcessed = this._prefs.getBoolPref(bmProcessedPref);
|
|
||||||
}
|
|
||||||
catch (e) {}
|
|
||||||
|
|
||||||
if (!bmProcessed) {
|
if (!bmProcessed) {
|
||||||
if (sections["BookmarksMenu"])
|
if (sections["BookmarksMenu"])
|
||||||
|
|
|
@ -19,12 +19,7 @@ function LOG(str) {
|
||||||
let prefB = Cc["@mozilla.org/preferences-service;1"].
|
let prefB = Cc["@mozilla.org/preferences-service;1"].
|
||||||
getService(Ci.nsIPrefBranch);
|
getService(Ci.nsIPrefBranch);
|
||||||
|
|
||||||
let shouldLog = false;
|
let shouldLog = prefB.getBoolPref("feeds.log", false);
|
||||||
try {
|
|
||||||
shouldLog = prefB.getBoolPref("feeds.log");
|
|
||||||
}
|
|
||||||
catch (ex) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldLog)
|
if (shouldLog)
|
||||||
dump("*** Feeds: " + str + "\n");
|
dump("*** Feeds: " + str + "\n");
|
||||||
|
|
|
@ -187,13 +187,8 @@ const Utils = {
|
||||||
|
|
||||||
// check if it is in the black list
|
// check if it is in the black list
|
||||||
let pb = Services.prefs;
|
let pb = Services.prefs;
|
||||||
let allowed;
|
let allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol,
|
||||||
try {
|
pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"));
|
||||||
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default");
|
|
||||||
}
|
|
||||||
if (!allowed) {
|
if (!allowed) {
|
||||||
throw this.getSecurityError(
|
throw this.getSecurityError(
|
||||||
`Not allowed to register a protocol handler for ${aProtocol}`,
|
`Not allowed to register a protocol handler for ${aProtocol}`,
|
||||||
|
|
|
@ -100,20 +100,14 @@ const OVERRIDE_NEW_BUILD_ID = 3;
|
||||||
* OVERRIDE_NONE otherwise.
|
* OVERRIDE_NONE otherwise.
|
||||||
*/
|
*/
|
||||||
function needHomepageOverride(prefb) {
|
function needHomepageOverride(prefb) {
|
||||||
var savedmstone = null;
|
var savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone", "");
|
||||||
try {
|
|
||||||
savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (savedmstone == "ignore")
|
if (savedmstone == "ignore")
|
||||||
return OVERRIDE_NONE;
|
return OVERRIDE_NONE;
|
||||||
|
|
||||||
var mstone = Services.appinfo.platformVersion;
|
var mstone = Services.appinfo.platformVersion;
|
||||||
|
|
||||||
var savedBuildID = null;
|
var savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID", "");
|
||||||
try {
|
|
||||||
savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
var buildID = Services.appinfo.platformBuildID;
|
var buildID = Services.appinfo.platformBuildID;
|
||||||
|
|
||||||
|
@ -489,10 +483,7 @@ nsBrowserContentHandler.prototype = {
|
||||||
// URL if we do end up showing an overridePage. This makes it possible
|
// URL if we do end up showing an overridePage. This makes it possible
|
||||||
// to have the overridePage's content vary depending on the version we're
|
// to have the overridePage's content vary depending on the version we're
|
||||||
// upgrading from.
|
// upgrading from.
|
||||||
let old_mstone = "unknown";
|
let old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "unknown");
|
||||||
try {
|
|
||||||
old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone");
|
|
||||||
} catch (ex) {}
|
|
||||||
override = needHomepageOverride(prefb);
|
override = needHomepageOverride(prefb);
|
||||||
if (override != OVERRIDE_NONE) {
|
if (override != OVERRIDE_NONE) {
|
||||||
switch (override) {
|
switch (override) {
|
||||||
|
|
|
@ -959,10 +959,7 @@ BrowserGlue.prototype = {
|
||||||
// Offer to reset a user's profile if it hasn't been used for 60 days.
|
// Offer to reset a user's profile if it hasn't been used for 60 days.
|
||||||
const OFFER_PROFILE_RESET_INTERVAL_MS = 60 * 24 * 60 * 60 * 1000;
|
const OFFER_PROFILE_RESET_INTERVAL_MS = 60 * 24 * 60 * 60 * 1000;
|
||||||
let lastUse = Services.appinfo.replacedLockTime;
|
let lastUse = Services.appinfo.replacedLockTime;
|
||||||
let disableResetPrompt = false;
|
let disableResetPrompt = Services.prefs.getBoolPref("browser.disableResetPrompt", false);
|
||||||
try {
|
|
||||||
disableResetPrompt = Services.prefs.getBoolPref("browser.disableResetPrompt");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (!disableResetPrompt && lastUse &&
|
if (!disableResetPrompt && lastUse &&
|
||||||
Date.now() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
|
Date.now() - lastUse >= OFFER_PROFILE_RESET_INTERVAL_MS) {
|
||||||
|
@ -1504,10 +1501,7 @@ BrowserGlue.prototype = {
|
||||||
} catch (ex) {}
|
} catch (ex) {}
|
||||||
|
|
||||||
// Support legacy bookmarks.html format for apps that depend on that format.
|
// Support legacy bookmarks.html format for apps that depend on that format.
|
||||||
let autoExportHTML = false;
|
let autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false); // Do not export.
|
||||||
try {
|
|
||||||
autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML");
|
|
||||||
} catch (ex) {} // Do not export.
|
|
||||||
if (autoExportHTML) {
|
if (autoExportHTML) {
|
||||||
// Sqlite.jsm and Places shutdown happen at profile-before-change, thus,
|
// Sqlite.jsm and Places shutdown happen at profile-before-change, thus,
|
||||||
// to be on the safe side, this should run earlier.
|
// to be on the safe side, this should run earlier.
|
||||||
|
@ -1577,10 +1571,7 @@ BrowserGlue.prototype = {
|
||||||
// An import operation is about to run.
|
// An import operation is about to run.
|
||||||
// Don't try to recreate smart bookmarks if autoExportHTML is true or
|
// Don't try to recreate smart bookmarks if autoExportHTML is true or
|
||||||
// smart bookmarks are disabled.
|
// smart bookmarks are disabled.
|
||||||
let smartBookmarksVersion = 0;
|
let smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0);
|
||||||
try {
|
|
||||||
smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion");
|
|
||||||
} catch (ex) {}
|
|
||||||
if (!autoExportHTML && smartBookmarksVersion != -1)
|
if (!autoExportHTML && smartBookmarksVersion != -1)
|
||||||
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
|
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
|
||||||
|
|
||||||
|
@ -1931,10 +1922,7 @@ BrowserGlue.prototype = {
|
||||||
// Refactor urlbar suggestion preferences to make it extendable and
|
// Refactor urlbar suggestion preferences to make it extendable and
|
||||||
// allow new suggestion types (e.g: search suggestions).
|
// allow new suggestion types (e.g: search suggestions).
|
||||||
let types = ["history", "bookmark", "openpage"];
|
let types = ["history", "bookmark", "openpage"];
|
||||||
let defaultBehavior = 0;
|
let defaultBehavior = Services.prefs.getIntPref("browser.urlbar.default.behavior", 0);
|
||||||
try {
|
|
||||||
defaultBehavior = Services.prefs.getIntPref("browser.urlbar.default.behavior");
|
|
||||||
} catch (ex) {}
|
|
||||||
try {
|
try {
|
||||||
let autocompleteEnabled = Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled");
|
let autocompleteEnabled = Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled");
|
||||||
if (!autocompleteEnabled) {
|
if (!autocompleteEnabled) {
|
||||||
|
@ -1987,12 +1975,8 @@ BrowserGlue.prototype = {
|
||||||
|
|
||||||
if (currentUIVersion < 30) {
|
if (currentUIVersion < 30) {
|
||||||
// Convert old devedition theme pref to lightweight theme storage
|
// Convert old devedition theme pref to lightweight theme storage
|
||||||
let lightweightThemeSelected = false;
|
let lightweightThemeSelected = Services.prefs.prefHasUserValue("lightweightThemes.selectedThemeID", false);
|
||||||
let selectedThemeID = null;
|
let selectedThemeID = Services.prefs.getCharPref("lightweightThemes.selectedThemeID", "");
|
||||||
try {
|
|
||||||
lightweightThemeSelected = Services.prefs.prefHasUserValue("lightweightThemes.selectedThemeID");
|
|
||||||
selectedThemeID = Services.prefs.getCharPref("lightweightThemes.selectedThemeID");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
let defaultThemeSelected = false;
|
let defaultThemeSelected = false;
|
||||||
try {
|
try {
|
||||||
|
@ -2142,10 +2126,7 @@ BrowserGlue.prototype = {
|
||||||
const MAX_RESULTS = 10;
|
const MAX_RESULTS = 10;
|
||||||
|
|
||||||
// Get current smart bookmarks version. If not set, create them.
|
// Get current smart bookmarks version. If not set, create them.
|
||||||
let smartBookmarksCurrentVersion = 0;
|
let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0);
|
||||||
try {
|
|
||||||
smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF);
|
|
||||||
} catch (ex) {}
|
|
||||||
|
|
||||||
// If version is current, or smart bookmarks are disabled, bail out.
|
// If version is current, or smart bookmarks are disabled, bail out.
|
||||||
if (smartBookmarksCurrentVersion == -1 ||
|
if (smartBookmarksCurrentVersion == -1 ||
|
||||||
|
|
|
@ -83,10 +83,7 @@ var gSyncUI = {
|
||||||
_wasDelayed: false,
|
_wasDelayed: false,
|
||||||
|
|
||||||
_needsSetup: function SUI__needsSetup() {
|
_needsSetup: function SUI__needsSetup() {
|
||||||
let firstSync = "";
|
let firstSync = Services.prefs.getCharPref("services.sync.firstSync", "");
|
||||||
try {
|
|
||||||
firstSync = Services.prefs.getCharPref("services.sync.firstSync");
|
|
||||||
} catch (e) { }
|
|
||||||
return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
|
return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED ||
|
||||||
firstSync == "notReady";
|
firstSync == "notReady";
|
||||||
},
|
},
|
||||||
|
@ -285,11 +282,7 @@ var gSyncUI = {
|
||||||
if (!syncButton)
|
if (!syncButton)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let lastSync;
|
let lastSync = Services.prefs.getCharPref("services.sync.lastSync");
|
||||||
try {
|
|
||||||
lastSync = Services.prefs.getCharPref("services.sync.lastSync");
|
|
||||||
}
|
|
||||||
catch (e) { };
|
|
||||||
if (!lastSync || this._needsSetup()) {
|
if (!lastSync || this._needsSetup()) {
|
||||||
syncButton.removeAttribute("tooltiptext");
|
syncButton.removeAttribute("tooltiptext");
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3628,11 +3628,7 @@
|
||||||
window.addEventListener("resize", this, false);
|
window.addEventListener("resize", this, false);
|
||||||
window.addEventListener("load", this, false);
|
window.addEventListener("load", this, false);
|
||||||
|
|
||||||
try {
|
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false);
|
||||||
this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled");
|
|
||||||
} catch (ex) {
|
|
||||||
this._tabAnimationLoggingEnabled = false;
|
|
||||||
}
|
|
||||||
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
|
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
|
||||||
]]>
|
]]>
|
||||||
</constructor>
|
</constructor>
|
||||||
|
|
|
@ -38,13 +38,7 @@ DistributionCustomizer.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
get _locale() {
|
get _locale() {
|
||||||
let locale;
|
let locale = this._prefs.getCharPref("general.useragent.locale", "en-US");
|
||||||
try {
|
|
||||||
locale = this._prefs.getCharPref("general.useragent.locale");
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
locale = "en-US";
|
|
||||||
}
|
|
||||||
this.__defineGetter__("_locale", function() locale);
|
this.__defineGetter__("_locale", function() locale);
|
||||||
return this._locale;
|
return this._locale;
|
||||||
},
|
},
|
||||||
|
@ -221,11 +215,7 @@ DistributionCustomizer.prototype = {
|
||||||
this._ini.getString("Global", "id") + ".bookmarksProcessed";
|
this._ini.getString("Global", "id") + ".bookmarksProcessed";
|
||||||
}
|
}
|
||||||
|
|
||||||
let bmProcessed = false;
|
let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false);
|
||||||
try {
|
|
||||||
bmProcessed = this._prefs.getBoolPref(bmProcessedPref);
|
|
||||||
}
|
|
||||||
catch (e) {}
|
|
||||||
|
|
||||||
if (!bmProcessed) {
|
if (!bmProcessed) {
|
||||||
if (sections["BookmarksMenu"])
|
if (sections["BookmarksMenu"])
|
||||||
|
|
|
@ -18,12 +18,7 @@ function LOG(str) {
|
||||||
var prefB = Cc["@mozilla.org/preferences-service;1"].
|
var prefB = Cc["@mozilla.org/preferences-service;1"].
|
||||||
getService(Ci.nsIPrefBranch);
|
getService(Ci.nsIPrefBranch);
|
||||||
|
|
||||||
var shouldLog = false;
|
var shouldLog = prefB.getBoolPref("feeds.log", false);
|
||||||
try {
|
|
||||||
shouldLog = prefB.getBoolPref("feeds.log");
|
|
||||||
}
|
|
||||||
catch (ex) {
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldLog)
|
if (shouldLog)
|
||||||
dump("*** Feeds: " + str + "\n");
|
dump("*** Feeds: " + str + "\n");
|
||||||
|
@ -874,11 +869,7 @@ FeedWriter.prototype = {
|
||||||
Cc["@mozilla.org/preferences-service;1"].
|
Cc["@mozilla.org/preferences-service;1"].
|
||||||
getService(Ci.nsIPrefBranch);
|
getService(Ci.nsIPrefBranch);
|
||||||
|
|
||||||
var handler = "bookmarks";
|
var handler = prefs.getCharPref(getPrefReaderForType(feedType), "bookmarks");
|
||||||
try {
|
|
||||||
handler = prefs.getCharPref(getPrefReaderForType(feedType));
|
|
||||||
}
|
|
||||||
catch (ex) { }
|
|
||||||
|
|
||||||
switch (handler) {
|
switch (handler) {
|
||||||
case "web": {
|
case "web": {
|
||||||
|
@ -1076,11 +1067,7 @@ FeedWriter.prototype = {
|
||||||
.addEventListener("command", this, false);
|
.addEventListener("command", this, false);
|
||||||
|
|
||||||
// first-run ui
|
// first-run ui
|
||||||
var showFirstRunUI = true;
|
var showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI, true);
|
||||||
try {
|
|
||||||
showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI);
|
|
||||||
}
|
|
||||||
catch (ex) { }
|
|
||||||
if (showFirstRunUI) {
|
if (showFirstRunUI) {
|
||||||
var textfeedinfo1, textfeedinfo2;
|
var textfeedinfo1, textfeedinfo2;
|
||||||
switch (feedType) {
|
switch (feedType) {
|
||||||
|
|
|
@ -436,13 +436,8 @@ WebContentConverterRegistrar.prototype = {
|
||||||
|
|
||||||
// check if it is in the black list
|
// check if it is in the black list
|
||||||
var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||||
var allowed;
|
var allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol,
|
||||||
try {
|
pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"));
|
||||||
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default");
|
|
||||||
}
|
|
||||||
if (!allowed) {
|
if (!allowed) {
|
||||||
// XXX this should be a "security exception" according to spec
|
// XXX this should be a "security exception" according to spec
|
||||||
throw("Not allowed to register a protocol handler for " + aProtocol);
|
throw("Not allowed to register a protocol handler for " + aProtocol);
|
||||||
|
|
|
@ -100,20 +100,14 @@ const OVERRIDE_NEW_BUILD_ID = 3;
|
||||||
* OVERRIDE_NONE otherwise.
|
* OVERRIDE_NONE otherwise.
|
||||||
*/
|
*/
|
||||||
function needHomepageOverride(prefb) {
|
function needHomepageOverride(prefb) {
|
||||||
var savedmstone = null;
|
var savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone", "");
|
||||||
try {
|
|
||||||
savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (savedmstone == "ignore")
|
if (savedmstone == "ignore")
|
||||||
return OVERRIDE_NONE;
|
return OVERRIDE_NONE;
|
||||||
|
|
||||||
var mstone = Services.appinfo.platformVersion;
|
var mstone = Services.appinfo.platformVersion;
|
||||||
|
|
||||||
var savedBuildID = null;
|
var savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID", "");
|
||||||
try {
|
|
||||||
savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
var buildID = Services.appinfo.platformBuildID;
|
var buildID = Services.appinfo.platformBuildID;
|
||||||
|
|
||||||
|
@ -550,10 +544,7 @@ nsBrowserContentHandler.prototype = {
|
||||||
// URL if we do end up showing an overridePage. This makes it possible
|
// URL if we do end up showing an overridePage. This makes it possible
|
||||||
// to have the overridePage's content vary depending on the version we're
|
// to have the overridePage's content vary depending on the version we're
|
||||||
// upgrading from.
|
// upgrading from.
|
||||||
let old_mstone = "unknown";
|
let old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "unknown");
|
||||||
try {
|
|
||||||
old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone");
|
|
||||||
} catch (ex) {}
|
|
||||||
let override = needHomepageOverride(prefb);
|
let override = needHomepageOverride(prefb);
|
||||||
if (override != OVERRIDE_NONE) {
|
if (override != OVERRIDE_NONE) {
|
||||||
switch (override) {
|
switch (override) {
|
||||||
|
|
|
@ -993,14 +993,8 @@ BrowserGlue.prototype = {
|
||||||
// An import operation is about to run.
|
// An import operation is about to run.
|
||||||
// Don't try to recreate smart bookmarks if autoExportHTML is true or
|
// Don't try to recreate smart bookmarks if autoExportHTML is true or
|
||||||
// smart bookmarks are disabled.
|
// smart bookmarks are disabled.
|
||||||
var autoExportHTML = false;
|
var autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false);
|
||||||
try {
|
var smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0);
|
||||||
autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML");
|
|
||||||
} catch(ex) {}
|
|
||||||
var smartBookmarksVersion = 0;
|
|
||||||
try {
|
|
||||||
smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion");
|
|
||||||
} catch(ex) {}
|
|
||||||
if (!autoExportHTML && smartBookmarksVersion != -1)
|
if (!autoExportHTML && smartBookmarksVersion != -1)
|
||||||
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
|
Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0);
|
||||||
|
|
||||||
|
@ -1559,10 +1553,7 @@ BrowserGlue.prototype = {
|
||||||
const MAX_RESULTS = 10;
|
const MAX_RESULTS = 10;
|
||||||
|
|
||||||
// Get current smart bookmarks version. If not set, create them.
|
// Get current smart bookmarks version. If not set, create them.
|
||||||
let smartBookmarksCurrentVersion = 0;
|
let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0);
|
||||||
try {
|
|
||||||
smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF);
|
|
||||||
} catch(ex) {}
|
|
||||||
|
|
||||||
// If version is current or smart bookmarks are disabled, just bail out.
|
// If version is current or smart bookmarks are disabled, just bail out.
|
||||||
if (smartBookmarksCurrentVersion == -1 ||
|
if (smartBookmarksCurrentVersion == -1 ||
|
||||||
|
|
|
@ -195,12 +195,7 @@ DevTools.prototype = {
|
||||||
return tool;
|
return tool;
|
||||||
}
|
}
|
||||||
|
|
||||||
let enabled;
|
let enabled = Services.prefs.getBoolPref(tool.visibilityswitch, true);
|
||||||
try {
|
|
||||||
enabled = Services.prefs.getBoolPref(tool.visibilityswitch);
|
|
||||||
} catch (e) {
|
|
||||||
enabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return enabled ? tool : null;
|
return enabled ? tool : null;
|
||||||
},
|
},
|
||||||
|
|
|
@ -100,17 +100,12 @@ function openToolbox({ form, chrome, isTabActor }) {
|
||||||
};
|
};
|
||||||
TargetFactory.forRemoteTab(options).then(target => {
|
TargetFactory.forRemoteTab(options).then(target => {
|
||||||
let frame = document.getElementById("toolbox-iframe");
|
let frame = document.getElementById("toolbox-iframe");
|
||||||
let selectedTool = "jsdebugger";
|
// Remember the last panel that was used inside of this profile.
|
||||||
|
// But if we are testing, then it should always open the debugger panel.
|
||||||
try {
|
let selectedTool =
|
||||||
// Remember the last panel that was used inside of this profile.
|
Services.prefs.getCharPref("devtools.browsertoolbox.panel",
|
||||||
selectedTool = Services.prefs.getCharPref("devtools.toolbox.selectedTool");
|
Services.prefs.getCharPref("devtools.toolbox.selectedTool",
|
||||||
} catch(e) {}
|
"jsdebugger"));
|
||||||
|
|
||||||
try {
|
|
||||||
// But if we are testing, then it should always open the debugger panel.
|
|
||||||
selectedTool = Services.prefs.getCharPref("devtools.browsertoolbox.panel");
|
|
||||||
} catch(e) {}
|
|
||||||
|
|
||||||
let options = { customIframe: frame };
|
let options = { customIframe: frame };
|
||||||
gDevTools.showToolbox(target,
|
gDevTools.showToolbox(target,
|
||||||
|
|
|
@ -1131,12 +1131,7 @@ Toolbox.prototype = {
|
||||||
setToolboxButtonsVisibility: function () {
|
setToolboxButtonsVisibility: function () {
|
||||||
this.toolboxButtons.forEach(buttonSpec => {
|
this.toolboxButtons.forEach(buttonSpec => {
|
||||||
let { visibilityswitch, button, isTargetSupported } = buttonSpec;
|
let { visibilityswitch, button, isTargetSupported } = buttonSpec;
|
||||||
let on = true;
|
let on = Services.prefs.getBoolPref(visibilityswitch, true);
|
||||||
try {
|
|
||||||
on = Services.prefs.getBoolPref(visibilityswitch);
|
|
||||||
} catch (ex) {
|
|
||||||
// Do nothing.
|
|
||||||
}
|
|
||||||
|
|
||||||
on = on && isTargetSupported(this.target);
|
on = on && isTargetSupported(this.target);
|
||||||
|
|
||||||
|
|
|
@ -73,11 +73,8 @@ function MarkupView(inspector, frame, controllerWindow) {
|
||||||
this._elt = this.doc.querySelector("#root");
|
this._elt = this.doc.querySelector("#root");
|
||||||
this.htmlEditor = new HTMLEditor(this.doc);
|
this.htmlEditor = new HTMLEditor(this.doc);
|
||||||
|
|
||||||
try {
|
this.maxChildren = Services.prefs.getIntPref("devtools.markup.pagesize",
|
||||||
this.maxChildren = Services.prefs.getIntPref("devtools.markup.pagesize");
|
DEFAULT_MAX_CHILDREN);
|
||||||
} catch (ex) {
|
|
||||||
this.maxChildren = DEFAULT_MAX_CHILDREN;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.collapseAttributes =
|
this.collapseAttributes =
|
||||||
Services.prefs.getBoolPref(ATTR_COLLAPSE_ENABLED_PREF);
|
Services.prefs.getBoolPref(ATTR_COLLAPSE_ENABLED_PREF);
|
||||||
|
|
|
@ -18,19 +18,8 @@ var systemAppOrigin = (function () {
|
||||||
return systemOrigin;
|
return systemOrigin;
|
||||||
})();
|
})();
|
||||||
|
|
||||||
var threshold = 25;
|
var threshold = Services.prefs.getIntPref("ui.dragThresholdX", 25);
|
||||||
try {
|
var delay = Services.prefs.getIntPref("ui.click_hold_context_menus.delay", 500);
|
||||||
threshold = Services.prefs.getIntPref("ui.dragThresholdX");
|
|
||||||
} catch (e) {
|
|
||||||
// Fall back to default value
|
|
||||||
}
|
|
||||||
|
|
||||||
var delay = 500;
|
|
||||||
try {
|
|
||||||
delay = Services.prefs.getIntPref("ui.click_hold_context_menus.delay");
|
|
||||||
} catch (e) {
|
|
||||||
// Fall back to default value
|
|
||||||
}
|
|
||||||
|
|
||||||
function SimulatorCore(simulatorTarget) {
|
function SimulatorCore(simulatorTarget) {
|
||||||
this.simulatorTarget = simulatorTarget;
|
this.simulatorTarget = simulatorTarget;
|
||||||
|
|
|
@ -1010,11 +1010,7 @@ BrowserElementChild.prototype = {
|
||||||
self._takeScreenshot(maxWidth, maxHeight, mimeType, domRequestID);
|
self._takeScreenshot(maxWidth, maxHeight, mimeType, domRequestID);
|
||||||
};
|
};
|
||||||
|
|
||||||
let maxDelayMS = 2000;
|
let maxDelayMS = Services.prefs.getIntPref('dom.browserElement.maxScreenshotDelayMS', 2000);
|
||||||
try {
|
|
||||||
maxDelayMS = Services.prefs.getIntPref('dom.browserElement.maxScreenshotDelayMS');
|
|
||||||
}
|
|
||||||
catch(e) {}
|
|
||||||
|
|
||||||
// Try to wait for the event loop to go idle before we take the screenshot,
|
// Try to wait for the event loop to go idle before we take the screenshot,
|
||||||
// but once we've waited maxDelayMS milliseconds, go ahead and take it
|
// but once we've waited maxDelayMS milliseconds, go ahead and take it
|
||||||
|
@ -1720,10 +1716,7 @@ BrowserElementChild.prototype = {
|
||||||
// certerror? If yes, maybe we should add a property to the
|
// certerror? If yes, maybe we should add a property to the
|
||||||
// event to to indicate whether there is a custom page. That would
|
// event to to indicate whether there is a custom page. That would
|
||||||
// let the embedder have more control over the desired behavior.
|
// let the embedder have more control over the desired behavior.
|
||||||
let errorPage = null;
|
let errorPage = Services.prefs.getCharPref(CERTIFICATE_ERROR_PAGE_PREF, "");
|
||||||
try {
|
|
||||||
errorPage = Services.prefs.getCharPref(CERTIFICATE_ERROR_PAGE_PREF);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (errorPage == 'certerror') {
|
if (errorPage == 'certerror') {
|
||||||
sendAsyncMsg('error', { type: 'certerror' });
|
sendAsyncMsg('error', { type: 'certerror' });
|
||||||
|
|
|
@ -31,14 +31,8 @@
|
||||||
Cu.import("resource://gre/modules/Services.jsm");
|
Cu.import("resource://gre/modules/Services.jsm");
|
||||||
for (var stage of [ "install", "startup", "shutdown", "uninstall" ]) {
|
for (var stage of [ "install", "startup", "shutdown", "uninstall" ]) {
|
||||||
for (var symbol of [ "IDBKeyRange", "indexedDB" ]) {
|
for (var symbol of [ "IDBKeyRange", "indexedDB" ]) {
|
||||||
let pref;
|
let pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
|
||||||
try {
|
"." + symbol, false);
|
||||||
pref = Services.prefs.getBoolPref("indexeddbtest.bootstrap." + stage +
|
|
||||||
"." + symbol);
|
|
||||||
}
|
|
||||||
catch(ex) {
|
|
||||||
pref = false;
|
|
||||||
}
|
|
||||||
ok(pref, "Symbol '" + symbol + "' present during '" + stage + "'");
|
ok(pref, "Symbol '" + symbol + "' present during '" + stage + "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,13 +109,7 @@ PresentationTransportBuilder.prototype = {
|
||||||
|
|
||||||
// TODO bug 1228235 we should have a way to let device providers customize
|
// TODO bug 1228235 we should have a way to let device providers customize
|
||||||
// the time-out duration.
|
// the time-out duration.
|
||||||
let timeout;
|
let timeout = Services.prefs.getIntPref("presentation.receiver.loading.timeout", 10000);
|
||||||
try {
|
|
||||||
timeout = Services.prefs.getIntPref("presentation.receiver.loading.timeout");
|
|
||||||
} catch (e) {
|
|
||||||
// This happens if the pref doesn't exist, so we have a default value.
|
|
||||||
timeout = 10000;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The timer is to check if the negotiation finishes on time.
|
// The timer is to check if the negotiation finishes on time.
|
||||||
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
|
||||||
|
|
|
@ -14,13 +14,7 @@ const Ci = Components.interfaces;
|
||||||
const CONTENT_PAGE = "http://mochi.test:8888/chrome/dom/tests/mochitest/localstorage/page_blank.html";
|
const CONTENT_PAGE = "http://mochi.test:8888/chrome/dom/tests/mochitest/localstorage/page_blank.html";
|
||||||
const slavePath = "/chrome/dom/tests/mochitest/localstorage/";
|
const slavePath = "/chrome/dom/tests/mochitest/localstorage/";
|
||||||
var currentTest = 1;
|
var currentTest = 1;
|
||||||
var quota;
|
var quota = Services.prefs.getIntPref("dom.storage.default_quota", 5 * 1024);
|
||||||
|
|
||||||
try {
|
|
||||||
quota = Services.prefs.getIntPref("dom.storage.default_quota");
|
|
||||||
} catch (ex) {
|
|
||||||
quota = 5 * 1024;
|
|
||||||
}
|
|
||||||
Services.prefs.setIntPref("browser.startup.page", 0);
|
Services.prefs.setIntPref("browser.startup.page", 0);
|
||||||
Services.prefs.setIntPref("dom.storage.default_quota", 1);
|
Services.prefs.setIntPref("dom.storage.default_quota", 1);
|
||||||
|
|
||||||
|
|
|
@ -277,29 +277,10 @@ this.OnRefTestLoad = function OnRefTestLoad(win)
|
||||||
|
|
||||||
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
var prefs = Components.classes["@mozilla.org/preferences-service;1"].
|
||||||
getService(Components.interfaces.nsIPrefBranch);
|
getService(Components.interfaces.nsIPrefBranch);
|
||||||
try {
|
gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart", false);
|
||||||
gBrowserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart");
|
gB2GisMulet = prefs.getBoolPref("b2g.is_mulet", false);
|
||||||
} catch (e) {
|
gBrowserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled", false);
|
||||||
gBrowserIsRemote = false;
|
gLogLevel = prefs.getCharPref("reftest.logLevel", "info");
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
gB2GisMulet = prefs.getBoolPref("b2g.is_mulet");
|
|
||||||
} catch (e) {
|
|
||||||
gB2GisMulet = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
gBrowserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled");
|
|
||||||
} catch (e) {
|
|
||||||
gBrowserIsIframe = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
gLogLevel = prefs.getCharPref("reftest.logLevel");
|
|
||||||
} catch (e) {
|
|
||||||
gLogLevel ='info';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (win === undefined || win == null) {
|
if (win === undefined || win == null) {
|
||||||
win = window;
|
win = window;
|
||||||
|
@ -366,11 +347,7 @@ function InitAndStartRefTests()
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
|
|
||||||
/* set the gLoadTimeout */
|
/* set the gLoadTimeout */
|
||||||
try {
|
gLoadTimeout = prefs.getIntPref("reftest.timeout", 5 * 60 * 1000); //5 minutes as per bug 479518
|
||||||
gLoadTimeout = prefs.getIntPref("reftest.timeout");
|
|
||||||
} catch(e) {
|
|
||||||
gLoadTimeout = 5 * 60 * 1000; //5 minutes as per bug 479518
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get the logfile for android tests */
|
/* Get the logfile for android tests */
|
||||||
try {
|
try {
|
||||||
|
@ -381,27 +358,12 @@ function InitAndStartRefTests()
|
||||||
}
|
}
|
||||||
} catch(e) {}
|
} catch(e) {}
|
||||||
|
|
||||||
try {
|
gRemote = prefs.getBoolPref("reftest.remote", false);
|
||||||
gRemote = prefs.getBoolPref("reftest.remote");
|
gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize", false);
|
||||||
} catch(e) {
|
|
||||||
gRemote = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
gIgnoreWindowSize = prefs.getBoolPref("reftest.ignoreWindowSize");
|
|
||||||
} catch(e) {
|
|
||||||
gIgnoreWindowSize = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Support for running a chunk (subset) of tests. In separate try as this is optional */
|
/* Support for running a chunk (subset) of tests. In separate try as this is optional */
|
||||||
try {
|
gTotalChunks = prefs.getIntPref("reftest.totalChunks", 0);
|
||||||
gTotalChunks = prefs.getIntPref("reftest.totalChunks");
|
gThisChunk = prefs.getIntPref("reftest.thisChunk", 0);
|
||||||
gThisChunk = prefs.getIntPref("reftest.thisChunk");
|
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
gTotalChunks = 0;
|
|
||||||
gThisChunk = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
gFocusFilterMode = prefs.getCharPref("reftest.focusFilterMode");
|
gFocusFilterMode = prefs.getCharPref("reftest.focusFilterMode");
|
||||||
|
@ -468,39 +430,17 @@ function StartTests()
|
||||||
logger.error("EXCEPTION: " + e);
|
logger.error("EXCEPTION: " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
gNoCanvasCache = prefs.getIntPref("reftest.nocache", false);
|
||||||
gNoCanvasCache = prefs.getIntPref("reftest.nocache");
|
gShuffle = prefs.getBoolPref("reftest.shuffle", false);
|
||||||
} catch(e) {
|
gRunUntilFailure = prefs.getBoolPref("reftest.runUntilFailure", false);
|
||||||
gNoCanvasCache = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
gShuffle = prefs.getBoolPref("reftest.shuffle");
|
|
||||||
} catch (e) {
|
|
||||||
gShuffle = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
gRunUntilFailure = prefs.getBoolPref("reftest.runUntilFailure");
|
|
||||||
} catch (e) {
|
|
||||||
gRunUntilFailure = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// When we repeat this function is called again, so really only want to set
|
// When we repeat this function is called again, so really only want to set
|
||||||
// gRepeat once.
|
// gRepeat once.
|
||||||
if (gRepeat == null) {
|
if (gRepeat == null) {
|
||||||
try {
|
gRepeat = prefs.getIntPref("reftest.repeat", 0);
|
||||||
gRepeat = prefs.getIntPref("reftest.repeat");
|
|
||||||
} catch (e) {
|
|
||||||
gRepeat = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
gRunSlowTests = prefs.getIntPref("reftest.skipslowtests", false);
|
||||||
gRunSlowTests = prefs.getIntPref("reftest.skipslowtests");
|
|
||||||
} catch(e) {
|
|
||||||
gRunSlowTests = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gShuffle) {
|
if (gShuffle) {
|
||||||
gNoCanvasCache = true;
|
gNoCanvasCache = true;
|
||||||
|
@ -737,11 +677,7 @@ function BuildConditionSandbox(aURL) {
|
||||||
|
|
||||||
var prefs = CC["@mozilla.org/preferences-service;1"].
|
var prefs = CC["@mozilla.org/preferences-service;1"].
|
||||||
getService(CI.nsIPrefBranch);
|
getService(CI.nsIPrefBranch);
|
||||||
try {
|
sandbox.nativeThemePref = !prefs.getBoolPref("mozilla.widget.disable-native-theme", false);
|
||||||
sandbox.nativeThemePref = !prefs.getBoolPref("mozilla.widget.disable-native-theme");
|
|
||||||
} catch (e) {
|
|
||||||
sandbox.nativeThemePref = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
sandbox.prefs = CU.cloneInto({
|
sandbox.prefs = CU.cloneInto({
|
||||||
getBoolPref: function(p) { return prefs.getBoolPref(p); },
|
getBoolPref: function(p) { return prefs.getBoolPref(p); },
|
||||||
|
|
|
@ -78,24 +78,14 @@ function InitializeCacheDevices(memDevice, diskDevice) {
|
||||||
this.start = function() {
|
this.start = function() {
|
||||||
prefService.setBoolPref("browser.cache.memory.enable", memDevice);
|
prefService.setBoolPref("browser.cache.memory.enable", memDevice);
|
||||||
if (memDevice) {
|
if (memDevice) {
|
||||||
try {
|
cap = prefService.getIntPref("browser.cache.memory.capacity", 0);
|
||||||
cap = prefService.getIntPref("browser.cache.memory.capacity");
|
|
||||||
}
|
|
||||||
catch(ex) {
|
|
||||||
cap = 0;
|
|
||||||
}
|
|
||||||
if (cap == 0) {
|
if (cap == 0) {
|
||||||
prefService.setIntPref("browser.cache.memory.capacity", 1024);
|
prefService.setIntPref("browser.cache.memory.capacity", 1024);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefService.setBoolPref("browser.cache.disk.enable", diskDevice);
|
prefService.setBoolPref("browser.cache.disk.enable", diskDevice);
|
||||||
if (diskDevice) {
|
if (diskDevice) {
|
||||||
try {
|
cap = prefService.getIntPref("browser.cache.disk.capacity", 0);
|
||||||
cap = prefService.getIntPref("browser.cache.disk.capacity");
|
|
||||||
}
|
|
||||||
catch(ex) {
|
|
||||||
cap = 0;
|
|
||||||
}
|
|
||||||
if (cap == 0) {
|
if (cap == 0) {
|
||||||
prefService.setIntPref("browser.cache.disk.capacity", 1024);
|
prefService.setIntPref("browser.cache.disk.capacity", 1024);
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,12 +121,7 @@ const testcases = [
|
||||||
function run_test() {
|
function run_test() {
|
||||||
var pbi = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
var pbi = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||||
var oldProfile = pbi.getCharPref("network.IDN.restriction_profile", "moderate");
|
var oldProfile = pbi.getCharPref("network.IDN.restriction_profile", "moderate");
|
||||||
var oldWhiteListCom;
|
var oldWhitelistCom = pbi.getBoolPref("network.IDN.whitelist.com", false);
|
||||||
try {
|
|
||||||
oldWhitelistCom = pbi.getBoolPref("network.IDN.whitelist.com");
|
|
||||||
} catch(e) {
|
|
||||||
oldWhitelistCom = false;
|
|
||||||
}
|
|
||||||
var idnService = Cc["@mozilla.org/network/idn-service;1"].getService(Ci.nsIIDNService);
|
var idnService = Cc["@mozilla.org/network/idn-service;1"].getService(Ci.nsIIDNService);
|
||||||
|
|
||||||
pbi.setCharPref("network.IDN.restriction_profile", "moderate");
|
pbi.setCharPref("network.IDN.restriction_profile", "moderate");
|
||||||
|
|
|
@ -295,12 +295,7 @@ const profiles = ["ASCII", "high", "moderate"];
|
||||||
function run_test() {
|
function run_test() {
|
||||||
var pbi = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
var pbi = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
|
||||||
var oldProfile = pbi.getCharPref("network.IDN.restriction_profile", "moderate");
|
var oldProfile = pbi.getCharPref("network.IDN.restriction_profile", "moderate");
|
||||||
var oldWhiteListCom;
|
var oldWhitelistCom = pbi.getBoolPref("network.IDN.whitelist.com", false);
|
||||||
try {
|
|
||||||
oldWhitelistCom = pbi.getBoolPref("network.IDN.whitelist.com");
|
|
||||||
} catch(e) {
|
|
||||||
oldWhitelistCom = false;
|
|
||||||
}
|
|
||||||
var idnService = Cc["@mozilla.org/network/idn-service;1"].getService(Ci.nsIIDNService);
|
var idnService = Cc["@mozilla.org/network/idn-service;1"].getService(Ci.nsIIDNService);
|
||||||
|
|
||||||
for (var i = 0; i < profiles.length; ++i) {
|
for (var i = 0; i < profiles.length; ++i) {
|
||||||
|
|
|
@ -149,10 +149,7 @@ TokenServerClientServerError.prototype._toStringFields = function() {
|
||||||
*/
|
*/
|
||||||
this.TokenServerClient = function TokenServerClient() {
|
this.TokenServerClient = function TokenServerClient() {
|
||||||
this._log = Log.repository.getLogger("Common.TokenServerClient");
|
this._log = Log.repository.getLogger("Common.TokenServerClient");
|
||||||
let level = "Debug";
|
let level = Services.prefs.getCharPref(PREF_LOG_LEVEL, "Debug");
|
||||||
try {
|
|
||||||
level = Services.prefs.getCharPref(PREF_LOG_LEVEL);
|
|
||||||
} catch (ex) {}
|
|
||||||
this._log.level = Log.Level[level];
|
this._log.level = Log.Level[level];
|
||||||
}
|
}
|
||||||
TokenServerClient.prototype = {
|
TokenServerClient.prototype = {
|
||||||
|
|
|
@ -51,11 +51,7 @@ WeaveCrypto.prototype = {
|
||||||
this.prefBranch = Services.prefs.getBranch("services.sync.log.");
|
this.prefBranch = Services.prefs.getBranch("services.sync.log.");
|
||||||
this.prefBranch.addObserver("cryptoDebug", this.observer, false);
|
this.prefBranch.addObserver("cryptoDebug", this.observer, false);
|
||||||
this.observer._self = this;
|
this.observer._self = this;
|
||||||
try {
|
this.debug = this.prefBranch.getBoolPref("cryptoDebug", false);
|
||||||
this.debug = this.prefBranch.getBoolPref("cryptoDebug");
|
|
||||||
} catch (x) {
|
|
||||||
this.debug = false;
|
|
||||||
}
|
|
||||||
XPCOMUtils.defineLazyGetter(this, 'encoder', () => new TextEncoder(UTF_LABEL));
|
XPCOMUtils.defineLazyGetter(this, 'encoder', () => new TextEncoder(UTF_LABEL));
|
||||||
XPCOMUtils.defineLazyGetter(this, 'decoder', () => new TextDecoder(UTF_LABEL, { fatal: true }));
|
XPCOMUtils.defineLazyGetter(this, 'decoder', () => new TextDecoder(UTF_LABEL, { fatal: true }));
|
||||||
},
|
},
|
||||||
|
|
|
@ -125,12 +125,7 @@ this.Status = {
|
||||||
resetSync: function resetSync() {
|
resetSync: function resetSync() {
|
||||||
// Logger setup.
|
// Logger setup.
|
||||||
let logPref = PREFS_BRANCH + "log.logger.status";
|
let logPref = PREFS_BRANCH + "log.logger.status";
|
||||||
let logLevel = "Trace";
|
let logLevel = Services.prefs.getCharPref(logPref, "Trace");
|
||||||
try {
|
|
||||||
logLevel = Services.prefs.getCharPref(logPref);
|
|
||||||
} catch (ex) {
|
|
||||||
// Use default.
|
|
||||||
}
|
|
||||||
this._log.level = Log.Level[logLevel];
|
this._log.level = Log.Level[logLevel];
|
||||||
|
|
||||||
this._log.info("Resetting Status.");
|
this._log.info("Resetting Status.");
|
||||||
|
|
|
@ -79,12 +79,8 @@ const DELAY_WARNING_MS = 10 * 1000;
|
||||||
// Crash the process if shutdown is really too long
|
// Crash the process if shutdown is really too long
|
||||||
// (allowing for sleep).
|
// (allowing for sleep).
|
||||||
const PREF_DELAY_CRASH_MS = "toolkit.asyncshutdown.crash_timeout";
|
const PREF_DELAY_CRASH_MS = "toolkit.asyncshutdown.crash_timeout";
|
||||||
var DELAY_CRASH_MS = 60 * 1000; // One minute
|
var DELAY_CRASH_MS = Services.prefs.getIntPref(PREF_DELAY_CRASH_MS,
|
||||||
try {
|
60 * 1000); // One minute
|
||||||
DELAY_CRASH_MS = Services.prefs.getIntPref(PREF_DELAY_CRASH_MS);
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore errors
|
|
||||||
}
|
|
||||||
Services.prefs.addObserver(PREF_DELAY_CRASH_MS, function() {
|
Services.prefs.addObserver(PREF_DELAY_CRASH_MS, function() {
|
||||||
DELAY_CRASH_MS = Services.prefs.getIntPref(PREF_DELAY_CRASH_MS);
|
DELAY_CRASH_MS = Services.prefs.getIntPref(PREF_DELAY_CRASH_MS);
|
||||||
}, false);
|
}, false);
|
||||||
|
@ -207,12 +203,7 @@ function log(msg, prefix = "", error = null) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const PREF_DEBUG_LOG = "toolkit.asyncshutdown.log";
|
const PREF_DEBUG_LOG = "toolkit.asyncshutdown.log";
|
||||||
var DEBUG_LOG = false;
|
var DEBUG_LOG = Services.prefs.getBoolPref(PREF_DEBUG_LOG, false);
|
||||||
try {
|
|
||||||
DEBUG_LOG = Services.prefs.getBoolPref(PREF_DEBUG_LOG);
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore errors
|
|
||||||
}
|
|
||||||
Services.prefs.addObserver(PREF_DEBUG_LOG, function() {
|
Services.prefs.addObserver(PREF_DEBUG_LOG, function() {
|
||||||
DEBUG_LOG = Services.prefs.getBoolPref(PREF_DEBUG_LOG);
|
DEBUG_LOG = Services.prefs.getBoolPref(PREF_DEBUG_LOG);
|
||||||
}, false);
|
}, false);
|
||||||
|
@ -360,12 +351,7 @@ this.AsyncShutdown = {
|
||||||
* Access function getPhase. For testing purposes only.
|
* Access function getPhase. For testing purposes only.
|
||||||
*/
|
*/
|
||||||
get _getPhase() {
|
get _getPhase() {
|
||||||
let accepted = false;
|
let accepted = Services.prefs.getBoolPref("toolkit.asyncshutdown.testing", false);
|
||||||
try {
|
|
||||||
accepted = Services.prefs.getBoolPref("toolkit.asyncshutdown.testing");
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore errors
|
|
||||||
}
|
|
||||||
if (accepted) {
|
if (accepted) {
|
||||||
return getPhase;
|
return getPhase;
|
||||||
}
|
}
|
||||||
|
@ -464,12 +450,7 @@ function getPhase(topic) {
|
||||||
* notification. For testing purposes only.
|
* notification. For testing purposes only.
|
||||||
*/
|
*/
|
||||||
get _trigger() {
|
get _trigger() {
|
||||||
let accepted = false;
|
let accepted = Services.prefs.getBoolPref("toolkit.asyncshutdown.testing", false);
|
||||||
try {
|
|
||||||
accepted = Services.prefs.getBoolPref("toolkit.asyncshutdown.testing");
|
|
||||||
} catch (ex) {
|
|
||||||
// Ignore errors
|
|
||||||
}
|
|
||||||
if (accepted) {
|
if (accepted) {
|
||||||
return () => spinner.observe();
|
return () => spinner.observe();
|
||||||
}
|
}
|
||||||
|
|
|
@ -243,16 +243,7 @@ function getLocale() {
|
||||||
|
|
||||||
/* Get the distribution pref values, from defaults only */
|
/* Get the distribution pref values, from defaults only */
|
||||||
function getDistributionPrefValue(aPrefName) {
|
function getDistributionPrefValue(aPrefName) {
|
||||||
var prefValue = "default";
|
return gPref.getDefaultBranch(null).getCharPref(aPrefName, "default");
|
||||||
|
|
||||||
var defaults = gPref.getDefaultBranch(null);
|
|
||||||
try {
|
|
||||||
prefValue = defaults.getCharPref(aPrefName);
|
|
||||||
} catch (e) {
|
|
||||||
// use default when pref not found
|
|
||||||
}
|
|
||||||
|
|
||||||
return prefValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -368,11 +368,7 @@ this.DownloadIntegration = {
|
||||||
*/
|
*/
|
||||||
getPreferredDownloadsDirectory: Task.async(function* () {
|
getPreferredDownloadsDirectory: Task.async(function* () {
|
||||||
let directoryPath = null;
|
let directoryPath = null;
|
||||||
let prefValue = 1;
|
let prefValue = Services.prefs.getIntPref("browser.download.folderList", 1);
|
||||||
|
|
||||||
try {
|
|
||||||
prefValue = Services.prefs.getIntPref("browser.download.folderList");
|
|
||||||
} catch(e) {}
|
|
||||||
|
|
||||||
switch(prefValue) {
|
switch(prefValue) {
|
||||||
case 0: // Desktop
|
case 0: // Desktop
|
||||||
|
|
|
@ -104,13 +104,7 @@ nsDefaultCLH.prototype = {
|
||||||
// if the pref is missing, ignore the exception
|
// if the pref is missing, ignore the exception
|
||||||
try {
|
try {
|
||||||
var chromeURI = prefs.getCharPref("toolkit.defaultChromeURI");
|
var chromeURI = prefs.getCharPref("toolkit.defaultChromeURI");
|
||||||
|
var flags = prefs.getCharPref("toolkit.defaultChromeFeatures", "chrome,dialog=no,all");
|
||||||
var flags = "chrome,dialog=no,all";
|
|
||||||
try {
|
|
||||||
flags = prefs.getCharPref("toolkit.defaultChromeFeatures");
|
|
||||||
}
|
|
||||||
catch (e) { }
|
|
||||||
|
|
||||||
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
|
||||||
.getService(nsIWindowWatcher);
|
.getService(nsIWindowWatcher);
|
||||||
wwatch.openWindow(null, chromeURI, "_blank",
|
wwatch.openWindow(null, chromeURI, "_blank",
|
||||||
|
|
|
@ -239,10 +239,9 @@ var Scheduler = this.Scheduler = {
|
||||||
* Prepare to kill the OS.File worker after a few seconds.
|
* Prepare to kill the OS.File worker after a few seconds.
|
||||||
*/
|
*/
|
||||||
restartTimer: function(arg) {
|
restartTimer: function(arg) {
|
||||||
let delay;
|
let delay = Services.prefs.getIntPref("osfile.reset_worker_delay", 0);
|
||||||
try {
|
|
||||||
delay = Services.prefs.getIntPref("osfile.reset_worker_delay");
|
if (!delay) {
|
||||||
} catch(e) {
|
|
||||||
// Don't auto-shutdown if we don't have a delay preference set.
|
// Don't auto-shutdown if we don't have a delay preference set.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -468,43 +467,25 @@ var Scheduler = this.Scheduler = {
|
||||||
const PREF_OSFILE_LOG = "toolkit.osfile.log";
|
const PREF_OSFILE_LOG = "toolkit.osfile.log";
|
||||||
const PREF_OSFILE_LOG_REDIRECT = "toolkit.osfile.log.redirect";
|
const PREF_OSFILE_LOG_REDIRECT = "toolkit.osfile.log.redirect";
|
||||||
|
|
||||||
/**
|
|
||||||
* Safely read a PREF_OSFILE_LOG preference.
|
|
||||||
* Returns a value read or, in case of an error, oldPref or false.
|
|
||||||
*
|
|
||||||
* @param bool oldPref
|
|
||||||
* An optional value that the DEBUG flag was set to previously.
|
|
||||||
*/
|
|
||||||
function readDebugPref(prefName, oldPref = false) {
|
|
||||||
let pref = oldPref;
|
|
||||||
try {
|
|
||||||
pref = Services.prefs.getBoolPref(prefName);
|
|
||||||
} catch (x) {
|
|
||||||
// In case of an error when reading a pref keep it as is.
|
|
||||||
}
|
|
||||||
// If neither pref nor oldPref were set, default it to false.
|
|
||||||
return pref;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Listen to PREF_OSFILE_LOG changes and update gShouldLog flag
|
* Listen to PREF_OSFILE_LOG changes and update gShouldLog flag
|
||||||
* appropriately.
|
* appropriately.
|
||||||
*/
|
*/
|
||||||
Services.prefs.addObserver(PREF_OSFILE_LOG,
|
Services.prefs.addObserver(PREF_OSFILE_LOG,
|
||||||
function prefObserver(aSubject, aTopic, aData) {
|
function prefObserver(aSubject, aTopic, aData) {
|
||||||
SharedAll.Config.DEBUG = readDebugPref(PREF_OSFILE_LOG, SharedAll.Config.DEBUG);
|
SharedAll.Config.DEBUG = Services.prefs.getBoolPref(PREF_OSFILE_LOG, SharedAll.Config.DEBUG);
|
||||||
if (Scheduler.launched) {
|
if (Scheduler.launched) {
|
||||||
// Don't start the worker just to set this preference.
|
// Don't start the worker just to set this preference.
|
||||||
Scheduler.post("SET_DEBUG", [SharedAll.Config.DEBUG]);
|
Scheduler.post("SET_DEBUG", [SharedAll.Config.DEBUG]);
|
||||||
}
|
}
|
||||||
}, false);
|
}, false);
|
||||||
SharedAll.Config.DEBUG = readDebugPref(PREF_OSFILE_LOG, false);
|
SharedAll.Config.DEBUG = Services.prefs.getBoolPref(PREF_OSFILE_LOG, false);
|
||||||
|
|
||||||
Services.prefs.addObserver(PREF_OSFILE_LOG_REDIRECT,
|
Services.prefs.addObserver(PREF_OSFILE_LOG_REDIRECT,
|
||||||
function prefObserver(aSubject, aTopic, aData) {
|
function prefObserver(aSubject, aTopic, aData) {
|
||||||
SharedAll.Config.TEST = readDebugPref(PREF_OSFILE_LOG_REDIRECT, OS.Shared.TEST);
|
SharedAll.Config.TEST = Services.prefs.getBoolPref(PREF_OSFILE_LOG_REDIRECT, OS.Shared.TEST);
|
||||||
}, false);
|
}, false);
|
||||||
SharedAll.Config.TEST = readDebugPref(PREF_OSFILE_LOG_REDIRECT, false);
|
SharedAll.Config.TEST = Services.prefs.getBoolPref(PREF_OSFILE_LOG_REDIRECT, false);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -515,7 +496,7 @@ var nativeWheneverAvailable = true;
|
||||||
const PREF_OSFILE_NATIVE = "toolkit.osfile.native";
|
const PREF_OSFILE_NATIVE = "toolkit.osfile.native";
|
||||||
Services.prefs.addObserver(PREF_OSFILE_NATIVE,
|
Services.prefs.addObserver(PREF_OSFILE_NATIVE,
|
||||||
function prefObserver(aSubject, aTopic, aData) {
|
function prefObserver(aSubject, aTopic, aData) {
|
||||||
nativeWheneverAvailable = readDebugPref(PREF_OSFILE_NATIVE, nativeWheneverAvailable);
|
nativeWheneverAvailable = Services.prefs.getBoolPref(PREF_OSFILE_NATIVE, nativeWheneverAvailable);
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
||||||
|
@ -557,10 +538,9 @@ Services.prefs.addObserver(PREF_OSFILE_TEST_SHUTDOWN_OBSERVER,
|
||||||
function prefObserver() {
|
function prefObserver() {
|
||||||
// The temporary phase topic used to trigger the unclosed
|
// The temporary phase topic used to trigger the unclosed
|
||||||
// phase warning.
|
// phase warning.
|
||||||
let TOPIC = null;
|
let TOPIC = Services.prefs.getCharPref(PREF_OSFILE_TEST_SHUTDOWN_OBSERVER,
|
||||||
|
"");
|
||||||
try {
|
try {
|
||||||
TOPIC = Services.prefs.getCharPref(
|
|
||||||
PREF_OSFILE_TEST_SHUTDOWN_OBSERVER);
|
|
||||||
} catch (x) {
|
} catch (x) {
|
||||||
}
|
}
|
||||||
if (TOPIC) {
|
if (TOPIC) {
|
||||||
|
|
|
@ -77,11 +77,8 @@ PlacesCategoriesStarter.prototype = {
|
||||||
break;
|
break;
|
||||||
case "idle-daily":
|
case "idle-daily":
|
||||||
// Once a week run places.sqlite maintenance tasks.
|
// Once a week run places.sqlite maintenance tasks.
|
||||||
let lastMaintenance = 0;
|
let lastMaintenance =
|
||||||
try {
|
Services.prefs.getIntPref("places.database.lastMaintenance", 0);
|
||||||
lastMaintenance =
|
|
||||||
Services.prefs.getIntPref("places.database.lastMaintenance");
|
|
||||||
} catch (ex) {}
|
|
||||||
let nowSeconds = parseInt(Date.now() / 1000);
|
let nowSeconds = parseInt(Date.now() / 1000);
|
||||||
if (lastMaintenance < nowSeconds - MAINTENANCE_INTERVAL_SECONDS) {
|
if (lastMaintenance < nowSeconds - MAINTENANCE_INTERVAL_SECONDS) {
|
||||||
PlacesDBUtils.maintenanceOnIdle();
|
PlacesDBUtils.maintenanceOnIdle();
|
||||||
|
|
|
@ -95,11 +95,7 @@ function observe(subject, topic, data) {
|
||||||
|
|
||||||
case "nsPref:changed":
|
case "nsPref:changed":
|
||||||
if (data == PREF_SHOW_REMOTE_ICONS) {
|
if (data == PREF_SHOW_REMOTE_ICONS) {
|
||||||
try {
|
showRemoteIcons = Services.prefs.getBoolPref(PREF_SHOW_REMOTE_ICONS, true);
|
||||||
showRemoteIcons = Services.prefs.getBoolPref(PREF_SHOW_REMOTE_ICONS);
|
|
||||||
} catch (_) {
|
|
||||||
showRemoteIcons = true; // no such pref - default is to show the icons.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -437,10 +437,7 @@ XPCOMUtils.defineLazyGetter(this, "Prefs", () => {
|
||||||
store.suggestTyped = prefs.get(...PREF_SUGGEST_HISTORY_ONLYTYPED);
|
store.suggestTyped = prefs.get(...PREF_SUGGEST_HISTORY_ONLYTYPED);
|
||||||
store.suggestSearches = prefs.get(...PREF_SUGGEST_SEARCHES);
|
store.suggestSearches = prefs.get(...PREF_SUGGEST_SEARCHES);
|
||||||
store.maxCharsForSearchSuggestions = prefs.get(...PREF_MAX_CHARS_FOR_SUGGEST);
|
store.maxCharsForSearchSuggestions = prefs.get(...PREF_MAX_CHARS_FOR_SUGGEST);
|
||||||
store.keywordEnabled = true;
|
store.keywordEnabled = Services.prefs.getBoolPref("keyword.enabled", true);
|
||||||
try {
|
|
||||||
store.keywordEnabled = Services.prefs.getBoolPref("keyword.enabled");
|
|
||||||
} catch (ex) {}
|
|
||||||
|
|
||||||
// If history is not set, onlyTyped value should be ignored.
|
// If history is not set, onlyTyped value should be ignored.
|
||||||
if (!store.suggestHistory) {
|
if (!store.suggestHistory) {
|
||||||
|
|
|
@ -812,11 +812,8 @@ nsPlacesExpiration.prototype = {
|
||||||
|
|
||||||
_loadPrefs: Task.async(function* () {
|
_loadPrefs: Task.async(function* () {
|
||||||
// Get the user's limit, if it was set.
|
// Get the user's limit, if it was set.
|
||||||
try {
|
this._urisLimit = this._prefBranch.getIntPref(PREF_MAX_URIS,
|
||||||
// We want to silently fail since getIntPref throws if it does not exist,
|
PREF_MAX_URIS_NOTSET);
|
||||||
// and use a default to fallback to.
|
|
||||||
this._urisLimit = this._prefBranch.getIntPref(PREF_MAX_URIS);
|
|
||||||
} catch (ex) { /* User limit not set */ }
|
|
||||||
|
|
||||||
if (this._urisLimit < 0) {
|
if (this._urisLimit < 0) {
|
||||||
// Some testing code expects a pref change to be synchronous, so
|
// Some testing code expects a pref change to be synchronous, so
|
||||||
|
@ -874,11 +871,8 @@ nsPlacesExpiration.prototype = {
|
||||||
this._urisLimit);
|
this._urisLimit);
|
||||||
|
|
||||||
// Get the expiration interval value.
|
// Get the expiration interval value.
|
||||||
try {
|
this._interval = this._prefBranch.getIntPref(PREF_INTERVAL_SECONDS,
|
||||||
// We want to silently fail since getIntPref throws if it does not exist,
|
PREF_INTERVAL_SECONDS_NOTSET);
|
||||||
// and use a default to fallback to.
|
|
||||||
this._interval = this._prefBranch.getIntPref(PREF_INTERVAL_SECONDS);
|
|
||||||
} catch (ex) { /* User interval not set */ }
|
|
||||||
if (this._interval <= 0) {
|
if (this._interval <= 0) {
|
||||||
this._interval = PREF_INTERVAL_SECONDS_NOTSET;
|
this._interval = PREF_INTERVAL_SECONDS_NOTSET;
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,14 +56,8 @@ var prefPrefix = "places.frecency.";
|
||||||
function* task_initializeBucket(bucket) {
|
function* task_initializeBucket(bucket) {
|
||||||
let [cutoffName, weightName] = bucket;
|
let [cutoffName, weightName] = bucket;
|
||||||
// get pref values
|
// get pref values
|
||||||
var weight = 0, cutoff = 0;
|
var weight = prefs.getIntPref(prefPrefix + weightName, 0);
|
||||||
try {
|
var cutoff = prefs.getIntPref(prefPrefix + cutoffName, 0);
|
||||||
weight = prefs.getIntPref(prefPrefix + weightName);
|
|
||||||
} catch (ex) {}
|
|
||||||
try {
|
|
||||||
cutoff = prefs.getIntPref(prefPrefix + cutoffName);
|
|
||||||
} catch (ex) {}
|
|
||||||
|
|
||||||
if (cutoff < 1)
|
if (cutoff < 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -65,14 +65,7 @@ function initDialog()
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
function isListOfPrinterFeaturesAvailable()
|
function isListOfPrinterFeaturesAvailable()
|
||||||
{
|
{
|
||||||
var has_printerfeatures = false;
|
return gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".has_special_printerfeatures", false);
|
||||||
|
|
||||||
try {
|
|
||||||
has_printerfeatures = gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".has_special_printerfeatures");
|
|
||||||
} catch (ex) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return has_printerfeatures;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
|
|
|
@ -79,15 +79,7 @@ function stripTrailingWhitespace(element)
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
function getPrinterDescription(printerName)
|
function getPrinterDescription(printerName)
|
||||||
{
|
{
|
||||||
var s = "";
|
return gPrefs.getCharPref("print.printer_" + printerName + ".printer_description", "")
|
||||||
|
|
||||||
try {
|
|
||||||
/* This may not work with non-ASCII test (see bug 235763 comment #16) */
|
|
||||||
s = gPrefs.getCharPref("print.printer_" + printerName + ".printer_description")
|
|
||||||
} catch (e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return s;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
|
|
|
@ -33,14 +33,7 @@ function checkDouble(element, maxVal)
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
function isListOfPrinterFeaturesAvailable()
|
function isListOfPrinterFeaturesAvailable()
|
||||||
{
|
{
|
||||||
var has_printerfeatures = false;
|
return gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".has_special_printerfeatures", false);
|
||||||
|
|
||||||
try {
|
|
||||||
has_printerfeatures = gPrefs.getBoolPref("print.tmp.printerfeatures." + gPrintSettings.printerName + ".has_special_printerfeatures");
|
|
||||||
} catch (ex) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return has_printerfeatures;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
|
|
|
@ -391,12 +391,7 @@ function isPartnerBuild() {
|
||||||
|
|
||||||
// Method to determine if we should be using geo-specific defaults
|
// Method to determine if we should be using geo-specific defaults
|
||||||
function geoSpecificDefaultsEnabled() {
|
function geoSpecificDefaultsEnabled() {
|
||||||
let geoSpecificDefaults = false;
|
return Services.prefs.getBoolPref("browser.search.geoSpecificDefaults", false);
|
||||||
try {
|
|
||||||
geoSpecificDefaults = Services.prefs.getBoolPref("browser.search.geoSpecificDefaults");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
return geoSpecificDefaults;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some notes on countryCode and region prefs:
|
// Some notes on countryCode and region prefs:
|
||||||
|
@ -501,11 +496,7 @@ function isUSTimezone() {
|
||||||
// If it fails we don't touch that pref so isUS() does its normal thing.
|
// If it fails we don't touch that pref so isUS() does its normal thing.
|
||||||
var ensureKnownCountryCode = Task.async(function* (ss) {
|
var ensureKnownCountryCode = Task.async(function* (ss) {
|
||||||
// If we have a country-code already stored in our prefs we trust it.
|
// If we have a country-code already stored in our prefs we trust it.
|
||||||
let countryCode;
|
let countryCode = Services.prefs.getCharPref("browser.search.countryCode", "");
|
||||||
try {
|
|
||||||
countryCode = Services.prefs.getCharPref("browser.search.countryCode");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (!countryCode) {
|
if (!countryCode) {
|
||||||
// We don't have it cached, so fetch it. fetchCountryCode() will call
|
// We don't have it cached, so fetch it. fetchCountryCode() will call
|
||||||
// storeCountryCode if it gets a result (even if that happens after the
|
// storeCountryCode if it gets a result (even if that happens after the
|
||||||
|
@ -727,10 +718,7 @@ var fetchRegionDefault = (ss) => new Promise(resolve => {
|
||||||
|
|
||||||
// Append the optional cohort value.
|
// Append the optional cohort value.
|
||||||
const cohortPref = "browser.search.cohort";
|
const cohortPref = "browser.search.cohort";
|
||||||
let cohort;
|
let cohort = Services.prefs.getCharPref(cohortPref, "");
|
||||||
try {
|
|
||||||
cohort = Services.prefs.getCharPref(cohortPref);
|
|
||||||
} catch (e) {}
|
|
||||||
if (cohort)
|
if (cohort)
|
||||||
endpoint += "/" + cohort;
|
endpoint += "/" + cohort;
|
||||||
|
|
||||||
|
@ -994,11 +982,8 @@ function QueryParameter(aName, aValue, aPurpose) {
|
||||||
function ParamSubstitution(aParamValue, aSearchTerms, aEngine) {
|
function ParamSubstitution(aParamValue, aSearchTerms, aEngine) {
|
||||||
var value = aParamValue;
|
var value = aParamValue;
|
||||||
|
|
||||||
var distributionID = Services.appinfo.distributionID;
|
var distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID",
|
||||||
try {
|
Services.appinfo.distributionID || "");
|
||||||
distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID");
|
|
||||||
}
|
|
||||||
catch (ex) { }
|
|
||||||
var official = MOZ_OFFICIAL;
|
var official = MOZ_OFFICIAL;
|
||||||
try {
|
try {
|
||||||
if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official"))
|
if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official"))
|
||||||
|
|
|
@ -418,12 +418,7 @@ function isPartnerBuild() {
|
||||||
|
|
||||||
// Method to determine if we should be using geo-specific defaults
|
// Method to determine if we should be using geo-specific defaults
|
||||||
function geoSpecificDefaultsEnabled() {
|
function geoSpecificDefaultsEnabled() {
|
||||||
let geoSpecificDefaults = false;
|
return Services.prefs.getBoolPref("browser.search.geoSpecificDefaults", false);
|
||||||
try {
|
|
||||||
geoSpecificDefaults = Services.prefs.getBoolPref("browser.search.geoSpecificDefaults");
|
|
||||||
} catch(e) {}
|
|
||||||
|
|
||||||
return geoSpecificDefaults;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some notes on countryCode and region prefs:
|
// Some notes on countryCode and region prefs:
|
||||||
|
@ -528,11 +523,7 @@ function isUSTimezone() {
|
||||||
// If it fails we don't touch that pref so isUS() does its normal thing.
|
// If it fails we don't touch that pref so isUS() does its normal thing.
|
||||||
var ensureKnownCountryCode = Task.async(function* () {
|
var ensureKnownCountryCode = Task.async(function* () {
|
||||||
// If we have a country-code already stored in our prefs we trust it.
|
// If we have a country-code already stored in our prefs we trust it.
|
||||||
let countryCode;
|
let countryCode = Services.prefs.getCharPref("browser.search.countryCode", "");
|
||||||
try {
|
|
||||||
countryCode = Services.prefs.getCharPref("browser.search.countryCode");
|
|
||||||
} catch(e) {}
|
|
||||||
|
|
||||||
if (!countryCode) {
|
if (!countryCode) {
|
||||||
// We don't have it cached, so fetch it. fetchCountryCode() will call
|
// We don't have it cached, so fetch it. fetchCountryCode() will call
|
||||||
// storeCountryCode if it gets a result (even if that happens after the
|
// storeCountryCode if it gets a result (even if that happens after the
|
||||||
|
@ -732,10 +723,7 @@ var fetchRegionDefault = () => new Promise(resolve => {
|
||||||
|
|
||||||
// Append the optional cohort value.
|
// Append the optional cohort value.
|
||||||
const cohortPref = "browser.search.cohort";
|
const cohortPref = "browser.search.cohort";
|
||||||
let cohort;
|
let cohort = Services.prefs.getCharPref(cohortPref, "");
|
||||||
try {
|
|
||||||
cohort = Services.prefs.getCharPref(cohortPref);
|
|
||||||
} catch(e) {}
|
|
||||||
if (cohort)
|
if (cohort)
|
||||||
endpoint += "/" + cohort;
|
endpoint += "/" + cohort;
|
||||||
|
|
||||||
|
@ -1034,11 +1022,8 @@ function QueryParameter(aName, aValue, aPurpose) {
|
||||||
function ParamSubstitution(aParamValue, aSearchTerms, aEngine) {
|
function ParamSubstitution(aParamValue, aSearchTerms, aEngine) {
|
||||||
var value = aParamValue;
|
var value = aParamValue;
|
||||||
|
|
||||||
var distributionID = MOZ_DISTRIBUTION_ID;
|
var distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID",
|
||||||
try {
|
MOZ_DISTRIBUTION_ID || "");
|
||||||
distributionID = Services.prefs.getCharPref(BROWSER_SEARCH_PREF + "distributionID");
|
|
||||||
}
|
|
||||||
catch (ex) { }
|
|
||||||
var official = MOZ_OFFICIAL;
|
var official = MOZ_OFFICIAL;
|
||||||
try {
|
try {
|
||||||
if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official"))
|
if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "official"))
|
||||||
|
|
|
@ -36,11 +36,7 @@ this.UITelemetry = {
|
||||||
Services.obs.addObserver(this, "profile-before-change", false);
|
Services.obs.addObserver(this, "profile-before-change", false);
|
||||||
|
|
||||||
// Pick up the current value.
|
// Pick up the current value.
|
||||||
try {
|
this._enabled = Services.prefs.getBoolPref(PREF_ENABLED, false);
|
||||||
this._enabled = Services.prefs.getBoolPref(PREF_ENABLED);
|
|
||||||
} catch (e) {
|
|
||||||
this._enabled = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return this._enabled;
|
return this._enabled;
|
||||||
},
|
},
|
||||||
|
|
|
@ -20,12 +20,7 @@ Cu.import("resource://gre/modules/NetUtil.jsm");
|
||||||
|
|
||||||
// Log only if browser.safebrowsing.debug is true
|
// Log only if browser.safebrowsing.debug is true
|
||||||
function log(...stuff) {
|
function log(...stuff) {
|
||||||
let logging = null;
|
let logging = Services.prefs.getBoolPref("browser.safebrowsing.debug", false);
|
||||||
try {
|
|
||||||
logging = Services.prefs.getBoolPref("browser.safebrowsing.debug");
|
|
||||||
} catch(e) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!logging) {
|
if (!logging) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,11 +27,9 @@ function run_test() {
|
||||||
QueryInterface(Ci.nsIXULRuntime);
|
QueryInterface(Ci.nsIXULRuntime);
|
||||||
var abi = macutils && macutils.isUniversalBinary ? "Universal-gcc3" : appInfo.XPCOMABI;
|
var abi = macutils && macutils.isUniversalBinary ? "Universal-gcc3" : appInfo.XPCOMABI;
|
||||||
|
|
||||||
let channel = "default";
|
|
||||||
let defaults = prefs.QueryInterface(Ci.nsIPrefService).getDefaultBranch(null);
|
let defaults = prefs.QueryInterface(Ci.nsIPrefService).getDefaultBranch(null);
|
||||||
try {
|
let channel = defaults.getCharPref("app.update.channel", "default");
|
||||||
channel = defaults.getCharPref("app.update.channel");
|
|
||||||
} catch (e) {}
|
|
||||||
// Set distribution values.
|
// Set distribution values.
|
||||||
defaults.setCharPref("distribution.id", "bacon");
|
defaults.setCharPref("distribution.id", "bacon");
|
||||||
defaults.setCharPref("distribution.version", "1.0");
|
defaults.setCharPref("distribution.version", "1.0");
|
||||||
|
|
|
@ -19,14 +19,7 @@
|
||||||
if (this.getAttribute("autoscroll") == "false")
|
if (this.getAttribute("autoscroll") == "false")
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var enabled = true;
|
return this.mPrefs.getBoolPref("general.autoScroll", true);
|
||||||
try {
|
|
||||||
enabled = this.mPrefs.getBoolPref("general.autoScroll");
|
|
||||||
}
|
|
||||||
catch (ex) {
|
|
||||||
}
|
|
||||||
|
|
||||||
return enabled;
|
|
||||||
]]>
|
]]>
|
||||||
</getter>
|
</getter>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1427,18 +1420,8 @@
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Toggle browse with caret mode
|
// Toggle browse with caret mode
|
||||||
var browseWithCaretOn = false;
|
var browseWithCaretOn = this.mPrefs.getBoolPref(kPrefCaretBrowsingOn, false);
|
||||||
var warn = true;
|
var warn = this.mPrefs.getBoolPref(kPrefWarnOnEnable, true);
|
||||||
|
|
||||||
try {
|
|
||||||
warn = this.mPrefs.getBoolPref(kPrefWarnOnEnable);
|
|
||||||
} catch (ex) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
browseWithCaretOn = this.mPrefs.getBoolPref(kPrefCaretBrowsingOn);
|
|
||||||
} catch (ex) {
|
|
||||||
}
|
|
||||||
if (warn && !browseWithCaretOn) {
|
if (warn && !browseWithCaretOn) {
|
||||||
var checkValue = {value:false};
|
var checkValue = {value:false};
|
||||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||||
|
|
|
@ -893,12 +893,8 @@
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
var psvc = Components.classes["@mozilla.org/preferences-service;1"]
|
var psvc = Components.classes["@mozilla.org/preferences-service;1"]
|
||||||
.getService(Components.interfaces.nsIPrefBranch);
|
.getService(Components.interfaces.nsIPrefBranch);
|
||||||
var animate = /Mac/.test(navigator.platform);
|
return psvc.getBoolPref("browser.preferences.animateFadeIn",
|
||||||
try {
|
/Mac/.test(navigator.platform));
|
||||||
animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
|
|
||||||
}
|
|
||||||
catch (e) { }
|
|
||||||
return animate;
|
|
||||||
]]>
|
]]>
|
||||||
</getter>
|
</getter>
|
||||||
</property>
|
</property>
|
||||||
|
|
|
@ -80,13 +80,8 @@
|
||||||
<property name="scrollIncrement" readonly="true">
|
<property name="scrollIncrement" readonly="true">
|
||||||
<getter><![CDATA[
|
<getter><![CDATA[
|
||||||
if (this._scrollIncrement === null) {
|
if (this._scrollIncrement === null) {
|
||||||
try {
|
this._scrollIncrement = this._prefBranch
|
||||||
this._scrollIncrement = this._prefBranch
|
.getIntPref("toolkit.scrollbox.scrollIncrement", 20);
|
||||||
.getIntPref("toolkit.scrollbox.scrollIncrement");
|
|
||||||
}
|
|
||||||
catch (ex) {
|
|
||||||
this._scrollIncrement = 20;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this._scrollIncrement;
|
return this._scrollIncrement;
|
||||||
]]></getter>
|
]]></getter>
|
||||||
|
@ -99,13 +94,8 @@
|
||||||
if (this.hasAttribute("smoothscroll")) {
|
if (this.hasAttribute("smoothscroll")) {
|
||||||
this._smoothScroll = (this.getAttribute("smoothscroll") == "true");
|
this._smoothScroll = (this.getAttribute("smoothscroll") == "true");
|
||||||
} else {
|
} else {
|
||||||
try {
|
this._smoothScroll = this._prefBranch
|
||||||
this._smoothScroll = this._prefBranch
|
.getBoolPref("toolkit.scrollbox.smoothScroll", true);
|
||||||
.getBoolPref("toolkit.scrollbox.smoothScroll");
|
|
||||||
}
|
|
||||||
catch (ex) {
|
|
||||||
this._smoothScroll = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this._smoothScroll;
|
return this._smoothScroll;
|
||||||
|
@ -737,12 +727,9 @@
|
||||||
</content>
|
</content>
|
||||||
<implementation implements="nsITimerCallback, nsIDOMEventListener">
|
<implementation implements="nsITimerCallback, nsIDOMEventListener">
|
||||||
<constructor><![CDATA[
|
<constructor><![CDATA[
|
||||||
try {
|
this._scrollDelay = this._prefBranch
|
||||||
this._scrollDelay = this._prefBranch
|
.getIntPref("toolkit.scrollbox.clickToScroll.scrollDelay",
|
||||||
.getIntPref("toolkit.scrollbox.clickToScroll.scrollDelay");
|
this._scrollDelay);
|
||||||
}
|
|
||||||
catch (ex) {
|
|
||||||
}
|
|
||||||
]]></constructor>
|
]]></constructor>
|
||||||
|
|
||||||
<destructor><![CDATA[
|
<destructor><![CDATA[
|
||||||
|
|
|
@ -119,18 +119,14 @@ LinksStorage.prototype = {
|
||||||
|
|
||||||
get _storedVersion() {
|
get _storedVersion() {
|
||||||
if (this.__storedVersion === undefined) {
|
if (this.__storedVersion === undefined) {
|
||||||
try {
|
// The storage version is unknown, so either:
|
||||||
this.__storedVersion =
|
// - it's a new profile
|
||||||
Services.prefs.getIntPref("browser.newtabpage.storageVersion");
|
// - it's a profile where versioning information got lost
|
||||||
} catch (ex) {
|
// In this case we still run through all of the valid migrations,
|
||||||
// The storage version is unknown, so either:
|
// starting from 1, as if it was a downgrade. As previously stated the
|
||||||
// - it's a new profile
|
// migrations should already support running on an updated store.
|
||||||
// - it's a profile where versioning information got lost
|
this.__storedVersion =
|
||||||
// In this case we still run through all of the valid migrations,
|
Services.prefs.getIntPref("browser.newtabpage.storageVersion", 1);
|
||||||
// starting from 1, as if it was a downgrade. As previously stated the
|
|
||||||
// migrations should already support running on an updated store.
|
|
||||||
this.__storedVersion = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return this.__storedVersion;
|
return this.__storedVersion;
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,10 +16,7 @@ function importPrefBranch(aPrefBranch, aPermission, aAction) {
|
||||||
let list = Services.prefs.getChildList(aPrefBranch, {});
|
let list = Services.prefs.getChildList(aPrefBranch, {});
|
||||||
|
|
||||||
for (let pref of list) {
|
for (let pref of list) {
|
||||||
let origins = "";
|
let origins = Services.prefs.getCharPref(pref, "");
|
||||||
try {
|
|
||||||
origins = Services.prefs.getCharPref(pref);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (!origins)
|
if (!origins)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -31,13 +31,9 @@ this.UpdateUtils = {
|
||||||
* Whether or not to include the partner bits. Default: true.
|
* Whether or not to include the partner bits. Default: true.
|
||||||
*/
|
*/
|
||||||
getUpdateChannel(aIncludePartners = true) {
|
getUpdateChannel(aIncludePartners = true) {
|
||||||
let channel = AppConstants.MOZ_UPDATE_CHANNEL;
|
let channel = defaults.getCharPref("app.update.channel",
|
||||||
|
AppConstants.MOZ_UPDATE_CHANNEL);
|
||||||
let defaults = Services.prefs.getDefaultBranch(null);
|
let defaults = Services.prefs.getDefaultBranch(null);
|
||||||
try {
|
|
||||||
channel = defaults.getCharPref("app.update.channel");
|
|
||||||
} catch (e) {
|
|
||||||
// use default value when pref not found
|
|
||||||
}
|
|
||||||
|
|
||||||
if (aIncludePartners) {
|
if (aIncludePartners) {
|
||||||
try {
|
try {
|
||||||
|
@ -93,15 +89,7 @@ this.UpdateUtils = {
|
||||||
|
|
||||||
/* Get the distribution pref values, from defaults only */
|
/* Get the distribution pref values, from defaults only */
|
||||||
function getDistributionPrefValue(aPrefName) {
|
function getDistributionPrefValue(aPrefName) {
|
||||||
var prefValue = "default";
|
return prefValue = Services.prefs.getDefaultBranch(null).getCharPref(aPrefName, "default");
|
||||||
|
|
||||||
try {
|
|
||||||
prefValue = Services.prefs.getDefaultBranch(null).getCharPref(aPrefName);
|
|
||||||
} catch (e) {
|
|
||||||
// use default when pref not found
|
|
||||||
}
|
|
||||||
|
|
||||||
return prefValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -186,10 +186,7 @@ var SimpleServiceDiscovery = {
|
||||||
},
|
},
|
||||||
|
|
||||||
_searchFixedDevices: function _searchFixedDevices() {
|
_searchFixedDevices: function _searchFixedDevices() {
|
||||||
let fixedDevices = null;
|
let fixedDevices = Services.prefs.getCharPref("browser.casting.fixedDevices", "");
|
||||||
try {
|
|
||||||
fixedDevices = Services.prefs.getCharPref("browser.casting.fixedDevices");
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (!fixedDevices) {
|
if (!fixedDevices) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -253,10 +253,7 @@ nsUnknownContentTypeDialog.prototype = {
|
||||||
if (!aForcePrompt) {
|
if (!aForcePrompt) {
|
||||||
// Check to see if the user wishes to auto save to the default download
|
// Check to see if the user wishes to auto save to the default download
|
||||||
// folder without prompting. Note that preference might not be set.
|
// folder without prompting. Note that preference might not be set.
|
||||||
let autodownload = false;
|
let autodownload = prefs.getBoolPref(PREF_BD_USEDOWNLOADDIR, false);
|
||||||
try {
|
|
||||||
autodownload = prefs.getBoolPref(PREF_BD_USEDOWNLOADDIR);
|
|
||||||
} catch (e) { }
|
|
||||||
|
|
||||||
if (autodownload) {
|
if (autodownload) {
|
||||||
// Retrieve the user's default download directory
|
// Retrieve the user's default download directory
|
||||||
|
|
|
@ -135,12 +135,7 @@ var PrefObserver = {
|
||||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||||
}
|
}
|
||||||
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
||||||
let debugLogEnabled = false;
|
let debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED, false);
|
||||||
try {
|
|
||||||
debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
if (debugLogEnabled) {
|
if (debugLogEnabled) {
|
||||||
parentLogger.level = Log.Level.Debug;
|
parentLogger.level = Log.Level.Debug;
|
||||||
}
|
}
|
||||||
|
@ -791,11 +786,7 @@ var AddonManagerInternal = {
|
||||||
}
|
}
|
||||||
catch (e) { }
|
catch (e) { }
|
||||||
|
|
||||||
let oldPlatformVersion = null;
|
let oldPlatformVersion = Services.prefs.getCharPref(PREF_EM_LAST_PLATFORM_VERSION, "");
|
||||||
try {
|
|
||||||
oldPlatformVersion = Services.prefs.getCharPref(PREF_EM_LAST_PLATFORM_VERSION);
|
|
||||||
}
|
|
||||||
catch (e) { }
|
|
||||||
|
|
||||||
if (appChanged !== false) {
|
if (appChanged !== false) {
|
||||||
logger.debug("Application has been upgraded");
|
logger.debug("Application has been upgraded");
|
||||||
|
@ -808,40 +799,30 @@ var AddonManagerInternal = {
|
||||||
this.validateBlocklist();
|
this.validateBlocklist();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY,
|
||||||
gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY);
|
gCheckCompatibility);
|
||||||
} catch (e) {}
|
|
||||||
Services.prefs.addObserver(PREF_EM_CHECK_COMPATIBILITY, this, false);
|
Services.prefs.addObserver(PREF_EM_CHECK_COMPATIBILITY, this, false);
|
||||||
|
|
||||||
try {
|
gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY,
|
||||||
gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY);
|
gStrictCompatibility);
|
||||||
} catch (e) {}
|
|
||||||
Services.prefs.addObserver(PREF_EM_STRICT_COMPATIBILITY, this, false);
|
Services.prefs.addObserver(PREF_EM_STRICT_COMPATIBILITY, this, false);
|
||||||
|
|
||||||
try {
|
let defaultBranch = Services.prefs.getDefaultBranch("");
|
||||||
let defaultBranch = Services.prefs.getDefaultBranch("");
|
gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY,
|
||||||
gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
|
gCheckUpdateSecurityDefault);
|
||||||
} catch(e) {}
|
|
||||||
|
|
||||||
try {
|
gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY,
|
||||||
gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
|
gCheckUpdateSecurity);
|
||||||
} catch (e) {}
|
|
||||||
Services.prefs.addObserver(PREF_EM_CHECK_UPDATE_SECURITY, this, false);
|
Services.prefs.addObserver(PREF_EM_CHECK_UPDATE_SECURITY, this, false);
|
||||||
|
|
||||||
try {
|
gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED, gUpdateEnabled);
|
||||||
gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED);
|
|
||||||
} catch (e) {}
|
|
||||||
Services.prefs.addObserver(PREF_EM_UPDATE_ENABLED, this, false);
|
Services.prefs.addObserver(PREF_EM_UPDATE_ENABLED, this, false);
|
||||||
|
|
||||||
try {
|
gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT,
|
||||||
gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT);
|
gAutoUpdateDefault);
|
||||||
} catch (e) {}
|
|
||||||
Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this, false);
|
Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this, false);
|
||||||
|
|
||||||
let defaultProvidersEnabled = true;
|
let defaultProvidersEnabled = Services.prefs.getBoolPref(PREF_DEFAULT_PROVIDERS_ENABLED, true);
|
||||||
try {
|
|
||||||
defaultProvidersEnabled = Services.prefs.getBoolPref(PREF_DEFAULT_PROVIDERS_ENABLED);
|
|
||||||
} catch (e) {}
|
|
||||||
AddonManagerPrivate.recordSimpleMeasure("default_providers", defaultProvidersEnabled);
|
AddonManagerPrivate.recordSimpleMeasure("default_providers", defaultProvidersEnabled);
|
||||||
|
|
||||||
// Ensure all default providers have had a chance to register themselves
|
// Ensure all default providers have had a chance to register themselves
|
||||||
|
@ -1167,11 +1148,7 @@ var AddonManagerInternal = {
|
||||||
switch (aData) {
|
switch (aData) {
|
||||||
case PREF_EM_CHECK_COMPATIBILITY: {
|
case PREF_EM_CHECK_COMPATIBILITY: {
|
||||||
let oldValue = gCheckCompatibility;
|
let oldValue = gCheckCompatibility;
|
||||||
try {
|
gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY, true);
|
||||||
gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY);
|
|
||||||
} catch(e) {
|
|
||||||
gCheckCompatibility = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.callManagerListeners("onCompatibilityModeChanged");
|
this.callManagerListeners("onCompatibilityModeChanged");
|
||||||
|
|
||||||
|
@ -1182,11 +1159,7 @@ var AddonManagerInternal = {
|
||||||
}
|
}
|
||||||
case PREF_EM_STRICT_COMPATIBILITY: {
|
case PREF_EM_STRICT_COMPATIBILITY: {
|
||||||
let oldValue = gStrictCompatibility;
|
let oldValue = gStrictCompatibility;
|
||||||
try {
|
gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
|
||||||
gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY);
|
|
||||||
} catch(e) {
|
|
||||||
gStrictCompatibility = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.callManagerListeners("onCompatibilityModeChanged");
|
this.callManagerListeners("onCompatibilityModeChanged");
|
||||||
|
|
||||||
|
@ -1197,11 +1170,7 @@ var AddonManagerInternal = {
|
||||||
}
|
}
|
||||||
case PREF_EM_CHECK_UPDATE_SECURITY: {
|
case PREF_EM_CHECK_UPDATE_SECURITY: {
|
||||||
let oldValue = gCheckUpdateSecurity;
|
let oldValue = gCheckUpdateSecurity;
|
||||||
try {
|
gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, true);
|
||||||
gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
|
|
||||||
} catch(e) {
|
|
||||||
gCheckUpdateSecurity = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.callManagerListeners("onCheckUpdateSecurityChanged");
|
this.callManagerListeners("onCheckUpdateSecurityChanged");
|
||||||
|
|
||||||
|
@ -1212,22 +1181,14 @@ var AddonManagerInternal = {
|
||||||
}
|
}
|
||||||
case PREF_EM_UPDATE_ENABLED: {
|
case PREF_EM_UPDATE_ENABLED: {
|
||||||
let oldValue = gUpdateEnabled;
|
let oldValue = gUpdateEnabled;
|
||||||
try {
|
gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED, true);
|
||||||
gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED);
|
|
||||||
} catch(e) {
|
|
||||||
gUpdateEnabled = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.callManagerListeners("onUpdateModeChanged");
|
this.callManagerListeners("onUpdateModeChanged");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PREF_EM_AUTOUPDATE_DEFAULT: {
|
case PREF_EM_AUTOUPDATE_DEFAULT: {
|
||||||
let oldValue = gAutoUpdateDefault;
|
let oldValue = gAutoUpdateDefault;
|
||||||
try {
|
gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT, true);
|
||||||
gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT);
|
|
||||||
} catch(e) {
|
|
||||||
gAutoUpdateDefault = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.callManagerListeners("onUpdateModeChanged");
|
this.callManagerListeners("onUpdateModeChanged");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -64,12 +64,7 @@ var PrefObserver = {
|
||||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||||
}
|
}
|
||||||
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
||||||
let debugLogEnabled = false;
|
let debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED, false);
|
||||||
try {
|
|
||||||
debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
if (debugLogEnabled) {
|
if (debugLogEnabled) {
|
||||||
parentLogger.level = Log.Level.Debug;
|
parentLogger.level = Log.Level.Debug;
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,13 +154,7 @@ this.GMPPrefs = {
|
||||||
get: function(aKey, aDefaultValue, aPlugin) {
|
get: function(aKey, aDefaultValue, aPlugin) {
|
||||||
if (aKey === this.KEY_APP_DISTRIBUTION ||
|
if (aKey === this.KEY_APP_DISTRIBUTION ||
|
||||||
aKey === this.KEY_APP_DISTRIBUTION_VERSION) {
|
aKey === this.KEY_APP_DISTRIBUTION_VERSION) {
|
||||||
let prefValue = "default";
|
return Services.prefs.getDefaultBranch(null).getCharPref(aKey, "default");
|
||||||
try {
|
|
||||||
prefValue = Services.prefs.getDefaultBranch(null).getCharPref(aKey);
|
|
||||||
} catch (e) {
|
|
||||||
// use default when pref not found
|
|
||||||
}
|
|
||||||
return prefValue;
|
|
||||||
}
|
}
|
||||||
return Preferences.get(this.getPrefKey(aKey, aPlugin), aDefaultValue);
|
return Preferences.get(this.getPrefKey(aKey, aPlugin), aDefaultValue);
|
||||||
},
|
},
|
||||||
|
|
|
@ -49,12 +49,7 @@ this.__defineGetter__("_prefs", function prefsGetter() {
|
||||||
|
|
||||||
this.__defineGetter__("_maxUsedThemes", function maxUsedThemesGetter() {
|
this.__defineGetter__("_maxUsedThemes", function maxUsedThemesGetter() {
|
||||||
delete this._maxUsedThemes;
|
delete this._maxUsedThemes;
|
||||||
try {
|
this._maxUsedThemes = _prefs.getIntPref("maxUsedThemes", DEFAULT_MAX_USED_THEMES_COUNT);
|
||||||
this._maxUsedThemes = _prefs.getIntPref("maxUsedThemes");
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
this._maxUsedThemes = DEFAULT_MAX_USED_THEMES_COUNT;
|
|
||||||
}
|
|
||||||
return this._maxUsedThemes;
|
return this._maxUsedThemes;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -719,12 +714,8 @@ var _previewTimerCallback = {
|
||||||
function _prefObserver(aSubject, aTopic, aData) {
|
function _prefObserver(aSubject, aTopic, aData) {
|
||||||
switch (aData) {
|
switch (aData) {
|
||||||
case "maxUsedThemes":
|
case "maxUsedThemes":
|
||||||
try {
|
_maxUsedThemes = _prefs.getIntPref(aData, DEFAULT_MAX_USED_THEMES_COUNT);
|
||||||
_maxUsedThemes = _prefs.getIntPref(aData);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
_maxUsedThemes = DEFAULT_MAX_USED_THEMES_COUNT;
|
|
||||||
}
|
|
||||||
// Update the theme list to remove any themes over the number we keep
|
// Update the theme list to remove any themes over the number we keep
|
||||||
_updateUsedThemes(LightweightThemeManager.usedThemes);
|
_updateUsedThemes(LightweightThemeManager.usedThemes);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -179,12 +179,7 @@ var PrefObserver = {
|
||||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||||
}
|
}
|
||||||
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
||||||
try {
|
gDebugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED, false);
|
||||||
gDebugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
gDebugLogEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -486,14 +486,7 @@ this.AddonRepository = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let preference = PREF_GETADDONS_CACHE_ENABLED;
|
let preference = PREF_GETADDONS_CACHE_ENABLED;
|
||||||
let enabled = false;
|
return Services.prefs.getBoolPref(preference, false);
|
||||||
try {
|
|
||||||
enabled = Services.prefs.getBoolPref(preference);
|
|
||||||
} catch(e) {
|
|
||||||
logger.warn("cacheEnabled: Couldn't get pref: " + preference);
|
|
||||||
}
|
|
||||||
|
|
||||||
return enabled;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// A cache of the add-ons stored in the database
|
// A cache of the add-ons stored in the database
|
||||||
|
@ -541,11 +534,7 @@ this.AddonRepository = {
|
||||||
|
|
||||||
metadataAge: function() {
|
metadataAge: function() {
|
||||||
let now = Math.round(Date.now() / 1000);
|
let now = Math.round(Date.now() / 1000);
|
||||||
|
let lastUpdate = Services.prefs.getIntPref(PREF_METADATA_LASTUPDATE, 0);
|
||||||
let lastUpdate = 0;
|
|
||||||
try {
|
|
||||||
lastUpdate = Services.prefs.getIntPref(PREF_METADATA_LASTUPDATE);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
// Handle clock jumps
|
// Handle clock jumps
|
||||||
if (now < lastUpdate) {
|
if (now < lastUpdate) {
|
||||||
|
@ -555,10 +544,8 @@ this.AddonRepository = {
|
||||||
},
|
},
|
||||||
|
|
||||||
isMetadataStale: function AddonRepo_isMetadataStale() {
|
isMetadataStale: function AddonRepo_isMetadataStale() {
|
||||||
let threshold = DEFAULT_METADATA_UPDATETHRESHOLD_SEC;
|
let threshold = Services.prefs.getIntPref(PREF_METADATA_UPDATETHRESHOLD_SEC,
|
||||||
try {
|
DEFAULT_METADATA_UPDATETHRESHOLD_SEC);
|
||||||
threshold = Services.prefs.getIntPref(PREF_METADATA_UPDATETHRESHOLD_SEC);
|
|
||||||
} catch (e) {}
|
|
||||||
return (this.metadataAge() > threshold);
|
return (this.metadataAge() > threshold);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1543,10 +1530,8 @@ this.AddonRepository = {
|
||||||
|
|
||||||
// Create url from preference, returning null if preference does not exist
|
// Create url from preference, returning null if preference does not exist
|
||||||
_formatURLPref: function AddonRepo_formatURLPref(aPreference, aSubstitutions) {
|
_formatURLPref: function AddonRepo_formatURLPref(aPreference, aSubstitutions) {
|
||||||
let url = null;
|
let url = Services.prefs.getCharPref(aPreference, "");
|
||||||
try {
|
if (!url) {
|
||||||
url = Services.prefs.getCharPref(aPreference);
|
|
||||||
} catch(e) {
|
|
||||||
logger.warn("_formatURLPref: Couldn't get pref: " + aPreference);
|
logger.warn("_formatURLPref: Couldn't get pref: " + aPreference);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1639,10 +1624,7 @@ var AddonDatabase = {
|
||||||
// Create a blank addons.json file
|
// Create a blank addons.json file
|
||||||
this._saveDBToDisk();
|
this._saveDBToDisk();
|
||||||
|
|
||||||
let dbSchema = 0;
|
let dbSchema = Services.prefs.getIntPref(PREF_GETADDONS_DB_SCHEMA, 0);
|
||||||
try {
|
|
||||||
dbSchema = Services.prefs.getIntPref(PREF_GETADDONS_DB_SCHEMA);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (dbSchema < DB_MIN_JSON_SCHEMA) {
|
if (dbSchema < DB_MIN_JSON_SCHEMA) {
|
||||||
let results = yield new Promise((resolve, reject) => {
|
let results = yield new Promise((resolve, reject) => {
|
||||||
|
|
|
@ -608,12 +608,7 @@ function UpdateParser(aId, aUpdateKey, aUrl, aObserver) {
|
||||||
this.observer = aObserver;
|
this.observer = aObserver;
|
||||||
this.url = aUrl;
|
this.url = aUrl;
|
||||||
|
|
||||||
let requireBuiltIn = true;
|
let requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, true);
|
||||||
try {
|
|
||||||
requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.debug("Requesting " + aUrl);
|
logger.debug("Requesting " + aUrl);
|
||||||
try {
|
try {
|
||||||
|
@ -651,12 +646,7 @@ UpdateParser.prototype = {
|
||||||
this.request = null;
|
this.request = null;
|
||||||
this._doneAt = new Error("place holder");
|
this._doneAt = new Error("place holder");
|
||||||
|
|
||||||
let requireBuiltIn = true;
|
let requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS, true);
|
||||||
try {
|
|
||||||
requireBuiltIn = Services.prefs.getBoolPref(PREF_UPDATE_REQUIREBUILTINCERTS);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
CertUtils.checkCert(request.channel, !requireBuiltIn);
|
CertUtils.checkCert(request.channel, !requireBuiltIn);
|
||||||
|
|
|
@ -1410,10 +1410,7 @@ this.XPIDatabase = {
|
||||||
// when a lightweight theme is applied for example)
|
// when a lightweight theme is applied for example)
|
||||||
text += "\r\n[ThemeDirs]\r\n";
|
text += "\r\n[ThemeDirs]\r\n";
|
||||||
|
|
||||||
let dssEnabled = false;
|
let dssEnabled = Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED, false);
|
||||||
try {
|
|
||||||
dssEnabled = Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
let themes = [];
|
let themes = [];
|
||||||
if (dssEnabled) {
|
if (dssEnabled) {
|
||||||
|
|
|
@ -156,12 +156,7 @@ var PrefObserver = {
|
||||||
Services.obs.removeObserver(this, "xpcom-shutdown");
|
Services.obs.removeObserver(this, "xpcom-shutdown");
|
||||||
}
|
}
|
||||||
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
|
||||||
let debugLogEnabled = false;
|
let debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED, false);
|
||||||
try {
|
|
||||||
debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
}
|
|
||||||
if (debugLogEnabled) {
|
if (debugLogEnabled) {
|
||||||
parentLogger.level = Log.Level.Debug;
|
parentLogger.level = Log.Level.Debug;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2449,10 +2449,7 @@ var gSearchView = {
|
||||||
finishSearch();
|
finishSearch();
|
||||||
});
|
});
|
||||||
|
|
||||||
var maxRemoteResults = 0;
|
var maxRemoteResults = Services.prefs.getIntPref(PREF_MAXRESULTS, 0);
|
||||||
try {
|
|
||||||
maxRemoteResults = Services.prefs.getIntPref(PREF_MAXRESULTS);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (maxRemoteResults <= 0) {
|
if (maxRemoteResults <= 0) {
|
||||||
finishSearch(0);
|
finishSearch(0);
|
||||||
|
|
|
@ -121,25 +121,16 @@ function convertHTMLToPlainText(html) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAddonsToCache(aIds, aCallback) {
|
function getAddonsToCache(aIds, aCallback) {
|
||||||
try {
|
var types = Services.prefs.getCharPref(PREF_GETADDONS_CACHE_TYPES, DEFAULT_CACHE_TYPES);
|
||||||
var types = Services.prefs.getCharPref(PREF_GETADDONS_CACHE_TYPES);
|
|
||||||
}
|
|
||||||
catch (e) { }
|
|
||||||
if (!types)
|
|
||||||
types = DEFAULT_CACHE_TYPES;
|
|
||||||
|
|
||||||
types = types.split(",");
|
types = types.split(",");
|
||||||
|
|
||||||
AddonManager.getAddonsByIDs(aIds, function(aAddons) {
|
AddonManager.getAddonsByIDs(aIds, function(aAddons) {
|
||||||
let enabledIds = [];
|
let enabledIds = [];
|
||||||
|
var preference;
|
||||||
for (var i = 0; i < aIds.length; i++) {
|
for (var i = 0; i < aIds.length; i++) {
|
||||||
var preference = PREF_GETADDONS_CACHE_ID_ENABLED.replace("%ID%", aIds[i]);
|
preference = Services.prefs.getBoolPref(PREF_GETADDONS_CACHE_ID_ENABLED.replace("%ID%", aIds[i]), false);
|
||||||
try {
|
if (!preference)
|
||||||
if (!Services.prefs.getBoolPref(preference))
|
continue;
|
||||||
continue;
|
|
||||||
} catch (e) {
|
|
||||||
// If the preference doesn't exist caching is enabled by default
|
|
||||||
}
|
|
||||||
|
|
||||||
// The add-ons manager may not know about this ID yet if it is a pending
|
// The add-ons manager may not know about this ID yet if it is a pending
|
||||||
// install. In that case we'll just cache it regardless
|
// install. In that case we'll just cache it regardless
|
||||||
|
@ -477,15 +468,7 @@ this.AddonRepository = {
|
||||||
* Whether caching is currently enabled
|
* Whether caching is currently enabled
|
||||||
*/
|
*/
|
||||||
get cacheEnabled() {
|
get cacheEnabled() {
|
||||||
let preference = PREF_GETADDONS_CACHE_ENABLED;
|
return Services.prefs.getBoolPref(PREF_GETADDONS_CACHE_ENABLED, false);
|
||||||
let enabled = false;
|
|
||||||
try {
|
|
||||||
enabled = Services.prefs.getBoolPref(preference);
|
|
||||||
} catch (e) {
|
|
||||||
logger.warn("cacheEnabled: Couldn't get pref: " + preference);
|
|
||||||
}
|
|
||||||
|
|
||||||
return enabled;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// A cache of the add-ons stored in the database
|
// A cache of the add-ons stored in the database
|
||||||
|
@ -534,10 +517,7 @@ this.AddonRepository = {
|
||||||
metadataAge: function() {
|
metadataAge: function() {
|
||||||
let now = Math.round(Date.now() / 1000);
|
let now = Math.round(Date.now() / 1000);
|
||||||
|
|
||||||
let lastUpdate = 0;
|
let lastUpdate = Services.prefs.getIntPref(PREF_METADATA_LASTUPDATE, 0);
|
||||||
try {
|
|
||||||
lastUpdate = Services.prefs.getIntPref(PREF_METADATA_LASTUPDATE);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
// Handle clock jumps
|
// Handle clock jumps
|
||||||
if (now < lastUpdate) {
|
if (now < lastUpdate) {
|
||||||
|
@ -547,10 +527,8 @@ this.AddonRepository = {
|
||||||
},
|
},
|
||||||
|
|
||||||
isMetadataStale: function() {
|
isMetadataStale: function() {
|
||||||
let threshold = DEFAULT_METADATA_UPDATETHRESHOLD_SEC;
|
let threshold = Services.prefs.getIntPref(PREF_METADATA_UPDATETHRESHOLD_SEC,
|
||||||
try {
|
DEFAULT_METADATA_UPDATETHRESHOLD_SEC);
|
||||||
threshold = Services.prefs.getIntPref(PREF_METADATA_UPDATETHRESHOLD_SEC);
|
|
||||||
} catch (e) {}
|
|
||||||
return (this.metadataAge() > threshold);
|
return (this.metadataAge() > threshold);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1507,10 +1485,8 @@ this.AddonRepository = {
|
||||||
|
|
||||||
// Create url from preference, returning null if preference does not exist
|
// Create url from preference, returning null if preference does not exist
|
||||||
_formatURLPref: function(aPreference, aSubstitutions) {
|
_formatURLPref: function(aPreference, aSubstitutions) {
|
||||||
let url = null;
|
let url = Services.prefs.getCharPref(aPreference, "");
|
||||||
try {
|
if (!url) {
|
||||||
url = Services.prefs.getCharPref(aPreference);
|
|
||||||
} catch (e) {
|
|
||||||
logger.warn("_formatURLPref: Couldn't get pref: " + aPreference);
|
logger.warn("_formatURLPref: Couldn't get pref: " + aPreference);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1604,10 +1580,7 @@ var AddonDatabase = {
|
||||||
// Create a blank addons.json file
|
// Create a blank addons.json file
|
||||||
this._saveDBToDisk();
|
this._saveDBToDisk();
|
||||||
|
|
||||||
let dbSchema = 0;
|
let dbSchema = Services.prefs.getIntPref(PREF_GETADDONS_DB_SCHEMA, 0);
|
||||||
try {
|
|
||||||
dbSchema = Services.prefs.getIntPref(PREF_GETADDONS_DB_SCHEMA);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
if (dbSchema < DB_MIN_JSON_SCHEMA) {
|
if (dbSchema < DB_MIN_JSON_SCHEMA) {
|
||||||
let results = yield new Promise((resolve, reject) => {
|
let results = yield new Promise((resolve, reject) => {
|
||||||
|
|
|
@ -1468,10 +1468,7 @@ this.XPIDatabase = {
|
||||||
// when a lightweight theme is applied for example)
|
// when a lightweight theme is applied for example)
|
||||||
text += "\r\n[ThemeDirs]\r\n";
|
text += "\r\n[ThemeDirs]\r\n";
|
||||||
|
|
||||||
let dssEnabled = false;
|
let dssEnabled = Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED, false);
|
||||||
try {
|
|
||||||
dssEnabled = Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED);
|
|
||||||
} catch (e) {}
|
|
||||||
|
|
||||||
let themes = [];
|
let themes = [];
|
||||||
if (dssEnabled) {
|
if (dssEnabled) {
|
||||||
|
|
|
@ -352,17 +352,11 @@ HandlerService.prototype = {
|
||||||
var prefSvc = Cc["@mozilla.org/preferences-service;1"].
|
var prefSvc = Cc["@mozilla.org/preferences-service;1"].
|
||||||
getService(Ci.nsIPrefService);
|
getService(Ci.nsIPrefService);
|
||||||
var prefBranch = prefSvc.getBranch("network.protocol-handler.");
|
var prefBranch = prefSvc.getBranch("network.protocol-handler.");
|
||||||
try {
|
// If neither of the prefs exists, be paranoid and prompt.
|
||||||
alwaysAsk = prefBranch.getBoolPref("warn-external." + type);
|
alwaysAsk =
|
||||||
} catch (e) {
|
prefBranch.getBoolPref("warn-external." + type,
|
||||||
// will throw if pref didn't exist.
|
prefBranch.getBoolPref("warn-external-default",
|
||||||
try {
|
true));
|
||||||
alwaysAsk = prefBranch.getBoolPref("warn-external-default");
|
|
||||||
} catch (e) {
|
|
||||||
// Nothing to tell us what to do, so be paranoid and prompt.
|
|
||||||
alwaysAsk = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
aHandlerInfo.alwaysAskBeforeHandling = alwaysAsk;
|
aHandlerInfo.alwaysAskBeforeHandling = alwaysAsk;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue