From 95fd7df502b59d8989903d1c3f74b1aaf2e9ec68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Fri, 2 Oct 2009 18:22:53 +0200 Subject: [PATCH] Bug 520143 - don't try/catch when reading plugins.hide_infobar_for_outdated_plugin and plugins.hide_infobar_for_missing_plugin, since they have a default value. r=dtownsend --- browser/base/content/browser.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 1e201508471..3486ba7b65d 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -5910,10 +5910,8 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ let hideBarPrefName = aEvent.type == "PluginOutdated" ? "plugins.hide_infobar_for_outdated_plugin" : "plugins.hide_infobar_for_missing_plugin"; - try { - if (gPrefService.getBoolPref(hideBarPrefName)) - return; - } catch (ex) {} // if the pref is missing, treat it as false, which shows the infobar + if (gPrefService.getBoolPref(hideBarPrefName)) + return; var browser = gBrowser.getBrowserForDocument(aEvent.target.ownerDocument .defaultView.top.document); @@ -5935,7 +5933,7 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ var blockedNotification = notificationBox.getNotificationWithValue("blocked-plugins"); var missingNotification = notificationBox.getNotificationWithValue("missing-plugins"); var priority = notificationBox.PRIORITY_WARNING_MEDIUM; - + function showBlocklistInfo() { var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]. getService(Ci.nsIURLFormatter); @@ -5943,7 +5941,7 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ gBrowser.loadOneTab(url, {inBackground: false}); return true; } - + function showOutdatedPluginsInfo() { var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"]. getService(Ci.nsIURLFormatter); @@ -5951,7 +5949,7 @@ missingPluginInstaller.prototype.newMissingPlugin = function(aEvent){ gBrowser.loadOneTab(url, {inBackground: false}); return true; } - + function showPluginsMissing() { // get the urls of missing plugins var missingPluginsArray = gBrowser.selectedBrowser.missingPlugins;