2009-04-22 23:27:04 -07:00
|
|
|
var PluginUtils =
|
|
|
|
{
|
|
|
|
withTestPlugin : function(callback)
|
|
|
|
{
|
|
|
|
if (typeof Components == "undefined")
|
|
|
|
{
|
|
|
|
todo(false, "Not a Mozilla-based browser");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
|
|
|
var ph = Components.classes["@mozilla.org/plugin/host;1"]
|
|
|
|
.getService(Components.interfaces.nsIPluginHost);
|
2009-11-09 13:11:58 -08:00
|
|
|
var tags = ph.getPluginTags();
|
2009-04-22 23:27:04 -07:00
|
|
|
|
|
|
|
// Find the test plugin
|
|
|
|
for (var i = 0; i < tags.length; i++)
|
|
|
|
{
|
|
|
|
if (tags[i].name == "Test Plug-in")
|
|
|
|
{
|
|
|
|
callback(tags[i]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
todo(false, "Need a test plugin on this platform");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
};
|