mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 06:45:42 +00:00
Bug 1068087: Switch about:plugins to run remotely. r=mconley
--HG-- extra : rebase_source : 60dc8d3a27028a343444b782c64d1f0e4dfdebbd
This commit is contained in:
parent
b756a0b9e6
commit
37eab7415f
@ -43,7 +43,10 @@ static RedirEntry kRedirMap[] = {
|
||||
"mozilla", "chrome://global/content/mozilla.xhtml",
|
||||
nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT
|
||||
},
|
||||
{ "plugins", "chrome://global/content/plugins.html", 0 },
|
||||
{
|
||||
"plugins", "chrome://global/content/plugins.html",
|
||||
nsIAboutModule::URI_MUST_LOAD_IN_CHILD
|
||||
},
|
||||
{ "config", "chrome://global/content/config.xul", 0 },
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
{ "crashes", "chrome://global/content/crashes.xhtml", 0 },
|
||||
|
@ -9,8 +9,6 @@
|
||||
<script type="application/javascript">
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://gre/modules/AddonManager.jsm");
|
||||
|
||||
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");
|
||||
@ -58,7 +56,7 @@
|
||||
*/
|
||||
navigator.plugins.refresh(false);
|
||||
|
||||
AddonManager.getAddonsByTypes(["plugin"], function (aPlugins) {
|
||||
addMessageListener("PluginList", function({ data: aPlugins }) {
|
||||
var fragment = document.createDocumentFragment();
|
||||
|
||||
// "Installed plugins"
|
||||
@ -215,6 +213,8 @@
|
||||
|
||||
document.getElementById("outside").appendChild(fragment);
|
||||
});
|
||||
|
||||
sendAsyncMessage("RequestPlugins");
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
|
@ -2988,3 +2988,25 @@ Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", AddonManagerInternal
|
||||
Object.freeze(AddonManagerInternal);
|
||||
Object.freeze(AddonManagerPrivate);
|
||||
Object.freeze(AddonManager);
|
||||
|
||||
// Functions to support about:plugins
|
||||
Cu.import("resource://gre/modules/RemotePageManager.jsm");
|
||||
|
||||
// Lists all the properties that plugins.html needs
|
||||
const NEEDED_PROPS = ["name", "pluginLibraries", "pluginFullpath", "version",
|
||||
"isActive", "blocklistState", "description",
|
||||
"pluginMimeTypes"];
|
||||
function filterProperties(plugin) {
|
||||
let filtered = {};
|
||||
for (let prop of NEEDED_PROPS) {
|
||||
filtered[prop] = plugin[prop];
|
||||
}
|
||||
return filtered;
|
||||
}
|
||||
|
||||
let listener = new RemotePages("about:plugins");
|
||||
listener.addMessageListener("RequestPlugins", ({ target: port }) => {
|
||||
AddonManager.getAddonsByTypes(["plugin"], function (aPlugins) {
|
||||
port.sendAsyncMessage("PluginList", [filterProperties(p) for (p of aPlugins)]);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user