Bug 831533 - Show the enabled/disabled/blocklisted state of plugins in about:plugins. r=bsmedberg
authorSunny <indiasuny000@gmail.com>
Sat, 26 Jan 2013 12:59:31 -0500
changeset 119964 698a863a2771da8277b23797b89c9be24379ad4e
parent 119963 eb2f0c1fffc2bfd7f1a653b7ae74f8086f06a1d2
child 119965 51d02de3f48e9421d7af200220a9fce05d06a142
push id21974
push userryanvm@gmail.com
push dateSat, 26 Jan 2013 18:00:36 +0000
treeherdermozilla-inbound@51d02de3f48e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs831533
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 831533 - Show the enabled/disabled/blocklisted state of plugins in about:plugins. r=bsmedberg
dom/locales/en-US/chrome/plugins.properties
toolkit/content/plugins.html
--- a/dom/locales/en-US/chrome/plugins.properties
+++ b/dom/locales/en-US/chrome/plugins.properties
@@ -9,11 +9,12 @@
 title_label=About Plugins
 enabledplugins_label=Enabled plugins
 nopluginsareenabled_label=No enabled plugins found
 findmore_label=Find more information about browser plugins at
 findpluginupdates_label=Find updates for installed plugins at
 installhelp_label=Help for installing plugins is available from
 file_label=File:
 version_label=Version:
+state_label=State:
 mimetype_label=MIME Type
 description_label=Description
 suffixes_label=Suffixes
--- a/toolkit/content/plugins.html
+++ b/toolkit/content/plugins.html
@@ -6,17 +6,18 @@
 
 <html>
 <head>
 <script type="application/javascript">
   "use strict";
 
   Components.utils.import("resource://gre/modules/AddonManager.jsm");
 
-  var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Components.interfaces.nsIStringBundleService);
+  var Ci = Components.interfaces;
+  var strBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService);
   var pluginsbundle = strBundleService.createBundle("chrome://global/locale/plugins.properties");
   var regionbundle = strBundleService.createBundle("chrome://global-region/locale/region.properties");
 
   document.writeln("<title>" + pluginsbundle.GetStringFromName("title_label") + "<\/title>");
 </script>
 <link rel="stylesheet" type="text/css" href="chrome://global/content/plugins.css">
 <link rel="stylesheet" type="text/css" href="chrome://global/skin/plugins.css">
 </head>
@@ -107,19 +108,28 @@
     // ... "plugindoc.mozdev.org"
     var plugindoc = document.createElement("a");
     plugindoc.setAttribute("href", regionbundle.GetStringFromName("plugindoc_url"));
     plugindoc.appendChild(document.createTextNode(regionbundle.GetStringFromName("plugindoc_label")));
     installhelp.appendChild(plugindoc);
 
     fragment.appendChild(document.createElement("hr"));
 
+    var stateNames = {};
+    ["STATE_SOFTBLOCKED",
+     "STATE_BLOCKED",
+     "STATE_OUTDATED",
+     "STATE_VULNERABLE_UPDATE_AVAILABLE",
+     "STATE_VULNERABLE_NO_UPDATE"].forEach(function(label) {
+      stateNames[Ci.nsIBlocklistService[label]] = label;  
+    });
+    
     for (var i = 0; i < aPlugins.length; i++) {
       var plugin = aPlugins[i];
-      if (plugin && plugin.isActive) {
+      if (plugin) {
         // "Shockwave Flash"
         var plugname = document.createElement("h2");
         plugname.setAttribute("class", "plugname");
         plugname.appendChild(document.createTextNode(plugin.name));
         fragment.appendChild(plugname);
 
         var dl = document.createElement("dl");
         fragment.appendChild(dl);
@@ -137,16 +147,29 @@
         var versionDd = document.createElement("dd");
         var version = document.createElement("span");
         version.setAttribute("class", "label");
         version.appendChild(document.createTextNode(pluginsbundle.GetStringFromName("version_label") + " "));
         versionDd.appendChild(version);
         versionDd.appendChild(document.createTextNode(plugin.version));
         dl.appendChild(versionDd);
 
+        // "State: "
+        var stateDd = document.createElement("dd");
+        var state = document.createElement("span");
+        state.setAttribute("label", "state");
+        state.appendChild(document.createTextNode(pluginsbundle.GetStringFromName("state_label") + " "));
+        stateDd.appendChild(state);
+        status = plugin.isActive ? "Enabled" : "Disabled";
+        if (plugin.blocklistState in stateNames) {
+          status += " (" + stateNames[plugin.blocklistState] + ")";
+        }
+        stateDd.appendChild(document.createTextNode(status));
+        dl.appendChild(stateDd);
+
         // Plugin Description
         var descDd = document.createElement("dd");
         descDd.appendChild(document.createTextNode(plugin.description));
         dl.appendChild(descDd);
 
         // MIME Type table
         var mimetypeTable = document.createElement("table");
         mimetypeTable.setAttribute("border", "1");