非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。
InstallTrigger
interface is an interesting outlier in the Apps API; it's included in this API but are inherited from the old Mozilla XPInstall technology for installing add-ons. It is used for triggering the download and installation of an add-on (or anything packaged in an.
xpi
file) from a Web page, using JavaScript code to kick off the install process.
注意: This article needs to be updated somewhat.
For very simple installations, the install methods on the
InstallTrigger
object may be all that's needed in the installation script.
For more complex installations, you may need to use the 安装 and/or File installation objects. In either case, you must trigger the installation process by creating a web page script in which InstallTrigger methods download the specified XPI file and "trigger" the execution of the install.js script at the top level of that XPI.
The principal method on the InstallTrigger object is 安装 , which downloads and installs one or more software packages archived in the XPI file format. The following is a basic example of an install trigger on a web page:
xpi={'XPInstall Dialog Display Name':'simple.xpi'};
InstallTrigger.install(xpi);
You can also use the InstallTrigger object to install Netscape 6/Mozilla skins and language packs, and perform multiple-package installations with 安装 .
InstallTrigger