tinymce.util.URI
This class handles parsing, modification and serialization of URI/URL strings.
Summary
Methods
Name | Summary | Defined by |
---|---|---|
Returns the full URI of the internal structure. |
||
Check to see if a URI is safe to use in the Document Object Model (DOM). This will return true if the URI can be used in the DOM without potentially triggering a security issue. |
||
Determine whether the given URI has the same origin as this URI. Based on RFC-6454. Supports default ports for protocols listed in DEFAULT_PORTS. Unsupported protocols will fail safe: they won’t match, if the port specifications differ. |
||
Sets the internal path part of the URI. |
||
Converts a relative path into a absolute path. |
||
Converts the specified URI into a absolute URI based on the current URI instance location. |
||
Converts a absolute path into a relative path. |
||
Converts the specified URI into a relative URI based on the current URI instance location. |
Methods
isDomSafe()
isDomSafe(uri: String, context: Object, options: Object): Boolean
Check to see if a URI is safe to use in the Document Object Model (DOM). This will return true if the URI can be used in the DOM without potentially triggering a security issue.
isSameOrigin()
isSameOrigin(uri: tinymce.util.URI): Boolean
Determine whether the given URI has the same origin as this URI. Based on RFC-6454. Supports default ports for protocols listed in DEFAULT_PORTS. Unsupported protocols will fail safe: they won’t match, if the port specifications differ.
Parameters
-
uri (URI)
- Uri instance to compare.
toAbsolute()
toAbsolute(uri: String, noHost: Boolean): String
Converts the specified URI into a absolute URI based on the current URI instance location.
Examples
// Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm
var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm');
toRelative()
toRelative(uri: String): String
Converts the specified URI into a relative URI based on the current URI instance location.