polyfill makes web development less frustrating by selectively polyfilling just what the browser needs. It can also be used as a service over HTTP and HTTPS connections.
<script src="//polyfill.io"></script>Whoa, where's the script file?
The script file is the domain.
A lot. For instance, you can use querySelectors in IE6.
var el = document.querySelector(".foo.bar");Or use matches or matchesSelector without a vendor prefix.
el.matches(".bar");The script is clean, compressed, and aggressively cached.
Android 2.2+, Blackberry 7+, Chrome, Opera 11.5+, Opera Mini 5+, Opera Mobile 10+, Firefox 3.6+, Internet Explorer 6+, Safari 4+, and Safari IOS 4+.
You should be able to use all of the following features to a reasonable extent in every supported browser.
abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section subline summary time video
Default HTML5 element styling is covered too, with the experimental .css query.
<link href="//polyfill.io?.css" rel="stylesheet">- Array.isArray
- Array.prototype.every
- Array.prototype.filter
- Array.prototype.forEach
- Array.prototype.indexOf
- Array.prototype.lastIndexOf
- Array.prototype.map
- Array.prototype.reduce
- Array.prototype.reduceRight
- Array.prototype.some
- Object.create
- Object.defineProperty
- Object.defineProperties
- Object.getOwnPropertyNames
- Object.getPrototypeOf
- Object.is
- Object.keys
- Element.prototype.querySelector / Element.prototype.querySelectorAll
- Element.prototype.matches / matchesSelector
- Element.prototype.getElementsByClassName
- Element.prototype.prepend
- Element.prototype.append
- Element.prototype.before
- Element.prototype.after
- Element.prototype.remove
- Element.prototype.replace
- Element.prototype.addEventListener / Element.prototype.removeEventListener / Element.prototype.dispatchEvent
- new Event / new CustomEvent
- DOMContentLoaded
- hashchange
- Window.prototype.localStorage
- Window.prototype.getComputedStyle
- Window.prototype.matchMedia
- Window.prototype.matchMedia.addListener
- Window.prototype.matchMedia.addListener
- Navigator.prototype.geolocation
- Element.prototype.classList
- Element.prototype.hasAttribute
- Element.prototype.placeholder
- Window.prototype.innerHeight
- Window.prototype.innerWidth
- Window.prototype.scrollX / Window.prototype.pageXOffset
- Window.prototype.scrollY / Window.prototype.pageYOffset
| Browser | Filesize |
|---|---|
| Chrome | 385 B |
| Internet Explorer 10+ | 396 B |
| Firefox 6+ | 397 B |
| Safari 6+ | 400 B |
| Safari (iOS 6) | 400 B |
| Safari 5.1 | 536 B |
| Opera 15+ | 899 B |
| Firefox 3.6 | 1.37 KB |
| Internet Explorer 9 | 1.93 KB |
| Safari 4 | 2.32 KB |
| Internet Explorer 8 | 5.58 KB |
| Internet Explorer 6/7 | 7.36 KB |
Thanks for reading. Now, please… enjoy!