nsIMicrosummaryGenerator 编辑

toolkit/components/places/public/nsIMicrosummaryService.idlScriptable This interface provides access to a microsummary that has been installed in Firefox. 1.0 66 Introduced Gecko 1.8 Obsolete Gecko 6.0 Inherits from: nsISupports Last changed in Gecko 1.9 (Firefox 3) Warning: Microsummary support was removed in Gecko 6.0 (Firefox 6.0 / Thunderbird 6.0 / SeaMonkey 2.3)

Method overview

long calculateUpdateInterval(in nsIDOMNode aPageContent);
boolean equals(in nsIMicrosummaryGenerator aOther);
AString generateMicrosummary(in nsIDOMNode aPageContent);

Attributes

AttributeTypeDescription
loadedbooleanHas the generator itself (which may be a remote resource) been loaded. Read only.
localURInsIURIFor generators installed by the user or bundled with the browser, the local URI points to the location of the local file containing the generator's XML. Read only.
nameAUTF8StringAn arbitrary descriptive name for this microsummary generator. Read only.
needsPageContentbooleanWhether or not this generator needs page content to generate a microsummary. Microsummaries generated by XSLT templates need page content, while those which represent the actual microsummary do not. Read only.
urinsIURI

The canonical location and unique identifier of the generator. It tells us where the generator comes from and where to go for updates. Read only.

For generators referenced by web pages via <link> tags, this URI is the URL specified by the tag.

For generators installed via nsISidebar.addMicrosummaryGenerator(), this URI is a URN of the form urn:source:<url>, where <url> is the remote location from which we installed the generator.

For generators installed via some other mechanism (for example an extension that dynamically creates generators), this URI is a URN in a form of the extension's own choosing, with the only restriction being that the URI be globally unique. To ensure this, we recommend that such extensions incorporate UUIDs created by nsIUUIDGenerator into the URNs of the generators they create.

Methods

calculateUpdateInterval()

Calculates the interval until the microsummary should be updated for the next time, depending on the page content. If the generator doesn't specify an interval, null is returned.

long calculateUpdateInterval(
  in nsIDOMNode aPageContent
);
Parameters
aPageContent
The content of the page being summarized.
Return value

The interval in milliseconds until the next update request.

equals()

Microsummary-generator equivalence test. Generators are considered equal if their canonical locations (uri attribute) are equal.

boolean equals(
  in nsIMicrosummaryGenerator aOther
);
Parameters
aOther
The generator to compare against.
Return value

A boolean indicating if the two generators are equal.

generateMicrosummary()

Generate a microsummary by processing the generator template against the page content. If a generator doesn't need content, pass null as the parameter to this method.

Note: In the future, this may be expanded to support rich text content.
AString generateMicrosummary(
  in nsIDOMNode aPageContent
);
Parameters
aPageContent
The content of the page being summarized.
Return value

The text result of processing the template.

See also

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

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

发布评论

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

词条统计

浏览:56 次

字数:6436

最后编辑:7 年前

编辑次数:0 次

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