Menu

gitpiper

Polyfill.io Cheat Sheet in May 2023

Last Updated: 16 May 2023

README.md

Usage

Default usage

<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>

{: .-wrap}

This is the default script for Polyfill.io.

References

Optimized

For modern browsers

<script>if(!(window.Promise&&[].includes&&Object.assign&&window.Map)){document.write('<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></scr'+'ipt>')}</script>

This only includes polyfill.io when necessary, skipping it for modern browsers for faster load times.

Extra features

<script>if(!(window.fetch&&window.Promise&&[].includes&&Object.assign&&window.Map)){document.write('<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,fetch"></scr'+'ipt>')}</script>

This is the same as the previous, but also adds a polyfill for window.fetch(). We add a window.fetch check and loads the additional fetch feature.


338+ more cheat sheets for you in May 2023

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2023 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️