nsIExternalHelperAppService 编辑

uriloader/exthandler/nsIExternalHelperAppService.idlScriptable The external helper app service is used for finding and launching platform specific external applications for a given MIME content type. Inherits from: nsISupports Last changed in Gecko 1.7

Implemented by: @mozilla.org/uriloader/external-helper-app-service;1. To access this service, use:

var externalHelperAppService = Components.classes["@mozilla.org/uriloader/external-helper-app-service;1"]
                               .getService(Components.interfaces.nsIExternalHelperAppService);

Method overview

boolean applyDecodingForExtension(in AUTF8String aExtension, in ACString aEncodingType);
nsIStreamListener doContent(in ACString aMimeContentType, in nsIRequest aRequest, in nsIInterfaceRequestor aWindowContext, in boolean aForceSave);

Methods

applyDecodingForExtension()

Determines whether or not data whose filename has the specified extension should be decoded from the specified encoding type before being saved or delivered to helper applications.

boolean applyDecodingForExtension(
  in AUTF8String aExtension,
  in ACString aEncodingType
);
Parameters
aExtension
The filename extension to check.
aEncodingType
The encoding type to check.
Return value

true if data from URLs with the specified extension and encoding should be decoded prior to saving the file or delivering it to a helper application; otherwise false.

doContent()

Binds an external helper application to a stream listener. The caller should pump data into the returned stream listener. When the OnStopRequest is issued, the stream listener implementation will launch the helper app with this data.

nsIStreamListener doContent(
  in ACString aMimeContentType,
  in nsIRequest aRequest,
  in nsIInterfaceRequestor aWindowContext,
  in boolean aForceSave
);
Parameters
aMimeContentType
The content type of the incoming data.
aRequest
The request corresponding to the incoming data.
aWindowContext
Use nsIServiceManager.getInterface() to retrieve properties like the DOM window or parent window; the service might need this in order to bring up dialogs.
aForceSave
true to always save this content to disk, regardless of nsIMIMEInfo and other such influences.
Return value

A nsIStreamListener which the caller should pump the data into.

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

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

发布评论

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

词条统计

浏览:94 次

字数:4388

最后编辑:7年前

编辑次数:0 次

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