URLPatternBaseline · Newly available
The URLPattern API creates patterns that can be matched against URLs or URL components.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Sep 15, 2025.
Browser support
DesktopChrome
1–94Not supported
95+Supportedsince Oct 19, 2021
Current: 155Edge
12–94Not supported
95+Supportedsince Oct 21, 2021
Current: 154Firefox
1–141Not supported
142+Supportedsince Aug 19, 2025
Current: 157Safari
1–18.6Not supported
26+Supportedsince Sep 15, 2025
Current: 27MobileChrome Android
18–94Not supported
95+Supportedsince Oct 19, 2021
Current: 155Firefox Android
4–141Not supported
142+Supportedsince Aug 19, 2025
Current: 157Safari iOS
1–18.6Not supported
26+Supportedsince Sep 15, 2025
Current: 27How to use
Every current browser supports this, but it only became Baseline on Sep 15, 2025. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: URLPattern.
Feature detection
JS · check before using
if ("URLPattern" in globalThis) {
// URLPattern is available
} else {
// load a polyfill or use a fallback
}Documentation (MDN)
Specification
Sub-features
Support for each part of the feature (14). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| URLPattern | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.URLPattern | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.URLPattern.ignoreCase_option | 107 | 107 | 142 | 26 | 107 | 142 | 26 |
| URLPattern.exec | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.hasRegExpGroups | 122 | 122 | 142 | 26 | 122 | 142 | 26 |
| URLPattern.hash | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.hostname | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.password | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.pathname | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.port | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.protocol | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.search | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.test | 95 | 95 | 142 | 26 | 95 | 142 | 26 |
| URLPattern.username | 95 | 95 | 142 | 26 | 95 | 142 | 26 |