Bug 922107 - Add pref to hide the "missing plugin" notifications. r=jaws
authorWillian Gustavo Veiga <contact@willianveiga.com>
Tue, 25 Feb 2014 11:53:02 +0100
changeset 170688 45dda38512245134d260fe799a59aeeb668749c0
parent 170687 6d1aabc16a1b4e77e76e858d96a81db34df1f75c
child 170689 b43455151bcab60d9ea9e9bbc5ecc1751bff6902
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersjaws
bugs922107
milestone30.0a1
Bug 922107 - Add pref to hide the "missing plugin" notifications. r=jaws
browser/app/profile/firefox.js
browser/base/content/browser-plugins.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -652,16 +652,18 @@ pref("pfs.datasource.url", "https://pfs.
 pref("plugins.hide_infobar_for_blocked_plugin", false);
 pref("plugins.hide_infobar_for_outdated_plugin", false);
 
 pref("plugins.update.url", "https://www.mozilla.org/%LOCALE%/plugincheck/");
 pref("plugins.update.notifyUser", false);
 
 pref("plugins.click_to_play", true);
 
+pref("plugins.hideMissingPluginsNotification", false);
+
 #ifdef RELEASE_BUILD
 // For now, plugins other than Java and Flash are enabled in beta/release
 // and click-to-activate in earlier channels.
 pref("plugin.default.state", 2);
 #else
 pref("plugin.default.state", 1);
 #endif
 
--- a/browser/base/content/browser-plugins.js
+++ b/browser/base/content/browser-plugins.js
@@ -1,15 +1,16 @@
 # -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 var gPluginHandler = {
   PREF_NOTIFY_MISSING_FLASH: "plugins.notifyMissingFlash",
+  PREF_HIDE_MISSING_PLUGINS_NOTIFICATION: "plugins.hideMissingPluginsNotification",
   PREF_SESSION_PERSIST_MINUTES: "plugin.sessionPermissionNow.intervalInMinutes",
   PREF_PERSISTENT_DAYS: "plugin.persistentPermissionAlways.intervalInDays",
 
   getPluginUI: function (plugin, anonid) {
     return plugin.ownerDocument.
            getAnonymousElementByAttribute(plugin, "anonid", anonid);
   },
 
@@ -503,16 +504,22 @@ var gPluginHandler = {
   },
 
   // Callback for user clicking the help icon
   openHelpPage: function () {
     openHelpLink("plugin-crashed", false);
   },
 
   showInstallNotification: function (aPlugin) {
+    let hideMissingPluginsNotification =
+      Services.prefs.getBoolPref(this.PREF_HIDE_MISSING_PLUGINS_NOTIFICATION);
+    if (hideMissingPluginsNotification) {
+      return false;
+    }
+
     let browser = gBrowser.getBrowserForDocument(aPlugin.ownerDocument
                                                         .defaultView.top.document);
     if (!browser.missingPlugins)
       browser.missingPlugins = new Map();
 
     let pluginInfo = this._getPluginInfo(aPlugin);
     browser.missingPlugins.set(pluginInfo.mimetype, pluginInfo);