libVersion
is no longer supported. We no longer support using an older version of the polyfill collection with the current version of the service. To use an older polyfill library, use the version of the project that contains the library in the state you want it (not possible if using cdn.polyfill.io)gated
is no longer supported. Use flags
instead.Fetch a polyfill bundle.
Param | Where | Description |
---|---|---|
minify |
URL |
Whether to minify the result. If omitted, output will include the full polyfill source, and a header comment with debug information about the user agent and which polyfills have been included in the bundle. If set to .min , the output will be minified.
|
type |
URL |
Set to js . Currently we only support JavaScript polyfills, but the css type is reserved for future use.
|
features |
Querystring |
List of browser features to polyfill. Accepts a comma-separated list of feature names. Available feature names are shown on the Browsers and Features page, though group aliases such as 'es5' and 'es6' are also accepted (these are defined in the polyfills' config.json files - here's an example). Each feature name may optionally be appended with zero or more of the following flags:
Omitting or setting to an empty string is equivalent to the value "default", which is an alias for a curated list of the most popular polyfills. Setting the value "all" will select every feature in the library (this is an extremely bad idea and will be removed in a future version) |
excludes |
Querystring |
List of browser features to exclude from output. Accepts a comma-separated list of feature names. Available feature names are shown on the Browsers and Features page. Aliases and flags are not accepted. Omitting or setting to an empty string will exclude no polyfills. The main use case for this is where you want a polyfill but you don't want one or more of its dependencies. Note that it doesn't make any sense to list the same feature in both the |
flags |
Querystring | Comma separated list of flags to apply to all features. For available options see the list in the For example, |
ua |
Querystring |
User agent string to override the Normally, responses from the service will Vary on User-Agent. Setting the |
callback |
Querystring | Name of JavaScript function to call after polyfills are loaded. Must match the PCRE expression ^[\w\.]+$ otherwise will have no effect. Note that this feature differs from normal JSONp in that nothing is passed to the function - it is simply a way of triggering your own code when the polyfills have loaded, intended to allow the polyfill service to be more easily loaded asynchronously with async and defer attributes. |
unknown |
Querystring | What to do when the user agent is not recognised. Set to polyfill to return default polyfill variants of all qualifying features, ignore to return nothing. Use caution when setting this argument to 'polyfill' on large feature sets, since huge polyfill bundles may cause crashes or lockups in extremely old or underpowered user agents. Defaults to ignore . |
rum |
Querystring | Set to 1 to enable real user monitoring, allowing the polyfill service to gather performance data about itself using the resource timing API, where available, and to perform feature detection to improve our browser targeting. Turning this on will help us improve the service, and tune our browser targeting to better serve your particular users. Defaults to 0. In a future release this will be on by default, so if you want to opt out permanently, set it explicitly to 0 now. |