XPInstall API Reference:Install Object:Methods:refreshPlugins
From MDC
Contents |
[edit] refreshPlugins
Refreshes the list of plug-ins registered for the browser.
[edit] Method of
Install object
[edit] Syntax
int refreshPlugins( [ aReloadPages ] );
[edit] Parameters
The refreshPlugins method has the following parameter:
aReloadPagesaReloadPagesis an optional boolean value indicating whether you want to reload the open web pages after you have refreshed the plug-in list.
[edit] Returns
Nothing.
[edit] Description
refreshPlugins lets you register new plug-ins without having to restart the browser. When you use this method in an installation script, as the example below demonstrates, you can install new plug-ins and use them to display the requested media in a web page without interrupting the experience of the user.
Note that refreshPlugins must be called after the performInstall method that initiates the actual installation.
[edit] Example
// Install DLL into Plugins
// Install XPT into Components
var xpiSrc = "NPMCult3DP.dll";
var xpiSrc2 = "nsIC3DPScriptablePeer.xpt";
initInstall(
"Cult3D Plugin File",
"@cycore.com/Cult3D;version=1.0.0",
"1.0.0");
setPackageFolder(getFolder("Plugins"));
addFile(xpiSrc);
addFile("",xpiSrc2,getFolder("Components"),"");
var err = getLastError();
if (err == SUCCESS)
{
err = performInstall();
if (err == SUCCESS)
refreshPlugins();
}
else
cancelInstall(err);