URLUtilsReadOnly

Obsolete
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

The obsolete URLUtilsReadOnly interface previously defined utility methods for working with URLs. These were then inherited by other interfaces, such as WorkerLocation. URLUtilsReadOnly has been removed from the specification, and the properties it defined are now directly part of the affected interfaces.

Properties

This interface doesn't inherit any properties.

URLUtilsReadOnly.href Read only
Is a DOMString containing the whole URL.
URLUtilsReadOnly.protocol Read only
Is a DOMString containing the protocol scheme of the URL, including the final ':'.
URLUtilsReadOnly.host Read only
Is a DOMString containing the host, that is the hostname, a ':', and the port of the URL.
URLUtilsReadOnly.hostname Read only
Is a DOMString containing the domain of the URL.
URLUtilsReadOnly.origin Read only
Returns a DOMString containing the canonical form of the origin of the specific location.
URLUtilsReadOnly.port Read only
Is a DOMString containing the port number of the URL.
URLUtilsReadOnly.pathname Read only
Is a DOMString containing an initial '/' followed by the path of the URL.
URLUtilsReadOnly.search Read only
Is a DOMString containing a '?' followed by the parameters of the URL.
URLUtilsReadOnly.hash Read only
Is a DOMString containing a '#' followed by the fragment identifier of the URL.

Methods

This interface doesn't inherit any methods.

URLUtilsReadOnly.toString()
Returns a DOMString containing the whole URL. It is a synonym for URLUtilsReadOnly.href.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
URLUtilsReadOnlyChrome No support NoEdge No support NoFirefox Full support 57
Full support 57
No support 3.5 — 57
Notes
Notes Firefox has a bug whereby single quotes contained in URLs are escaped when accessed via URL APIs (see bug 1386683).
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 57
Full support 57
No support 4 — 57
Notes
Notes Firefox has a bug whereby single quotes contained in URLs are escaped when accessed via URL APIs (see bug 1386683).
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
hash
Experimental
Chrome No support NoEdge No support NoFirefox Full support 38
Full support 38
No support 3.5 — 38
Notes
Notes Before Firefox 38, Firefox returned the hash percent encoded. This has been fixed to match the spec.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 38
Full support 38
No support 4 — 38
Notes
Notes Before Firefox 38, Firefox returned the hash percent encoded. This has been fixed to match the spec.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
host
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
hostname
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
href
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
origin
Experimental
Chrome No support NoEdge No support NoFirefox Full support 29IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 29Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
pathname
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
port
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
protocol
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
search
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
toString
Experimental
Chrome No support NoEdge No support NoFirefox Full support 3.5IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android Full support 4Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

See also