From 7591326915a100b54ca17ad6fedb391645bac6b5 Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Mon, 8 Apr 2019 19:58:00 -0400 Subject: Issue #991 Part 2: Basilisk --- .../basilisk/base/content/aboutaccounts/aboutaccounts.js | 9 ++------- application/basilisk/base/content/browser-syncui.js | 10 ++-------- application/basilisk/base/content/browser.js | 10 ++-------- application/basilisk/base/content/sync/aboutSyncTabs.js | 8 +------- application/basilisk/base/content/tabbrowser.xml | 12 ++---------- 5 files changed, 9 insertions(+), 40 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/aboutaccounts/aboutaccounts.js b/application/basilisk/base/content/aboutaccounts/aboutaccounts.js index a05c1ea75..f03029b1d 100644 --- a/application/basilisk/base/content/aboutaccounts/aboutaccounts.js +++ b/application/basilisk/base/content/aboutaccounts/aboutaccounts.js @@ -450,14 +450,9 @@ function migrateToDevEdition(urlParams) { try { defaultProfilePath = window.getDefaultProfilePath(); } catch (e) {} // no default profile. - let migrateSyncCreds = false; - if (defaultProfilePath) { - try { - migrateSyncCreds = Services.prefs.getBoolPref("identity.fxaccounts.migrateToDevEdition"); - } catch (e) {} - } + let migrateSyncCreds = Services.prefs.getBoolPref("identity.fxaccounts.migrateToDevEdition", false); - if (!migrateSyncCreds) { + if (!defaultProfilePath || !migrateSyncCreds) { return Promise.resolve(false); } diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js index 3a57140f2..7a80be87e 100644 --- a/application/basilisk/base/content/browser-syncui.js +++ b/application/basilisk/base/content/browser-syncui.js @@ -106,10 +106,7 @@ var gSyncUI = { }); } // We are using legacy sync - check that. - let firstSync = ""; - try { - firstSync = Services.prefs.getCharPref("services.sync.firstSync"); - } catch (e) { } + let firstSync = Services.prefs.getCharPref("services.sync.firstSync", ""); return Promise.resolve(Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED || firstSync == "notReady"); @@ -349,10 +346,7 @@ var gSyncUI = { */ maybeMoveSyncedTabsButton() { const prefName = "browser.migrated-sync-button"; - let migrated = false; - try { - migrated = Services.prefs.getBoolPref(prefName); - } catch (_) {} + let migrated = Services.prefs.getBoolPref(prefName, false); if (migrated) { return; } diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index ddbe11a9d..7e8f7d821 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -2579,15 +2579,9 @@ var gMenuButtonUpdateBadge = { cancelObserverRegistered: false, init: function () { - try { - this.enabled = Services.prefs.getBoolPref("app.update.badge"); - } catch (e) {} + this.enabled = Services.prefs.getBoolPref("app.update.badge", false); if (this.enabled) { - try { - this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime"); - } catch (e) { - this.badgeWaitTime = 345600; // 4 days - } + this.badgeWaitTime = Services.prefs.getIntPref("app.update.badgeWaitTime", 345600); // 4 days Services.obs.addObserver(this, "update-staged", false); Services.obs.addObserver(this, "update-downloaded", false); } diff --git a/application/basilisk/base/content/sync/aboutSyncTabs.js b/application/basilisk/base/content/sync/aboutSyncTabs.js index f4bb607ea..69ec71e55 100644 --- a/application/basilisk/base/content/sync/aboutSyncTabs.js +++ b/application/basilisk/base/content/sync/aboutSyncTabs.js @@ -306,13 +306,7 @@ var RemoteTabViewer = { _refetchTabs: function (force) { if (!force) { // Don't bother refetching tabs if we already did so recently - let lastFetch = 0; - try { - lastFetch = Services.prefs.getIntPref("services.sync.lastTabFetch"); - } - catch (e) { - /* Just use the default value of 0 */ - } + lastFetch = Services.prefs.getIntPref("services.sync.lastTabFetch", 0); let now = Math.floor(Date.now() / 1000); if (now - lastFetch < 30) { diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml index c2f02512d..0e819a3ed 100644 --- a/application/basilisk/base/content/tabbrowser.xml +++ b/application/basilisk/base/content/tabbrowser.xml @@ -4135,11 +4135,7 @@ return true; if (this._logInit) return this._shouldLog; - let result = false; - try { - result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming"); - } catch (ex) { - } + let result = Services.prefs.getBoolPref("browser.tabs.remote.logSwitchTiming", false); this._shouldLog = result; this._logInit = true; return this._shouldLog; @@ -5208,11 +5204,7 @@ window.addEventListener("resize", this, false); window.addEventListener("load", this, false); - try { - this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled"); - } catch (ex) { - this._tabAnimationLoggingEnabled = false; - } + this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false); this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled"); ]]> -- cgit v1.2.3