amIWebInstaller 编辑

toolkit/mozapps/extensions/amIWebInstaller.idlScriptable This interface is used to allow web pages to start installing add-ons. 1.0 66 Introduced Gecko 2.0 Inherits from: nsISupports Last changed in Gecko 8.0 (Firefox 8.0 / Thunderbird 8.0 / SeaMonkey 2.5)

Method overview

boolean installAddonsFromWebpage(in AString aMimetype, in nsIDOMWindow aWindow, in nsIURI aReferer, [array, size_is(aInstallCount)] in wstring aUris, [array, size_is(aInstallCount)] in wstring aHashes, [array, size_is(aInstallCount)] in wstring aNames, [array, size_is(aInstallCount)] in wstring aIcons, [optional] in amIInstallCallback aCallback, [optional] in PRUint32 aInstallCount);
boolean isInstallEnabled(in AString aMimetype, in nsIURI aReferer);

Note: Prior to Gecko 8.0, all references to nsIDOMWindow used in this interface were nsIDOMWindow.

Methods

installAddonsFromWebpage()

Installs an array of add-ons at the request of a webpage.

boolean installAddonsFromWebpage(
  in AString aMimetype,
  in nsIDOMWindow aWindow,
  in nsIURI aReferer,
  [array, size_is(aInstallCount)] in wstring aUris,
  [array, size_is(aInstallCount)] in wstring aHashes,
  [array, size_is(aInstallCount)] in wstring aNames,
  [array, size_is(aInstallCount)] in wstring aIcons,
  in amIInstallCallback aCallback, Optional
  in PRUint32 aInstallCount Optional
);
Parameters
aMimetype
The mimetype for the add-ons.
aWindow
The window installing the add-ons.
aReferer
The URI for the web page installing the add-ons.
aUris
The URIs of add-ons to be installed.
aHashes
The hashes for the add-ons to be installed.
aNames
The names for the add-ons to be installed.
aIcons
The icons for the add-ons to be installed.
aCallback Optional
An optional callback to notify about installation success and failure.
aInstallCount Optional
An optional argument including the number of add-ons to install.
Return value

true if the installation was successfully started.

isInstallEnabled()

Checks if installation is enabled for a web page.

boolean isInstallEnabled(
  in AString aMimetype,
  in nsIURI aReferer
);
Parameters
aMimetype
The MIME type for the add-on to be installed.
aReferer
The URI of the web page for which to see if installation is allowed.
Return value

true if installation is enabled.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:56 次

字数:4143

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文