nsIChromeRegistry 编辑

chrome/public/nsIChromeRegistry.idlScriptable Provides access to the chrome registry; you can use this to get information about chrome documents that have been registered. Inherits from: nsISupports Last changed in Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)

Implemented by: @mozilla.org/chrome/chrome-registry;1 as a service:

var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
                     .getService(Components.interfaces.nsIChromeRegistry);

Method overview

void canonify(in nsIURI aChromeURL); Obsolete since Gecko 1.8
void checkForNewChrome();
nsIURI convertChromeURL(in nsIURI aChromeURL);
boolean wrappersEnabled(in nsIURI aURI); Violates the XPCOM interface guidelines

Constants

ConstantValueDescription
NONE0 
PARTIAL1 
FULL2 

Methods

canonify()

Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Note: This method is obsolete; use convertChromeURL() instead.

Converts a chrome URL into a canonical representation by ensuring that the filename portion of the URL is included, as in chrome://package/provider/file. This is useful because chrome URLs are allowed to be specified in "shorthand", leaving the "file" portion off. In that case, the URL is expanded to chrome://package/provider/package.ext.

The extension, ext, is one of:

xul
For a "content" package.
css
For a "skin" package.
dtd
For a "locale" package.
    void canonify(
      in nsIURI aChromeURL
    );
    
    Parameters
    aChromeURL
    The URL that is to be canonified.

    checkForNewChrome()

    Refreshes the chrome list at runtime, looking for new packages and so forth.

    void checkForNewChrome();
    
    Parameters

    None.

    convertChromeURL()

    Resolves a chrome URL to an loadable URI using the information in the registry. A new nsIURI is returned; the original is left unmodified.

    This lets you take a non-canonical chrome URI, such as chrome://package/provider/file, and convert it into a canonical one. This is useful because chrome URLs are allowed to be specified in "shorthand", leaving the "file" portion off. In that case, the URL is expanded to chrome://package/provider/package.ext.

    The extension, ext, is one of:

    xul
    For a "content" package.
    css
    For a "skin" package.
    dtd
    For a "locale" package.
      nsIURI convertChromeURL(
        in nsIURI aChromeURL
      );
      
      Parameters
      aChromeURL
      The URL that is to be converted.
      Return value

      A new nsIURI object containing the loadable URI for the specified chrome URL.

      Violates the XPCOM interface guidelines

      wrappersEnabled()

      Returns whether XPCNativeWrappers are enabled for the specified URI.

      boolean wrappersEnabled(
        in nsIURI aURI
      );
      
      Parameters
      aURI
      The URI for which to determine if XPCNativeWrappers are enabled.
      Return value

      true if XPCNativeWrappers are enabled for the specified URI; otherwise false.

      See also

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

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

      发布评论

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

      词条统计

      浏览:28 次

      字数:5932

      最后编辑:6年前

      编辑次数:0 次

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