This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The URLUtilsReadOnly interface defines utility methods to work with URLs. It defines only non-modifying methods intended to be used on data that cannot be changed.
There are no object of this type, but several interface are implemented it, like WorkerLocation.
This interface doesn't inherit any property.
URLUtilsReadOnly.href Read only
DOMString containing the whole URL.URLUtilsReadOnly.protocol Read only
DOMString containing the protocol scheme of the URL, including the final ':'.URLUtilsReadOnly.host Read only
DOMString containing the host, that is the hostname, a ':', and the port of the URL.URLUtilsReadOnly.hostname Read only
DOMString containing the domain of the URL.URLUtilsReadOnly.origin Read only
DOMString containing the canonical form of the origin of the specific location.URLUtilsReadOnly.port Read only
DOMString containing the port number of the URL.URLUtilsReadOnly.pathname Read only
DOMString containing an initial '/' followed by the path of the URL.URLUtilsReadOnly.search Read only
DOMString containing a '?' followed by the parameters of the URL.URLUtilsReadOnly.hash Read only
DOMString containing a '#' followed by the fragment identifier of the URL.This interface doesn't inherit any method.
URLUtilsReadOnly.toString()DOMString containing the whole URL. It is a synonym for URLUtilsReadOnly.href.| Specification | Status | Comment |
|---|---|---|
| URL The definition of 'URLUtilsReadOnly' in that specification. | Living Standard | Initial definition |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | No | No | 57
|
No | No | No |
hash
|
No | No | 38
|
No | No | No |
host
|
No | No | 3.5 | No | No | No |
hostname
|
No | No | 3.5 | No | No | No |
href
|
No | No | 3.5 | No | No | No |
origin
|
No | No | 29 | No | No | No |
pathname
|
No | No | 3.5 | No | No | No |
port
|
No | No | 3.5 | No | No | No |
protocol
|
No | No | 3.5 | No | No | No |
search
|
No | No | 3.5 | No | No | No |
toString
|
No | No | 3.5 | No | No | No |
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | No | No | No | 57
|
No | No | No |
hash
|
No | No | No | 38
|
No | No | No |
host
|
No | No | No | 4 | No | No | No |
hostname
|
No | No | No | 4 | No | No | No |
href
|
No | No | No | 4 | No | No | No |
origin
|
No | No | No | 29 | No | No | No |
pathname
|
No | No | No | 4 | No | No | No |
port
|
No | No | No | 4 | No | No | No |
protocol
|
No | No | No | 4 | No | No | No |
search
|
No | No | No | 4 | No | No | No |
toString
|
No | No | No | 4 | No | No | No |
URL, URLUtils, and URLQuery.WorkerLocation.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/URLUtilsReadOnly