nsIParentalControlsService 编辑

toolkit/components/parentalcontrols/public/nsIParentalControlsService.idlScriptable This interface provides access to the operating system's parental controls feature, allowing code to detect whether such a service is enabled and to request overrides to bypass the feature. 1.0 66 Introduced Gecko 1.9 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Note: Currently, this interface is only supported on Microsoft Windows Vista and newer as well as Android 4.3 and newer.

Implemented by: @mozilla.org/parental-controls-service;1. To create an instance, use:

var parentalControlsService = Components.classes["@mozilla.org/parental-controls-service;1"]
                              .createInstance(Components.interfaces.nsIParentalControlsService);

Method overview

void log(in short aEntryType, in boolean aFlag, in nsIURI aSource, [optional] in nsIFile aTarget);
boolean requestURIOverride(in nsIURI aTarget, [optional] in nsIInterfaceRequestor aWindowContext);
boolean requestURIOverrides(in nsIArray aTargets, [optional] in nsIInterfaceRequestor aWindowContext);

Attributes

AttributeTypeDescription
blockFileDownloadsEnabledbooleantrue if the current user account's parental controls restrictions include the blocking of all file downloads. Read only.
loggingEnabledbooleantrue if the current user account has parental controls logging enabled. If this is true, applications should log relevant events using log() method. Read only.
parentalControlsEnabledbooleantrue if the current user account has parental controls restrictions enabled. Read only.

Constants

ConstantValueDescription
ePCLog_URIVisit1This log entry type represents an access to web content.
ePCLog_FileDownload2This log entry type represents a file download.

Methods

log()

Logs an application specific parental controls event.

void log(
  in short aEntryType,
  in boolean aFlag,
  in nsIURI aSource,
  in nsIFile aTarget Optional
);
Parameters
aEntryType
The type of event to log. See the constants for allowed values.
aFlag
Pass true if the event was blocked or false if it was allowed.
aSource
The URI source of the subject content.
aTarget Optional
The location to which the content was saved if it was not blocked.

requestURIOverride()

Requests that a blocked URI be allowed through parental control filters.

This method may block while the operating system presents user interface to handle the override request (such as an "enter an administrator's password" dialog box).

boolean requestURIOverride(
  in nsIURI aTarget,
  in nsIInterfaceRequestor aWindowContext Optional
);
Parameters
aTarget
The URI to be overridden.
aWindowContext Optional
The window generating the event.
Return value

true if the block was successfully overridden, otherwise false.

requestURIOverrides()

Requests that a set of URIs be allowed through the parental control filters.

This method may block while the operating system presents user interface to handle the override request (such as an "enter an administrator's password" dialog box).

boolean requestURIOverrides(
  in nsIArray aTargets,
  in nsIInterfaceRequestor aWindowContext Optional
);
Parameters
aTargets
An array of nsIURI objects, each representing a URI for which an override is desired.
aWindowContext Optional
The window generating the event.
Return value

true if the block was successfully overridden, otherwise false.

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

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

发布评论

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

词条统计

浏览:72 次

字数:6685

最后编辑:7年前

编辑次数:0 次

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