Readonly
asciiThe URI host with an ASCII compatible encoding. Follows the IDNA draft spec for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing internet infrasture.
Readonly
asciiThe host:port (or simply the host, if port == -1), with an ASCII compatible encoding. Host portion follows the IDNA draft spec. The result is strictly ASCII.
Readonly
asciiAdditional attributes: The URI spec with an ASCII compatible encoding. Host portion follows the IDNA draft spec. Other parts are URL-escaped per the rules of RFC2396. The result is strictly ASCII.
Readonly
directoryThe URL path is broken down into the following principal components:
attribute AUTF8String filePath; attribute AUTF8String query;
These are inherited from nsIURI.
The URL filepath is broken down into the following sub-components: Returns the directory portion of a URL. If the URL denotes a path to a directory and not a file, e.g. http://host/foo/bar/, then the Directory attribute accesses the complete /foo/bar/ portion, and the FileName is the empty string. If the trailing slash is omitted, then the Directory is /foo/ and the file is bar (i.e. this is a syntactic, not a semantic breakdown of the Path). And hence don't rely on this for something to be a definitely be a file. But you can get just the leading directory portion for sure.
Some characters may be escaped.
Readonly
displayIf the URI has a punycode encoded hostname, this will hold the UTF8 representation of that hostname (if that representation doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false) Otherwise, if the hostname is ASCII, it will return the same as .asciiHost
Readonly
displayThe displayHost:port (or simply the displayHost, if port == -1).
Readonly
displayReturns the same as calling .prePath, only with a UTF8 encoded hostname (if that hostname doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false)
Readonly
displayReturns the same as calling .spec, only with a UTF8 encoded hostname (if that hostname doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false)
Readonly
fileGet the nsIFile corresponding to this URL.
Readonly
fileThe URL filename is broken down even further: Returns the file basename portion of a filename in a url.
Some characters may be escaped.
Readonly
fileReturns the file extension portion of a filename in a url. If a file extension does not exist, the empty string is returned.
Some characters may be escaped.
Readonly
fileReturns the file name portion of a URL. If the URL denotes a path to a directory and not a file, e.g. http://host/foo/bar/, then the Directory attribute accesses the complete /foo/bar/ portion, and the FileName is the empty string. Note that this is purely based on searching for the last trailing slash. And hence don't rely on this to be a definite file.
Some characters may be escaped.
Readonly
fileAdditional attributes added for .query support: Returns a path including the directory and file portions of a URL. For example, the filePath of "http://host/foo/bar.html#baz" is "/foo/bar.html".
Some characters may be escaped.
Readonly
hasReturns if there is a reference portion (the part after the "#") of the URI.
Readonly
hostThe host is the internet domain name to which this URI refers. It could be an IPv4 (or IPv6) address literal. Otherwise it is an ASCII or punycode encoded string.
Readonly
hostThe host:port (or simply the host, if port == -1).
Readonly
passwordReadonly
pathThe path, typically including at least a leading '/' (but may also be empty, depending on the protocol).
Some characters may be escaped.
This attribute contains query and ref parts for historical reasons. Use the 'filePath' attribute if you do not want those parts included.
Readonly
portA port value of -1 corresponds to the protocol's default port (eg. -1 implies port 80 for http URIs).
Readonly
preThe prePath (eg. scheme://user:password@host:port) returns the string before the path. This is useful for authentication or managing sessions.
Some characters may be escaped.
Readonly
queryReturns the query portion (the part after the "?") of the URL. If there isn't one, an empty string is returned.
Some characters may be escaped.
Readonly
refAdditional attribute & methods added for .ref support: Returns the reference portion (the part after the "#") of the URI. If there isn't one, an empty string is returned.
Some characters may be escaped.
Readonly
schemeThe Scheme is the protocol to which this URI refers. The scheme is restricted to the US-ASCII charset per RFC3986.
Readonly
specThe URI is broken down into the following principal components: Returns a string representation of the URI.
Some characters may be escaped.
Readonly
specreturns a string for the current URI with the ref element cleared.
Readonly
userThe username:password (or username only if value doesn't contain a ':')
Some characters may be escaped.
Readonly
usernameThe optional username and password, assuming the preHost consists of username:password.
Some characters may be escaped.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
URI equivalence test (not a strict string comparison), ignoring the value of the .ref member.
eg. http://foo.com/# == http://foo.com/ http://foo.com/#aaa == http://foo.com/#bbb
This method takes a uri and compares the two. The common uri portion is returned as a string. The minimum common uri portion is the protocol, and any of these if present: login, password, host and port If no commonality is found, "" is returned. If they are identical, the whole path with file/ref/etc. is returned. For file uris, it is expected that the common spec would be at least "file:///" since '/' is a shared common root.
Examples: this.spec aURIToCompare.spec result
This method tries to create a string which specifies the location of the argument relative to |this|. If the argument and |this| are equal, the method returns "". If any of the URIs' scheme, host, userpass, or port don't match, the method returns the full spec of the argument.
Examples: this.spec aURIToCompare.spec result
Generated using TypeDoc
nsIFileURL provides access to the underlying nsIFile object corresponding to an URL. The URL scheme need not be file:, since other local protocols may map URLs to files (e.g., resource:).