nsIChromeRegistry 编辑
chrome/public/nsIChromeRegistry.idl
Scriptable 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
Constant | Value | Description |
NONE | 0 | |
PARTIAL | 1 | |
FULL | 2 |
Methods
canonify()
Obsolete since Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0) Note: This method is obsolete; useconvertChromeURL()
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.
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论