nsIURLFormatter 编辑
toolkit/components/urlformatter/public/nsIURLFormatter.idl
Scriptable This interface exposes methods to substitute variables in URL formats. 1.0 66 Introduced Gecko 1.8 Inherits from: nsISupports
Last changed in Gecko 1.8 (Firefox 1.5 / Thunderbird 1.5 / SeaMonkey 1.0)Variable names can contain 'A-Z' letters and '_' characters.
Mozilla applications linking to Mozilla websites are strongly encouraged to use URLs of the following format:
http[s]://%SERVICE%.mozilla.[com|org]/%LOCALE%/
Method overview
AString formatURL(in AString aFormat); |
AString formatURLPref(in AString aPref); |
Methods
formatURL()
Formats a string URL.
The set of known variables is predefined. If a variable is unknown, it is left unchanged and a non-fatal error is reported.
AString formatURL( in AString aFormat );
Parameters
aFormat
- Unformatted URL as a string.
Return value
The formatted URL.
formatURLPref()
Formats a string URL stored in a preference.
If the preference value cannot be retrieved, a fatal error is reported and the "about:blank" URL is returned.
AString formatURLPref( in AString aPref );
Parameters
aPref
- A string representing the name of the preference from which to fetch the URL to format.
Return value
The formatted URL returned by formatURL()
, or "about:blank".
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论