# url-polyfill

> Polyfill URL and URLSearchParams

Latest version **1.1.14** (published 2025-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install url-polyfill
pnpm add url-polyfill
yarn add url-polyfill
bun add url-polyfill
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.14 |
| Published | 2025-09-08 |
| First published | 2017-03-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 73.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 322 |
| Author | valentin |
| Maintainers | lifaon74 |

## Links

- npm: https://www.npmjs.com/package/url-polyfill
- Repository: https://github.com/lifaon74/url-polyfill
- Homepage: https://github.com/lifaon74/url-polyfill#readme
- Issues: https://github.com/lifaon74/url-polyfill/issues
- npm.io page: https://npm.io/package/url-polyfill

## Recent versions

- 1.1.14 (latest) — 2025-09-08
- 1.1.13 — 2025-02-08
- 1.1.12 — 2020-10-31
- 1.1.11 — 2020-10-14
- 1.1.10 — 2020-07-20
- 1.1.9 — 2020-05-13
- 1.1.8 — 2020-01-29
- 1.1.7 — 2019-07-14
- 1.1.6 — 2019-07-09
- 1.1.5 — 2019-03-05
- 1.1.3 — 2018-11-30
- 1.1.2 — 2018-11-28
- 1.1.1 — 2018-11-27
- 1.1.0 — 2018-09-03
- 1.0.14 — 2018-08-09
- … 14 more at https://npm.io/package/url-polyfill/versions

## README

### Polyfill URL and URLSearchParams to match last WHATWG specifications

Compliant in most of the use cases but not at 100% (like unicode chars, punycodes, etc...)

Tested on IE 10+

#### Install
```
npm i url-polyfill --save
```

#### Currently supported

##### window.URL

Documentation: https://developer.mozilla.org/en-US/docs/Web/API/URL

Supported : 'hash', 'host', 'hostname', 'href', 'port', 'protocol', 'search', 'toString', 'pathname', 'origin', 'searchParams'

Example:

```js
const url = new URL('https://www.example.com:8080/?fr=yset_ie_syc_oracle&type=orcl_hpset#page0');
```
- hash: `"page0"`
- host: `"www.example.com:8080"`
- hostname: `"www.example.com"`
- href: `"https://www.example.com:8080/?fr=yset_ie_syc_oracle&type=orcl_hpset#page0"`
- origin: `"https://www.example.com:8080"`
- pathname: `"/"`
- port: `"8080"`
- protocol: `"https:"`
- search: `"?fr=yset_ie_syc_oracle&type=orcl_hpset"`
- searchParams: URLSearchParams (see next)

##### window.URLSearchParams

Documentation: https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams

Supported : 'append', 'delete', 'get', 'getAll', 'has', 'set', 'forEach', 'keys', 'values', 'entries', 'toString', 'Symbol.iterator'

Example:

```js
const url = new URL('https://www.example.com/?fr=yset_ie_syc_oracle&type=orcl_hpset#page0');
url.searchParams.append('page', 0);
console.log(url.toString()); // print: "https://www.example.com/?fr=yset_ie_syc_oracle&type=orcl_hpset&page=0#page0"
```

---
_Source: https://npm.io/package/url-polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
