diff options
author | Ascrod <32915892+Ascrod@users.noreply.github.com> | 2019-04-08 18:12:40 -0400 |
---|---|---|
committer | Ascrod <32915892+Ascrod@users.noreply.github.com> | 2019-04-13 11:37:45 -0400 |
commit | 9a37ab727e68f44e26e04b18f2cab40a0ac4fdb5 (patch) | |
tree | f2f676dbca9e8beb16895e97d733bc9de70ecd07 | |
parent | 7d1126fad325e889559b1f9113cbbb17d49842fa (diff) | |
download | UXP-9a37ab727e68f44e26e04b18f2cab40a0ac4fdb5.tar UXP-9a37ab727e68f44e26e04b18f2cab40a0ac4fdb5.tar.gz UXP-9a37ab727e68f44e26e04b18f2cab40a0ac4fdb5.tar.lz UXP-9a37ab727e68f44e26e04b18f2cab40a0ac4fdb5.tar.xz UXP-9a37ab727e68f44e26e04b18f2cab40a0ac4fdb5.zip |
Issue #991 Part 1: Pale Moon
7 files changed, 16 insertions, 73 deletions
diff --git a/application/palemoon/base/content/browser-syncui.js b/application/palemoon/base/content/browser-syncui.js index 67056e221..6fad03cdd 100644 --- a/application/palemoon/base/content/browser-syncui.js +++ b/application/palemoon/base/content/browser-syncui.js @@ -83,10 +83,7 @@ var gSyncUI = { _wasDelayed: false, _needsSetup: function SUI__needsSetup() { - let firstSync = ""; - try { - firstSync = Services.prefs.getCharPref("services.sync.firstSync"); - } catch (e) { } + let firstSync = Services.prefs.getCharPref("services.sync.firstSync", ""); return Weave.Status.checkSetup() == Weave.CLIENT_NOT_CONFIGURED || firstSync == "notReady"; }, @@ -285,11 +282,7 @@ var gSyncUI = { if (!syncButton) return; - let lastSync; - try { - lastSync = Services.prefs.getCharPref("services.sync.lastSync"); - } - catch (e) { }; + let lastSync = Services.prefs.getCharPref("services.sync.lastSync"); if (!lastSync || this._needsSetup()) { syncButton.removeAttribute("tooltiptext"); return; diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index 868179b5d..d9366f488 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -3628,11 +3628,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"); ]]> </constructor> diff --git a/application/palemoon/components/distribution.js b/application/palemoon/components/distribution.js index d3300604e..121e55b1b 100644 --- a/application/palemoon/components/distribution.js +++ b/application/palemoon/components/distribution.js @@ -38,13 +38,7 @@ DistributionCustomizer.prototype = { }, get _locale() { - let locale; - try { - locale = this._prefs.getCharPref("general.useragent.locale"); - } - catch (e) { - locale = "en-US"; - } + let locale = this._prefs.getCharPref("general.useragent.locale", "en-US"); this.__defineGetter__("_locale", function() locale); return this._locale; }, @@ -221,11 +215,7 @@ DistributionCustomizer.prototype = { this._ini.getString("Global", "id") + ".bookmarksProcessed"; } - let bmProcessed = false; - try { - bmProcessed = this._prefs.getBoolPref(bmProcessedPref); - } - catch (e) {} + let bmProcessed = this._prefs.getBoolPref(bmProcessedPref, false); if (!bmProcessed) { if (sections["BookmarksMenu"]) diff --git a/application/palemoon/components/feeds/FeedWriter.js b/application/palemoon/components/feeds/FeedWriter.js index d704835bb..facde5815 100644 --- a/application/palemoon/components/feeds/FeedWriter.js +++ b/application/palemoon/components/feeds/FeedWriter.js @@ -18,12 +18,7 @@ function LOG(str) { var prefB = Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); - var shouldLog = false; - try { - shouldLog = prefB.getBoolPref("feeds.log"); - } - catch (ex) { - } + var shouldLog = prefB.getBoolPref("feeds.log", false); if (shouldLog) dump("*** Feeds: " + str + "\n"); @@ -874,11 +869,7 @@ FeedWriter.prototype = { Cc["@mozilla.org/preferences-service;1"]. getService(Ci.nsIPrefBranch); - var handler = "bookmarks"; - try { - handler = prefs.getCharPref(getPrefReaderForType(feedType)); - } - catch (ex) { } + var handler = prefs.getCharPref(getPrefReaderForType(feedType), "bookmarks"); switch (handler) { case "web": { @@ -1076,11 +1067,7 @@ FeedWriter.prototype = { .addEventListener("command", this, false); // first-run ui - var showFirstRunUI = true; - try { - showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI); - } - catch (ex) { } + var showFirstRunUI = prefs.getBoolPref(PREF_SHOW_FIRST_RUN_UI, true); if (showFirstRunUI) { var textfeedinfo1, textfeedinfo2; switch (feedType) { diff --git a/application/palemoon/components/feeds/WebContentConverter.js b/application/palemoon/components/feeds/WebContentConverter.js index 41679b028..42e2edee0 100644 --- a/application/palemoon/components/feeds/WebContentConverter.js +++ b/application/palemoon/components/feeds/WebContentConverter.js @@ -436,13 +436,8 @@ WebContentConverterRegistrar.prototype = { // check if it is in the black list var pb = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch); - var allowed; - try { - allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol); - } - catch (e) { - allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default"); - } + var allowed = pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "." + aProtocol, + pb.getBoolPref(PREF_HANDLER_EXTERNAL_PREFIX + "-default")); if (!allowed) { // XXX this should be a "security exception" according to spec throw("Not allowed to register a protocol handler for " + aProtocol); diff --git a/application/palemoon/components/nsBrowserContentHandler.js b/application/palemoon/components/nsBrowserContentHandler.js index 6a75b40f2..e7f1414c2 100644 --- a/application/palemoon/components/nsBrowserContentHandler.js +++ b/application/palemoon/components/nsBrowserContentHandler.js @@ -100,20 +100,14 @@ const OVERRIDE_NEW_BUILD_ID = 3; * OVERRIDE_NONE otherwise. */ function needHomepageOverride(prefb) { - var savedmstone = null; - try { - savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone"); - } catch (e) {} + var savedmstone = prefb.getCharPref("browser.startup.homepage_override.mstone", ""); if (savedmstone == "ignore") return OVERRIDE_NONE; var mstone = Services.appinfo.platformVersion; - var savedBuildID = null; - try { - savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID"); - } catch (e) {} + var savedBuildID = prefb.getCharPref("browser.startup.homepage_override.buildID", ""); var buildID = Services.appinfo.platformBuildID; @@ -550,10 +544,7 @@ nsBrowserContentHandler.prototype = { // 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 // upgrading from. - let old_mstone = "unknown"; - try { - old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone"); - } catch (ex) {} + let old_mstone = Services.prefs.getCharPref("browser.startup.homepage_override.mstone", "unknown"); let override = needHomepageOverride(prefb); if (override != OVERRIDE_NONE) { switch (override) { diff --git a/application/palemoon/components/nsBrowserGlue.js b/application/palemoon/components/nsBrowserGlue.js index ad48dab29..01a133833 100644 --- a/application/palemoon/components/nsBrowserGlue.js +++ b/application/palemoon/components/nsBrowserGlue.js @@ -990,14 +990,8 @@ BrowserGlue.prototype = { // An import operation is about to run. // Don't try to recreate smart bookmarks if autoExportHTML is true or // smart bookmarks are disabled. - var autoExportHTML = false; - try { - autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML"); - } catch(ex) {} - var smartBookmarksVersion = 0; - try { - smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion"); - } catch(ex) {} + var autoExportHTML = Services.prefs.getBoolPref("browser.bookmarks.autoExportHTML", false); + var smartBookmarksVersion = Services.prefs.getIntPref("browser.places.smartBookmarksVersion", 0); if (!autoExportHTML && smartBookmarksVersion != -1) Services.prefs.setIntPref("browser.places.smartBookmarksVersion", 0); @@ -1556,10 +1550,7 @@ BrowserGlue.prototype = { const MAX_RESULTS = 10; // Get current smart bookmarks version. If not set, create them. - let smartBookmarksCurrentVersion = 0; - try { - smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF); - } catch(ex) {} + let smartBookmarksCurrentVersion = Services.prefs.getIntPref(SMART_BOOKMARKS_PREF, 0); // If version is current or smart bookmarks are disabled, just bail out. if (smartBookmarksCurrentVersion == -1 || |