Web polyfill

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

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 UnPkg

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.NamePackageSource MapNetwork
1ECMAScriptcore-js-bundleπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
2ECMAScript6es6-shimβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
3ECMAScript7es7-shimπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
4Proxyes6-proxy-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
5Regeneratorregenerator-runtimeπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
6DateTimeFormat@formatjs/intl-datetimeformatπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
7DisplayNames@formatjs/intl-displaynamesπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
8GetCanonicalLocales@formatjs/intl-getcanonicallocalesπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
9ListFormat@formatjs/intl-listformatπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
10Locale@formatjs/intl-localeπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
11NumberFormat@formatjs/intl-numberformatπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
12PluralRules@formatjs/intl-pluralrulesπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
13RelativeTimeFormat@formatjs/intl-relativetimeformatπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
14Segmenterintl-segmenter-polyfill-rs-webπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
15AdoptedStyleSheetsconstruct-style-sheets-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
16DeclarativeShadowDOMdeclarative-shadow-dom-polyfillβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
17Detaildetails-element-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
18Dialogdialog-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
19ElementInternalselement-internals-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
20EventSubmitterevent-submitter-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
21FormDataSubmitter@tech_query/formdata-submitter-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
22IntersectionObserverintersection-observerπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
23PointerEvents@wessberg/pointer-eventsβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
24ResizeObserverresize-observer-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
25ScrollBehaviorscroll-behavior-polyfillβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
26WebAnimationweb-animations-jsβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
27WebComponents@webcomponents/webcomponentsjsβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
28AbortControllerabortcontroller-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
29Clipboardclipboard-polyfillβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
30EventTargetevent-target-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
31EyeDroppereyedropper-polyfillβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
32Fetchwhatwg-fetchπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
33FileSystem@tech_query/native-file-system-adapterβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
34IndexedDBindexeddbshimβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
35Locknavigator.locksπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
36PWAManifestpwacompatπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
37Shareshare-api-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
38Streamweb-streams-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
39TextEncoderfastestsmallesttextencoderdecoder-encodeintoβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
40URLurl-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
41URLPatternurlpattern-polyfillβœ…πŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³
42WakeLockwakelock-lazy-polyfillπŸ‡ΊπŸ‡³ πŸ‡¨πŸ‡³