nsISupports
Last changed in Gecko 9.0 (Firefox 9.0 / Thunderbird 9.0 / SeaMonkey 2.6)Implemented by: @mozilla.org/docshell/urifixup;1
as a service:
var uriFixup = Components.classes["@mozilla.org/docshell/urifixup;1"] .createInstance(Components.interfaces.nsIURIFixup);
nsIURI createExposableURI(in nsIURI aURI); |
nsIURI createFixupURI(in AUTF8String aURIText, in unsigned long aFixupFlags); |
nsIURI keywordToURI(in AUTF8String aKeyword); |
nsIURIFixupInfo getFixupURIInfo(in AUTF8String aURIText, in unsigned long aFixupFlags); |
Constant | Value | Description |
FIXUP_FLAG_NONE |
0 |
No fixup flags. |
FIXUP_FLAG_ALLOW_KEYWORD_LOOKUP |
1 |
Allow the fixup to use a keyword lookup service to complete the URI. The fixup object implementer should honour this flag and only perform any lengthy keyword (or search) operation if it is set. |
FIXUP_FLAGS_MAKE_ALTERNATE_URI |
2 |
Tell the fixup to make an alternate URI from the input URI, for example to turn foo into www.foo.com. |
FIXUP_FLAG_USE_UTF8 |
4 |
Use UTF-8 to encode the URI instead of the platform character set. |
FIXUP_FLAG_FIX_SCHEME_TYPOS |
8 |
Fix common scheme typos. |
Converts an internal URI (for example a WYSIWYG URI) into one which we can expose to the user, for example on the URL bar.
nsIURI createExposableURI( in nsIURI aURI );
aURI
The converted, exposable URI, as an nsIURI
.
NS_ERROR_UNKNOWN_PROTOCOL
NS_ERROR_MALFORMED_URI
aURI
is malformed.Converts the specified string into a URI, first attempting to correct any errors in the syntax or other vagaries. Returns a well formed URI or nsnull
if it cannot.
nsIURI createFixupURI( in AUTF8String aURIText, in unsigned long aFixupFlags );
aURIText
aFixupFlags
The converted URI.
Converts the specified keyword string into a URI. Note that it is the caller's responsibility to check whether keywords are enabled and whether aKeyword
is a sensible keyword.
nsIURI keywordToURI( in AUTF8String aKeyword );
aKeyword
The converted URI.
Same as createFixupURI, but returns information about what it corrected (e.g. whether we could rescue the URI or "just" generated a keyword search URI instead).
nsIURI createFixupURI( in AUTF8String aURIText, in unsigned long aFixupFlags );
aURIText
aFixupFlags
The information as an nsIURIFixupInfo