nsIGlobalHistory3 编辑

docshell/base/nsIGlobalHistory3.idlScriptable This interface provides information about global history to Gecko. 1.0 66 Introduced Gecko 1.8 Obsolete Gecko 9.0 Inherits from: nsIGlobalHistory2 Last changed in Gecko 1.9 (Firefox 3)

This interface was originally created as part of nsIGlobalHistory2, but was split off during the transition to Places.

Method overview

void addDocumentRedirect(in nsIChannel aOldChannel, in nsIChannel aNewChannel, in PRInt32 aFlags, in boolean aTopLevel);
unsigned long getURIGeckoFlags(in nsIURI aURI);
void setURIGeckoFlags(in nsIURI aURI, in unsigned long aFlags);

Methods

addDocumentRedirect()

Notifies the history system that the page loading via aOldChannel redirected to aNewChannel. Implementations should generally add the URI for aOldChannel to history for link coloring, but are advised not to expose it in the history user interface. This function is preferred if nsIGlobalHistory3 is available. Otherwise, nsIGlobalHistory2.addURI() should be called with redirect=true.

This function is preferred to nsIGlobalHistory2.addURI() because it provides more information (including the redirect destination, channels involved, and redirect flags) to the history implementation.

For implementors of nsIGlobalHistory3: The history implementation is responsible for sending NS_LINK_VISITED_EVENT_TOPIC to observers for redirect pages. This notification must be sent for history consumers for all non-redirect pages.

The other params to this function are the same as those for nsIChannelEventSink.OnChannelRedirect().

Implementors who wish to implement this interface but rely on nsIGlobalHistory2.addURI() for redirect processing may throw NS_ERROR_NOT_IMPLEMENTED from this method. If they do so, then callers must call nsIGlobalHistory2.addURI() upon getting the NS_ERROR_NOT_IMPLEMENTED result.
void addDocumentRedirect(
  in nsIChannel aOldChannel,
  in nsIChannel aNewChannel,
  in PRInt32 aFlags,
  in boolean aTopLevel
);
Parameters
aOldChannel
 
aNewChannel
 
aFlags
Flags to add. These are defined by the history that is implementing this interface.
aTopLevel
Whether the URI is loaded in a top-level window. If false, the load is in a subframe.

getURIGeckoFlags()

Get the Gecko flags for this URI. These flags are used by Gecko as hints to optimize page loading. Not all histories have them; this need not be supported (just return NS_ERROR_NOT_IMPLEMENTED. These flags are opaque and should not be interpreted by the history engine.

unsigned long getURIGeckoFlags(
  in nsIURI aURI
);
Parameters
aURI
The nsIURI to get flags for. Flags are defined by the history that is implementing this interface.
Return value

The Gecko flags for the URI.

setURIGeckoFlags()

Set the Gecko flags for this URI. May fail if the history entry doesn't have any flags or if there is no entry for the URI.

void setURIGeckoFlags(
  in nsIURI aURI,
  in unsigned long aFlags
);
Parameters
aURI
The nsIURI to add flags for.
aFlags
The flags to add. These are defined by the history that is implementing this interface.

See also

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

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

发布评论

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

词条统计

浏览:121 次

字数:6072

最后编辑:6 年前

编辑次数:0 次

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