Bug 847072 - Regex test for Java plugin name, output "Java" instead of whole version string. r=mconley
authorMike Quested <bruteforks@gmail.com>
Wed, 01 Oct 2014 04:09:00 +0200
changeset 208213 ca5765dddaed842193860149bc5b1f05a7a52a66
parent 208212 7c97034feb78353db2766b91c87554557f09ee7c
child 208214 0a308311d9a7dd6bbbf0be74cd2956cd90e8016b
push id27580
push userkwierso@gmail.com
push dateWed, 01 Oct 2014 23:26:55 +0000
treeherderautoland@af6c928893c0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs847072
milestone35.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 847072 - Regex test for Java plugin name, output "Java" instead of whole version string. r=mconley
browser/modules/PluginContent.jsm
--- a/browser/modules/PluginContent.jsm
+++ b/browser/modules/PluginContent.jsm
@@ -141,16 +141,19 @@ PluginContent.prototype = {
              blocklistState: blocklistState,
            };
   },
 
   // Map the plugin's name to a filtered version more suitable for user UI.
   makeNicePluginName : function (aName) {
     if (aName == "Shockwave Flash")
       return "Adobe Flash";
+    // Regex checks if aName begins with "Java" + non-letter char
+    if (/^Java\W/.exec(aName))
+      return "Java";
 
     // Clean up the plugin name by stripping off parenthetical clauses,
     // trailing version numbers or "plugin".
     // EG, "Foo Bar (Linux) Plugin 1.23_02" --> "Foo Bar"
     // Do this by first stripping the numbers, etc. off the end, and then
     // removing "Plugin" (and then trimming to get rid of any whitespace).
     // (Otherwise, something like "Java(TM) Plug-in 1.7.0_07" gets mangled)
     let newName = aName.replace(/\(.*?\)/g, "").