Make NPAPI Plugins work

This commit is contained in:
NTD 2018-02-11 05:11:14 -05:00 committed by Roy Tam
commit bbe87d1e96
3 changed files with 53 additions and 7 deletions

View file

@ -2,10 +2,21 @@
- 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/. -->
<!-- LOCALIZATION NOTE (unsupportedPlatform.pre): Mobile only. Flash (the only plugin available on mobile)
is not supported on some devices. Include a trailing space as needed. -->
<!ENTITY unsupportedPlatform.pre "We're very sorry, but &brandShortName; can't play Flash on this device. ">
<!-- LOCALIZATION NOTE (unsupportedPlatform.learnMore): Mobile only. This text is used to link to a SUMO page explaining why Flash is not
supported on this device. Use the unicode ellipsis char, \u2026, or use "..." if \u2026 doesn't suit traditions in your locale. -->
<!ENTITY unsupportedPlatform.learnMore "Learn More…">
<!-- LOCALIZATION NOTE (unsupportedPlatform.post): Mobile only. Include text here if needed for your locale. -->
<!ENTITY unsupportedPlatform.post "">
<!ENTITY missingPlugin "A plugin is needed to display this content.">
<!-- LOCALIZATION NOTE (tapToPlayPlugin): Mobile (used for touch interfaces) only has one type of plugin possible. -->
<!ENTITY tapToPlayPlugin "Tap here to activate plugin.">
<!ENTITY clickToActivatePlugin "Activate plugin.">
<!ENTITY checkForUpdates "Check for updates…">
<!ENTITY disabledPlugin "This plugin is disabled.">
<!ENTITY blockedPlugin.label "This plugin has been blocked for your protection.">
<!ENTITY hidePluginBtn.label "Hide plugin">
<!ENTITY managePlugins "Manage plugins…">

View file

@ -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;">

View file

@ -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