--- title: URLUtils slug: Web/API/HTMLHyperlinkElementUtils translation_of: Web/API/HTMLHyperlinkElementUtils original_slug: Web/API/URLUtils ---
{{ApiRef("URL API")}}{{SeeCompatTable}}
The URLUtils
interface defines utility methods to work with URLs.
There are no objects of this type, but several objects implement it, such as {{domxref("Location")}}, {{domxref("URL")}}, {{domxref("HTMLAnchorElement")}}, and {{domxref("HTMLAreaElement")}}.
This interface doesn't inherit any property.
':'
.':'
, and the port of the URL.'/'
followed by the path of the URL.'?'
followed by the parameters of the URL.'#'
followed by the fragment identifier of the URL.This interface doesn't inherit any method.
Specification | Status | Comment |
---|---|---|
{{SpecName('URL', '#urlutils', 'URLUtils')}} | {{Spec2('URL')}} | Initial definition |
{{ CompatibilityTable() }}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatNo}} [1] | {{CompatGeckoDesktop("22")}} [1] | {{CompatNo}} [1] | {{CompatNo}} [1] | {{CompatNo}} [1] |
searchParams | {{CompatUnknown}} | {{CompatGeckoDesktop("29")}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} |
username and password |
{{CompatUnknown}} | {{CompatGeckoDesktop("26")}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} |
origin |
{{CompatUnknown}} | {{CompatGeckoDesktop("26")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
origin on Windows.location |
{{CompatUnknown}} | {{CompatGeckoDesktop("21")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Chrome for Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | {{CompatNo}} [1] | {{CompatNo}} [1] | {{CompatGeckoMobile("22")}} [1] | {{CompatNo}} [1] | {{CompatNo}} [1] | {{CompatNo}} [1] |
searchParams | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatNo}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} |
username and password |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile("26")}} | {{CompatNo}} | {{CompatUnknown}} | {{CompatUnknown}} |
origin |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile("26")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
origin on Windows.location |
{{CompatUnknown}} | {{CompatUnknown}} | {{CompatGeckoMobile("21")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
[1] Though not grouped in a single abstract interface, these methods are directly available on the interfaces that implement it, if this interface is supported.