Skip to content

Instantly share code, notes, and snippets.

@henix
Created March 26, 2019 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henix/bb3852b8176c9e26043e7cafc8ad6364 to your computer and use it in GitHub Desktop.
Save henix/bb3852b8176c9e26043e7cafc8ad6364 to your computer and use it in GitHub Desktop.
Add polyfills for modern html
<script>
if (typeof Promise == "undefined") {
document.write('<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.0/dist/polyfill.min.js"><\/script>');
}
if (window.URL && window.URL.prototype && ('href' in window.URL.prototype)) {
} else {
document.write('<script src="https://cdn.jsdelivr.net/gh/arv/DOM-URL-Polyfill@e54d67f/src/url.min.js"><\/script>');
}
if (typeof URLSearchParams == "undefined") {
document.write('<script src="https://cdn.jsdelivr.net/npm/@ungap/url-search-params@0.1.2/min.js"><\/script>');
}
if (typeof fetch == "undefined") {
document.write('<script src="https://cdn.jsdelivr.net/npm/whatwg-fetch@3.0.0/dist/fetch.umd.min.js"><\/script>');
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment