diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-11 05:11:14 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-11 05:11:14 -0500 |
commit | f2cad418a7aa84993faae333481bf2d6e5574270 (patch) | |
tree | 9392ab67617ada22500f7c102089a2afc87ff9f3 /toolkit/mozapps/extensions | |
parent | a900dcd7f5796eb28923d5fa787a6f76a358df69 (diff) | |
download | UXP-f2cad418a7aa84993faae333481bf2d6e5574270.tar UXP-f2cad418a7aa84993faae333481bf2d6e5574270.tar.gz UXP-f2cad418a7aa84993faae333481bf2d6e5574270.tar.lz UXP-f2cad418a7aa84993faae333481bf2d6e5574270.tar.xz UXP-f2cad418a7aa84993faae333481bf2d6e5574270.zip |
Make NPAPI Plugins work
Diffstat (limited to 'toolkit/mozapps/extensions')
-rw-r--r-- | toolkit/mozapps/extensions/content/pluginPrefs.xul | 2 | ||||
-rw-r--r-- | toolkit/mozapps/extensions/internal/PluginProvider.jsm | 47 |
2 files changed, 42 insertions, 7 deletions
diff --git a/toolkit/mozapps/extensions/content/pluginPrefs.xul b/toolkit/mozapps/extensions/content/pluginPrefs.xul index a7ee17d89..c3fdbfa5b 100644 --- a/toolkit/mozapps/extensions/content/pluginPrefs.xul +++ b/toolkit/mozapps/extensions/content/pluginPrefs.xul @@ -4,7 +4,7 @@ - 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/. --> -<!DOCTYPE window SYSTEM "chrome://mozapps/locale/plugins/plugins.dtd"> +<!DOCTYPE window SYSTEM "chrome://pluginproblem/locale/pluginproblem.dtd"> <vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <setting type="control" title="&plugin.file;"> diff --git a/toolkit/mozapps/extensions/internal/PluginProvider.jsm b/toolkit/mozapps/extensions/internal/PluginProvider.jsm index ff32ba0a7..04a4f9d7c 100644 --- a/toolkit/mozapps/extensions/internal/PluginProvider.jsm +++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm @@ -40,7 +40,16 @@ function getIDHashForString(aStr) { // convert the binary hash data to a hex string. let binary = hasher.finish(false); - let hash = [toHexString(binary.charCodeAt(i)) for (i in binary)].join("").toLowerCase(); + + // Tycho: let hash = [toHexString(binary.charCodeAt(i)) for (i in binary)].join("").toLowerCase(); + let hash = []; + + for (let i in binary) { + hash.push(toHexString(binary.charCodeAt(i))); + } + + hash = hash.join("").toLowerCase(); + return "{" + hash.substr(0, 8) + "-" + hash.substr(8, 4) + "-" + hash.substr(12, 4) + "-" + @@ -228,11 +237,37 @@ var PluginProvider = { updatePluginList: function PL_updatePluginList() { let newList = this.getPluginList(); - let lostPlugins = [this.buildWrapper(this.plugins[id]) - for each (id in Object.keys(this.plugins)) if (!(id in newList))]; - let newPlugins = [this.buildWrapper(newList[id]) - for each (id in Object.keys(newList)) if (!(id in this.plugins))]; - let matchedIDs = [id for each (id in Object.keys(newList)) if (id in this.plugins)]; + // Tycho: + // let lostPlugins = [this.buildWrapper(this.plugins[id]) + // for each (id in Object.keys(this.plugins)) if (!(id in newList))]; + + // let newPlugins = [this.buildWrapper(newList[id]) + // for each (id in Object.keys(newList)) if (!(id in this.plugins))]; + + // let matchedIDs = [id for each (id in Object.keys(newList)) if (id in this.plugins)]; + + let lostPlugins = []; + let newPlugins = []; + let matchedIDs = []; + + // lostPlugins + for each(let id in Object.keys(this.plugins)) { + if (!(id in newList)) { + lostPlugins.push(this.buildWrapper(this.plugins[id])); + } + } + + // newPlugins and matchedIDs + for each(let id in Object.keys(newList)) { + if (!(id in this.plugins)) { + newPlugins.push(this.buildWrapper(newList[id])); + } + + if (id in this.plugins) { + matchedIDs.push(id); + } + } + // The plugin host generates new tags for every plugin after a scan and // if the plugin's filename has changed then the disabled state won't have |