URLBaseline · Widely available
A URL object represents a web address, like https://example.com/, and parts of the address, such as the domain, path, and query string (as URLSearchParams).
Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Jul 29, 2015. Widely available since Jan 29, 2018.
Browser support
DesktopChrome
1–31Not supported
32+Supportedsince Jan 14, 2014
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–18Not supported
19+Supportedsince Feb 19, 2013
Current: 157Safari
1–6Not supported
7+Supportedsince Oct 22, 2013
Current: 27MobileChrome Android
18–31Not supported
32+Supportedsince Jan 15, 2014
Current: 155Firefox Android
4–18Not supported
19+Supportedsince Feb 19, 2013
Current: 157Safari iOS
1–6Not supported
7+Supportedsince Sep 18, 2013
Current: 27How to use
This feature is Baseline widely available — use it freely, no fallback needed.
Example
Full syntax and examples are on MDN: URL.
Feature detection
JS · check before using
if ("URL" in globalThis) {
// URL is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (38). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| URL | 32 | 12 | 19 | 7 | 32 | 19 | 7 |
| URL.URL | 32 | 12 | 26 | 14.1 | 32 | 26 | 14.5 |
| URL.hash | 32 | 13 | 22 | 7 | 32 | 22 | 7 |
| URL.host | 32 | 13 | 22 | 7 | 32 | 22 | 7 |
| URL.hostname | 32 | 13 | 22 | 10 | 32 | 22 | 10 |
| URL.href | 32 | 13 | 22 | 10 | 32 | 22 | 10 |
| URL.origin | 32 | 12 | 26 | 10 | 32 | 26 | 10 |
| URL.parse_static | 126 | 126 | 126 | 18 | 126 | 126 | 18 |
| URL.password | 32 | 12 | 26 | 10 | 32 | 26 | 10 |
| URL.pathname | 32 | 13 | 22 | 10 | 32 | 22 | 10 |
| URL.port | 32 | 13 | 22 | 10 | 32 | 22 | 10 |
| URL.protocol | 32 | 13 | 22 | 10 | 32 | 22 | 10 |
| URL.search | 32 | 13 | 22 | 10 | 32 | 22 | 10 |
| URL.searchParams | 51 | 17 | 29 | 10.1 | 51 | 29 | 10.3 |
| URL.toJSON | 71 | 17 | 54 | 11 | 71 | 54 | 11 |
| URL.toString | 32 | 17 | 54 | 7 | 32 | 54 | 7 |
| URL.username | 32 | 12 | 26 | 10 | 32 | 26 | 10 |
| URLSearchParams | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.@@iterator | 49 | 17 | 44 | 10.1 | 49 | 44 | 10.3 |
| URLSearchParams.URLSearchParams | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
Show 18 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| URLSearchParams.URLSearchParams.USVString | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.URLSearchParams.record | 61 | 17 | 54 | 11 | 61 | 54 | 11 |
| URLSearchParams.URLSearchParams.sequence | 58 | 17 | 53 | 11 | 58 | 53 | 11 |
| URLSearchParams.append | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.delete | 49 | 17 | 29 | 14 | 49 | 29 | 14 |
| URLSearchParams.delete.value_parameter | 117 | 117 | 115 | 17 | 117 | 115 | 17 |
| URLSearchParams.entries | 49 | 17 | 44 | 10.1 | 49 | 44 | 10.3 |
| URLSearchParams.forEach | 49 | 17 | 44 | 10.1 | 49 | 44 | 10.3 |
| URLSearchParams.get | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.getAll | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.has | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.has.value_parameter | 117 | 117 | 115 | 17 | 117 | 115 | 17 |
| URLSearchParams.keys | 49 | 17 | 44 | 10.1 | 49 | 44 | 10.3 |
| URLSearchParams.set | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.size | 113 | 113 | 112 | 17 | 113 | 112 | 17 |
| URLSearchParams.sort | 61 | 17 | 54 | 11 | 61 | 54 | 11 |
| URLSearchParams.toString | 49 | 17 | 29 | 10.1 | 49 | 29 | 10.3 |
| URLSearchParams.values | 49 | 17 | 44 | 10.1 | 49 | 44 | 10.3 |