Web polyfill

An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & JSDelivr.

CI & CD

Usage example

  1. Find a Web feature in the Polyfill directory
  2. Copy the class name of the selected polyfill, then write it into a specific Script URL (shown below)
  3. the above script will detect whether current environment needs to be patched, then load the polyfill script original from JSDelivr

Web pages

<head>
    <script src="https://polyfill.web-cell.dev/feature/ResizeObserver.js"></script>
</head>

Web workers

self.importScripts('https://polyfill.web-cell.dev/feature/Regenerator.js');

Add more polyfills

  1. For junior engineers, you can submit an issue and wait for the maintainer reaction
  2. For senior engineers, just edit the Polyfill files, and make a pull request
  3. After your pull request reviewd & merged, the polyfills will be updated by GitHub actions automatically

Host your own mirror

  1. Fork this repository
  2. Replace original HTTP domain with yours in GitHub action configuration
  3. You can replace GitHub pages with an Object Storage service (AWS S3, etc.)

China mainland

Thanks for KaiYuanShe's donation, we get a fast local mirror for China mainland:

https://polyfill.kaiyuanshe.cn/

Custom examples

Edit .env content to fit your situation:

WAN_ICON=πŸ‡ΊπŸ‡¦
WAN_HOST=https://polyfill.example.ua
LAN_ICON=πŸ‡·πŸ‡Ί
LAN_HOST=https://polyfill.example.ru

or

WAN_ICON=πŸ‡°πŸ‡·
WAN_HOST=https://polyfill.example.kr
LAN_ICON=πŸ‡°πŸ‡΅
LAN_HOST=https://polyfill.example.kp

Inspired by

  1. https://polyfill.io/
  2. https://polyfiller.kaiyuanshe.cn/

All supported polyfills

No. Name Package Source Map Network
1 ECMAScript core-js-bundle πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
2 ECMAScript6 es6-shim πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
3 ECMAScript7 es7-shim πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
4 Proxy es6-proxy-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
5 Regenerator regenerator-runtime πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
6 DateTimeFormat @formatjs/intl-datetimeformat πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
7 DisplayNames @formatjs/intl-displaynames πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
8 GetCanonicalLocales @formatjs/intl-getcanonicallocales πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
9 ListFormat @formatjs/intl-listformat πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
10 Locale @formatjs/intl-locale πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
11 NumberFormat @formatjs/intl-numberformat πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
12 PluralRules @formatjs/intl-pluralrules πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
13 RelativeTimeFormat @formatjs/intl-relativetimeformat πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
14 Segmenter intl-segmenter-polyfill-rs-web πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
15 AdoptedStyleSheets construct-style-sheets-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
16 Detail details-element-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
17 Dialog dialog-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
18 ElementInternals element-internals-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
19 EventSubmitter event-submitter-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
20 IntersectionObserver intersection-observer πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
21 PointerEvents @wessberg/pointer-events πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
22 ResizeObserver resize-observer-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
23 ScrollBehavior scroll-behavior-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
24 WebAnimation web-animations-js βœ… πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
25 WebComponents @webcomponents/webcomponentsjs βœ… πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
26 AbortController yet-another-abortcontroller-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
27 Clipboard clipboard-polyfill βœ… πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
28 EventTarget event-target-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
29 Fetch whatwg-fetch πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
30 PWAManifest pwacompat πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
31 Share share-api-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
32 TextEncoder fastestsmallesttextencoderdecoder-encodeinto βœ… πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
33 URL url-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
34 URLPattern urlpattern-polyfill πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³