mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
29 lines
705 B
JavaScript
29 lines
705 B
JavaScript
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);
|
|
var tags = ph.getPluginTags();
|
|
|
|
// 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;
|
|
}
|
|
};
|