Closed
Bug 544597
Opened 14 years ago
Closed 14 years ago
Remap plugin names to a more readable form for plugin-crashed UI
Categories
(Core Graveyard :: Plug-ins, defect)
Core Graveyard
Plug-ins
Tracking
(status1.9.2 .4-fixed)
RESOLVED
FIXED
mozilla1.9.3a5
Tracking | Status | |
---|---|---|
status1.9.2 | --- | .4-fixed |
People
(Reporter: Dolske, Assigned: Dolske)
References
Details
Attachments
(2 files, 3 obsolete files)
10.09 KB,
patch
|
Details | Diff | Splinter Review | |
10.30 KB,
patch
|
beltzner
:
approval1.9.2.4+
|
Details | Diff | Splinter Review |
The plugin-crashed UI from bug displays the name of the plugin that crashed. Unfortunately, the names provided by the plugins are not always ideal, because they've typically been buried in about:plugins or the EM UI, where users don't encounter them often. We'd like to remap these names to nicer versions. EG, "Shockwave Flash" --> "Adobe Flash", "QuickTime Plug-in 7.6.3" --> "Quicktime", etc. I'd like at least clean up the names for the Top-N plugins, but I think the folks who did the plugin update page may have a more exhaustive list so I might just steal that.
Assignee | ||
Comment 1•14 years ago
|
||
Looks like we should be able to steal some of the work done for PFS2... http://svn.mozilla.org/projects/pfs2/trunk/plugins-info/
Comment 2•14 years ago
|
||
I'm not sure, should we expose the readable names to l10n?
Assignee | ||
Comment 3•14 years ago
|
||
I don't think the names need to be exposed to l10n, afaik plugins already don't localize these strings. And if a few did, things would be no worse than the current UI.
Assignee | ||
Comment 4•14 years ago
|
||
Assignee: nobody → dolske
Attachment #433473 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•14 years ago
|
Attachment #433473 -
Flags: review?(jst)
Assignee | ||
Comment 5•14 years ago
|
||
Comment on attachment 433473 [details] [diff] [review] Patch v.1 jst for the rs to the /content parts (which is basically just cut'n'paste of what's already there).
Assignee | ||
Comment 6•14 years ago
|
||
To build up the list of names, I basically looked at the plugins that were installed on the systems I had at hand, and then Googled around for text and screenshots related to about:plugins. If we want to make this list more exhaustive (and I think we probably *don't*), http://plugindoc.mozdev.org/ would be a source for a whole pile. Would also be nice if the Plugin Check page (http://www.mozilla.com/en-US/plugincheck/) could log this data.
Comment 7•14 years ago
|
||
Comment on attachment 433473 [details] [diff] [review] Patch v.1 Content parts look good. r=jst
Attachment #433473 -
Flags: review?(jst) → review+
Comment 8•14 years ago
|
||
Comment on attachment 433473 [details] [diff] [review] Patch v.1 >diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js >+ { niceName: "Sun Java", regexs: [/^Java Embedding Plugin/ , /^Java.* Platform/, /^Java.* Plug/] }, I don't think these are all guaranteed to be *Sun* Java, right? There are other cases here where it seems like we might blame the wrong company, which makes me a bit nervous... I wonder whether we need to care about ® and ™ and such... >+ // Map the plugin's name to a filtered version more suitable for user UI. >+ makeNicePluginName : function (aName, aFilename) { >+ // Check for a cached mapping, so we don't do a ton of regexs every crash. >+ if (aName in this.nicePluginNameCache) >+ return this.nicePluginNameCache[aName]; Should probably cache based on nameToTest rather than just name. >+ // Glue the strings together for easier testing. I think I would prefer testing against both strings separately just to avoid potential weirdness. >+ let nameToTest = aName + aFilename.toLowerCase(); >+ for each (let entry in this.nicePluginNameLookups) { >+ for each (let regex in entry.regexs) { >+ if (regex.test(nameToTest)) { how about: if (entry.regexs.some(function (r) r.test(aName) || r.test(aFileName)) >+ let result = entry.niceName; >+ this.nicePluginNameCache[aName] = result; >+ return result; >+ let result = newName; >+ this.nicePluginNameCache[aName] = result; >+ return result; could merge these into one line. >+ // We have no data for this plugin, so just clean up the name a bit. >+ >+ // Strip off trailing version numbers (eg 1.6_06-2) I think this is better accomplished using something like: newName = aName.replace(/[\s\d\.\-\_\(\)]+$/, ""); newName = newName.replace(/plug-?in\s*$/i, ""); > let doPrompt = true; // XXX followup for .getData("doPrompt"); > let submitReports = true; // XXX followup for .getData("submitReports"); (are these bugs filed?)
Updated•14 years ago
|
Attachment #433473 -
Flags: review?(gavin.sharp) → review-
Comment 9•14 years ago
|
||
I'd really like to have the name mapping somewhere more central (like in the PluginProvider.jsm I am adding as part of the EM rewrite perhaps!) so we can use the same names in the EM UI and anywhere else that needs it.
Assignee | ||
Comment 10•14 years ago
|
||
Attachment #433473 -
Attachment is obsolete: true
Attachment #433506 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 11•14 years ago
|
||
(In reply to comment #8) > I don't think these are all guaranteed to be *Sun* Java, right? The examples I found were all Sun. I don't think there are too many Java plugins out there... > I wonder whether we need to care about ® and ™ and such... I'm pretty sure not. > > let doPrompt = true; // XXX followup for .getData("doPrompt"); > > let submitReports = true; // XXX followup for .getData("submitReports"); > > (are these bugs filed?) Sortof, it's part of bug 550303 and related work that's on my plate right now. (In reply to comment #9) > I'd really like to have the name mapping somewhere more central (like in the > PluginProvider.jsm I am adding as part of the EM rewrite perhaps!) so we can > use the same names in the EM UI and anywhere else that needs it. It's easy to move, and will be a great followup bug. :-) Leaving here, since this code will also land on 1.9.2 for Lorentz.
Comment 12•14 years ago
|
||
technically the java plugin for os x is Apple's not Sun's, so no, you should not blame Sun, users should be contacting Apple for support. there's also IBM Java, IcedTea Java and a couple of others floating around, I'm not sure if your regexp would actually match those (I'd hope not).
Comment 13•14 years ago
|
||
Comment on attachment 433506 [details] [diff] [review] Patch v.2 We discussed a more limited approach that just covers flash+stripping as a first step, on IRC.
Attachment #433506 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 14•14 years ago
|
||
Attachment #433506 -
Attachment is obsolete: true
Attachment #437747 -
Flags: review?(gavin.sharp)
Comment 15•14 years ago
|
||
Comment on attachment 437747 [details] [diff] [review] Patch v.3 >diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js >+ makeNicePluginName : function (aName, aFilename) { >+ // Check for a cached mapping, so we don't do a ton of regexs every crash. >+ if (cacheKey in this.nicePluginNameCache) >+ return this.nicePluginNameCache[cacheKey]; Seems like we should just avoid adding the cache now, and add it when we actually implement the more elaborate fix. >+ // Clean up the plugin name by stripping off any trailing version numbers >+ // or "plugin". EG, "Foo Bar Plugin 1.23_02" --> "Foo Bar" >+ let newName = aName.replace(/[\s\d\.\-\_\(\)(plugin)(plug-in)]+$/i, ""); This isn't quite doing what you would expect, see e.g. what it does to "CoolWin 4.3 Plugin". How about: .replace(/\bplug-?in\b/i, "").replace(/[\s\d\.\-\_\(\)]+$/, ""); ?
Attachment #437747 -
Flags: review?(gavin.sharp) → review+
Assignee | ||
Comment 16•14 years ago
|
||
Attachment #437747 -
Attachment is obsolete: true
Attachment #437777 -
Flags: review?(jst)
Assignee | ||
Comment 17•14 years ago
|
||
Comment on attachment 437777 [details] [diff] [review] Patch v.4 Ha, jst already reviewed the patch v.1, so no need to look at it again.
Attachment #437777 -
Flags: review?(jst)
Assignee | ||
Comment 18•14 years ago
|
||
Pushed http://hg.mozilla.org/mozilla-central/rev/4a5cbe606e2a
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
Comment 19•14 years ago
|
||
Does this need l10n equivalent opt-in patches?
Assignee | ||
Comment 20•14 years ago
|
||
Attachment #437981 -
Flags: approval1.9.2.4?
Comment 21•14 years ago
|
||
Comment on attachment 437981 [details] [diff] [review] Patch v.4 (branch) a1.9.2.4 = beltzner
Attachment #437981 -
Flags: approval1.9.2.4? → approval1.9.2.4+
Assignee | ||
Comment 22•14 years ago
|
||
Filed bug 558207 for getting some real data so we can to additional plugin name remapping.
Assignee | ||
Comment 23•14 years ago
|
||
Pushed to 192: http://hg.mozilla.org/releases/mozilla-1.9.2/rev/b2b5137c9473
status1.9.2:
--- → .4-fixed
Updated•2 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•