-
Notifications
You must be signed in to change notification settings - Fork 0
HTML5 Cross Browser Polyfills
So here we're collecting all the shims, fallbacks, and polyfills in order to implant html5 functionality in browsers that don't natively support them.
The general idea is that: we, as developers, should be able to develop with the HTML5 apis, and scripts can create the methods and objects that should exist. Developing in this future-proof way means as users upgrade, your code doesn't have to change but users will move to the better, native experience cleanly.
Looking for a way to conditionally load these scripts client-side based on feature detects? See Modernizr. Looking for a guide to writing your own polyfills? See Writing Cross-Browser JavaScript Polyfills.
-
svgweb by Brad Neuberg & others
- Fallback via Flash
-
Raphaël by Dmitry Baranovsky
- Abstracted API. adds features. fallback for IE via VML
- Ample SDK by Sergey Ilinsky
-
canvg by Gabe Lerner
- Writes SVG to canvas. Good for Android
-
SVG Boilerplate
- Alpha and still buggy, but handle multiple concurrent SVG shims together
-
SIE SVG library by dhrname
- Fallback to VML for oldIE
-
dojo gfx by Eugene Lazutkin, Kun Xi, Chris Mitchell
- Fallback via VML, Canvas, Silverlight and Flash
-
fabric.js by kangax
- Can render SVG via canvas
- inline SVG polyfill by mstalfoort
- FakeSmile by David Leunen
-
FlashCanvas by Shinya Muramatsu
- Reported to have 33x better performance than excanvas
- excanvas by google, erik arvidsson
- slcanvas project (Original Silverlight bridge, demo page)
-
canvas-text
- Only necessary for canvastext in IE, really
- fxCanvas
- **storage polyfill by Joshua Bell
- storage polyfill by Remy Sharp
- sessionstorage by Andrea Giammarchi
- Amplify.js by appendTo
- YUI3 CacheOffline by YUI team
- textStorage.js by sofish Using localStorage API, fallback for IE6+
- ssw by Matthias Schäfer
- $.store by Rodney Rehm
- lawnchair by Brian Leroux
- webstorage by Ryan Westphal
- store.js by Marcus Westin
- PersistJS by Paul Duncan
- Squirrel.js by Aaron Gustafson
-
html5shiv by afarkas, Jon Neal & community
- Enables for print use, as well
-
innerShiv by Joe Bartlett
- Enables elements for innerHTML use (deprecated, replaced by html5shiv)
-
html5media
- Uses flowplayer swf for fallback.
-
mediaelement.js by John Dyer
- swf player that mimics HTML5 media API. Consistent UI across browsers and flash.
<track>
support.
- swf player that mimics HTML5 media API. Consistent UI across browsers and flash.
-
SublimeVideo
- World's first zero maintenance HTML5 video player as a service solution.
-
video.js by Zencoder
- Device fixes.
<track>
support
- Device fixes.
-
video for everybody by Kroc Camen (orig.)
- The granddaddy of
<video>
fallbacks. Markup-based solution, works without javascript. A must read.
- The granddaddy of
- videosub
- JSCaptions by Daniel Davis
- Captionator by Christopher Giffard (Supports WHATWG TextTrack spec & has experimental support for MediaTracks/synchronised media elements)
- playr by Julien Villetorte (support both WebVTT & SubRip files)
- jPlayer custom player with jQuery dependency, flash fallback
- audio.js custom player, flash fallback by ab+c
- SoundManager2 custom player, flash fallback, api, extensive documentation
- transitionEnd Agnostic lib cross-browser to work with event transitionend.
-
IndexedDB Polyfill by Parashuram
- Polyfill for IndexedDB on WebSql
- Tested on IndexedDB libraries like PouchDB, JqueryIndexedDB Plugin, Linq2IndexedDB and DBJS
- clientdb.js Requires gears. non-html5 api
- webstorageportabilitylayer Requires gears. non-html5 api
- SQLjs Requires gears. non-html5 api
- DomSQL Non-html5 api
- localStorageDB Non-html5 api
- LocalStorageDB.js Non-html5 api
- Webshims Lib Several Polyfills including Constraint Validation and several input-widgets by Alexander Farkas
- H5F by Ryan Seddon
- webforms2 by Weston Ruter
- h5Validate by Eric Hamilton
- nwx forms (demo) by Diego Perini
-
html5widgets by Zoltan Hawryluk
- uses webforms2 a few other battle-tested scripts for datepicker and colorpicker.
-
Accessible and unobtrusive slider /
<input type=range>
polyfill by Brian McAllister -
<input type=range>
shim for Firefox 4 by Frank Yan -
<input type=number>
shim by jonstipe - jquery.html5form by Matias Mancini
- gallery-html5-forms YUI3 gallery module (HTML5-enable forms for legacy browsers; requires YUI3) by Matt Snider
- jscolor Polyfill version of jscolor by Jan Odvárko. by Johannes J. Schmidt
- HTML5 Form Shim by Dmitry Sheiko
- jQuery form shim by Andrew Dodson
- selectedOptions multiple <select> shim by Brett Zamir
-
HTML5 placeholder polyfill by Dirk Ginader (jQuery powered with a focus on accessibility)
- Option can be set so that [the label doesn't disappear on focus] (http://stackoverflow.com/questions/8574356/html5-placeholder-disappears-on-focus), only when entering text.
- Requires a label for every input, or the placeholder won't work - Placeholder jQuery plugin by Mathias Bynens
- Placeholder Enhanced by Denis Ciccale
- jQuery-Placeholder by Daniel Stocks
- jquery html5 placeholder by miketaylr (Not touch input's value)
- jquery-placeholder by Brian Reavis (doesn't set input's value)
- jquery.HTML5Support (supports placeholder and autofocus) by Amiel Martin
- jquery.placeholder.js by Paul Serby
- Placeholders.js - An HTML5 placeholder attribute polyfill by James Allardice (non-jQuery, works in IE6+, and also now allows for placeholders that don't disappear on focus)
- placeholder-augment by Jethro Larson (jQuery, IE6, iPhone, android, etc. Placeholders don't disappear on focus.)
- (Personally I can't think of a good reason to use fake workers... Just sayin')
- fakeworker
- web worker api shim
- SockJS by Marek Majkowski
-
socket.io by Guillermo Rauch
- Abstracts API and adds features
-
kaazing websocket gateway
- Commercial product. pure polyfill.
-
web-socket-js
- Supports CORS fallback
-
atmosphere jQuery plugin
- Fallback to comet long-polling
-
Graceful WebSocket jQuery plugin by David Lindkvist
- Fallback to comet long-polling
-
Portal by Donghwan Kim
- Server agnostic and supports Sharing connection, WebSocket, Server-Sent Events, Streaming and Long polling.
-
DataChannel polyfill by Jesús Leganés Combarro "Piranna"
- Add support for WebRTC DataChannels using a WebSockets proxy server as backend
- Webshims Lib by Alexander Farkas
- geolocation polyfill by Joshua Bell
- geolocation shim by Paul Irish
-
geo-location-javascript
- Mobile-centric: non-standard blackberry and webos tricks
- Geolocation-API-Polyfill by Manuel Bieh
- html5-gears by Brad Neuberg
- offline-event.js by Remy Sharp (Opera not supported, and Safari doesn't update navigator.onLine property)
- History.js by Benjamin Lupton - (optional hashchange fallback for HTML4 browsers)
- HTML5-History-API by Dmitriy Pakhtinov - lightweight and fully standardize compliant implementation of History API with IE6+ support and hashchange implementation
-
- PJAX (pushState + ajax = pjax) by Chris Wanstrath (not a polyfill)
- hashchange jQuery event by Ben Alman
- HistoryManager Mootools Plugin by Arieh Glazer
- SWFAddress (popular among Flash developers) & jQuery Address by Asual DZZD
- jQuery History Plugin by Benjamin Lupton
- jQuery Ajaxy by Benjamin Lupton
- Hasher by Miller Medeiros
- sHistory by Andrew Udvare
- EventSource by Remy Sharp
- jQuery.EventSource by Rick Waldron
- EventSource by Yaffle
- APNG-Canvas by Давид Мзареулян
-
png.js by Devon Govett
- Parses and renders PNGs both animated and static to a canvas element with putImageData
- Cross-browser ruby annotations using CSS by Zoltan Hawryluk
-
Accessible
<details>
fallback via jQuery by Mathias Bynens (repository) -
Another
<details>
alternative, also based on jQuery by Manuel Bieh - jquery-details by Denis Sokolov.
- Pure JS polyfill with DOM API and IE6+ support by Егор Халимоненко
- Deets - jQuery UI Widget based fallback + enhancements by Gregory Waxman
-
<meter>
fallback by strings28 -
<meter>
jQuery plugin/shim by xjamundx
-
<progress>
polyfill by Lea Verou -
<menu type="context">
polyfill by Rodney Rehm
-
dataset
fallback by Eli Grey -
dataset
fallback rewritten by Brett Zamir
- jQuery HTML5 datalist plugin by miketaylr.
- Relevant Dropdowns by Chris Coyier.
- datalist fallback by adactio. Not a polyfill, but it's done with PE.
- Webshims Lib has support for datalist-element (includes input[list], input[selectedOption], datalist[options]) by Alexander Farkas
- Polyfill for 'reversed' attribute on ordered lists by Louis Lazaris. Also integrates with the 'start' attribute, which has 100% browser support. See also: Reverse Ordered Lists in HTML5
- A vanilla-js polyfill (with
start
attribute support)
-
Scoped Styles by Simon Madine
- jQuery Plugin to enable the scoped attribute on style blocks so they only affect their parent element's children.
-
dropfile.js by Andrew Dodson
- Creates the FileReader part of the FileAPI via silverlight for drag and drop files
-
FileSaver.js by eli grey
- incl BlobBuilder shim
-
FileReader.js by Jahdrien
- Creates FileReader and FileAPI using Flash, jQuery and jQuery UI
- No drag and drop support!
-
FileAPI by Konstantin Lebedev (© Mail.ru Group)
- Multiupload: all browsers that support HTML5 or Flash
- Drag'n'Drop upload: files (HTML5) & directories (Chrome 21+)
- Upload one file: all browsers
- Working with Images: IE6+, FF 3.6+, Chrome 10+, Opera 11.1+, Safari 5.4+
-
idb.filesystem.js by Eric Bidelman
- HTML5 Filesystem API polyfill that uses IndexedDB as a storage layer.
-
window.saveAs by Andrew Dodson
- Simple shim (for IE10 current Chrome and FireFox)
-
jDataView by vjeux
- DataView polyfill for structured data
- Typed Arrays by Joshua Bell
- David Chambers'
window.btoa
andwindow.atob
polyfill - Base64 with concatenated strings support and some testing
- getUserMedia.js by Addy Osmani provides a cross-browser shim for getUserMedia() camera access.
- jebgl uses a java applet to emulate.
- webgl-compat maps the API to 2D canvas
- cwebgl
- IEWebGL
-
XAudioJS by Grant Galitz
- Audio sample stream output thin-abstraction library that supports mono and stereo audio, as well as resampling the audio stream.
- Supports the Mozilla Audio Data API, Web Audio API, Adobe Flash 10, real-time WAV PCM Data URI generation
- dynamicaudio.js by Ben Firshman
- audiolib.js by Jussi Kalliokoski
- classList.js by Eli Grey.
- Minimal classList shim by Devon Govett.
-
easyXDM by Sean Kinsey
- Implements XDM and RPC in most browsers since IE6. Also ships with an endpoint for exposing ajax across the domain boundary.
- postMessage jquery plugin by Ben Alman.
-
pmxdr by Eli Grey.
- Implements a cross-domain XHR. Note that sites being requested must have a pmxdr host.
- postmessage-proxied-xhr (PPX) by Atul Varma.
-
flXHR by Kyle Simpson
- Provides XHR API using Flash transport mechanism. Target server must have a crossdomain.xml policy file.
- Flow implements DOM3 in IE6+
- DOM-shim implements DOM4 in IE8+
document.head
- url.js implements the W3C URL API, by Erik Arvidsson
- DOM Keyboard Event Level 3 polyfill with optional IE6-8 support, by Егор Халимоненко
- DOMImplementation.prototype.createDocument
-
Rangy by Tim Down.
- Implements DOM Range and Selection APIs in IE < 9.
- insertAdjacentHTML.js by Eli Grey, implements insertAdjacentHTML
- outerHTML.js by Eli Grey, implements outerHTML
-
DOMParser HTML extension by Eli Grey, implements DOMParser
text/html
support
- js-xpath provides document.evaluate/createNSResolver/createExpression and XPathResult/XPathNSResolver/XPathExpression support.
- Array.prototype methods from MDN: indexOf, lastIndexOf, forEach, every, filter, some, map, reduce, reduceRight
- es5-shim by Kris Kowal, Tom Robinson, community.
-
Xccessors by Eli Grey.
- Implements ES5 accessors (getters and setters) for browsers supporting legacy methods and/or legacy methods for browsers supporting ES5.
-
getters and setters by the IE team.
- Pick up get/set'ers for DOM elements in IE8
- json2.js by Douglas Crockford
- json3.js by Kit Cambridge
- ddr-ecma5 by David de Rosier
- augment.js by Oliver Nightingale
-
String.js by Brett Zamir
- Allows array-like accessors on strings created via
new String()
(admittedly, not very useful)
- Allows array-like accessors on strings created via
- ECMAScript 6 polyfil by Alexander Guinness.
- es6-shim by Paul Miller.
- WeakMap, Map, Set, HashMap - ES6 Collections by Brandon Benvie.
-
ES6 Map Shim by Eric Wendelin.
- Destructive shim that follows the latest specification as closely as possible.
- selectivizr by Keith Clark
- Transformie by Paul Bakaus
- CSS Sandpaper by Zoltan Hawryluk
-
cssFx - by Ivan Malopinsky
- Standalone, lightweight, client-side JS; supports almost all CSS3 properties
-
CSS Crush
- A PHP based CSS pre-processor for handling vendor prefixes, CSS variables, data-uris and minification
-
CSS Agent by Keith Clark
- A ASP.Net based CSS pre-processor for handling vendor prefixes, CSS variables and minification
- jQuery Css3 Finalize by Han Lin Yap
-
CSS3 PIE by Jason Johnston
- CSS3 decoration rendering for IE 6-9. Supports: border-radius, box-shadow, multiple backgrounds, linear gradients, border-image
-
Flexie by Richard Herrera
- Flexible box model. (flexbox) Supports: box-orient, box-align, box-direction, box-pack, box-flex, box-ordinal-group
- CSS Template Layout jQuery plug-in by Alexis Deveria
-
CSS3 - Multi Column by Cédric Savarese
- Supports: column-count, column-width, column-gap, column-rule
-
CSS3 - REM Unit conversion by Chuck Carpenter and Lucas Serven
- Evaluates stylesheets for REM declarations, converts them to pixels and appends to the HEAD. Has no dependancies, but can easily be implemented with Modernizr/Yepnope for loading.
-
jQuery Text Shadow by heygrady
- Text-shadow action via jQuery plugin API
-
jQuery Text Overflow plugin by Devon Govett, Andrew A. Kononykhin, Micky Hulse
- Text-overflow via jQuery plugin API (for developing standard)
-
Regions.js by Robin Ricard
- CSS3-regions via jQuery plugin API (for developing standard)
-
borderBoxModel by Alberto Gasparin
-
box-sizing: border-box;
javascript polyfill for IE6+
-
-
box-sizing-polyfill by Christian "Schepp" Schaefer
-
box-sizing: border-box;
for IE6 and IE7 via Microsoft's proprietary CSS behavior / .htc-script
-
-
Borderbox for Compass by Richard Herrera
-
box-sizing: border-box;
polyfill for SASS/Compass. Outputs equivalent CSS for IE6 & 7
-
-
Units by Grady Kuhnline
- Units is a JavaScript library for converting between angle and length units (including the 'rem' unit). Both are intended for use within other libraries that need to convert between acceptable CSS units when creating polyfills.
-
cssMinMax by Russ Porosky
-
min()
andmax()
jQuery plugin polyfill - Includes JSCSSP, so it's a bit large
-
-
jQuery.object-fit.js by Steve Workman (fork of Simon Schmid's work)
- CSS3 object-fit via jQuery plugin API. Currently supports:
object-fit: contain|cover;
(for developing standard)
- CSS3 object-fit via jQuery plugin API. Currently supports:
-
Polyfilter - a CSS Filters Polyfill by Christian "Schepp" Schaefer
- CSS filter effects for Chrome 20+, Safari 6+, Firefox 4+, IE 6 - 9 and some mobile browsers.
- css3-mediaqueries-js
-
Respond by Scott Jehl
- A fast & lightweight polyfill for min/max-width CSS3 Media Queries (for IE 6-8, and more)
-
mediatizr by Aurélien Delogu
- Responsive-oriented CSS3 media queries polyfill
-
matchMedia by Scott Jehl, Paul Irish, Nicholas Zakas
- A standardized way to check media query matching in script.
-
jQuery Media Helpers by Scott Jehl
- Some media query and cross-browser responsive design helpers, abstracted from jQuery Mobile
- cssParentSelector by Kasper Mikiewicz
-
CSS3/4 querySelectorAll and matches polyfill by Егор Халимоненко. Pure JS with optional IE6/7 support. Currently CSS4 Selector API supporting:
- subject of a selector: "div! a[href*=twitter]"
- :scope pseudo-class: ":scope>*:nth-child(2n+1)"
- nodesRef:
document.querySelector("a", <div>)
-><a>
child of<div>
- -image-set on img elements by Fabian Tollenaar
- CSS.supports polyfill by Егор Халимоненко
- microdatajs by Philip Jägenstedt
-
Microdata-JS by Егор Халимоненко
- Pure JS (Extending Element.prototype with IE6+ support)
- notification.js by Andrew Dodson
- xbl.js by Sergey Ilinsky
-
jiagra by Samy Kamkar
- A psuedo-polyfill for preloading pages to browser cache
-
Mozilla Shumway
- Flash VM and runtime written in JavaScript.
-
Google Swiffy
- Webapp converts SWF to HTML+JS. Supports subset of SWF 8 and ActionScript 2.0, and webkit-only output.
-
Adobe Wallaby
- Desktop app converts FLA to HTML+JS.
-
Gordon
- Javascript that interprets SWFs live. Plays only SWF1 files completely, as well as most of the SWF2 features.
- Visibility.js by Andrey Sitnik
- visibly.js by Addy Osmani
-
Page Visibility shim for jQuery by Mathias Bynens
- The HTML5 Page Visibility API allows you to determine whether your web page is visible to the user, is hidden in background tab or is prerendering. visibility.js deals with vendor-prefixes and provides a fallback for browsers without this API by assuming the page is always visible. However, this is a wrapper more than a polyfill.
-
hyphenator by Mathias Nater
-
CSS3 defines six properties and an at-rule that influence hyphenation.
hyphenator
is a JavaScript implementation with pattern files for many languages.
-
CSS3 defines six properties and an at-rule that influence hyphenation.
- mediacapture.js by João Martins
-
requestAnimationFrame
by Erik Möller - iScroll - The overflow:scroll for mobile webkit
RadioNodeList
polyfill- screenfull.js - Simple wrapper for cross-browser usage of the JavaScript Fullscreen API
-
<marquee scrollamount="100%">blink</marquee>
- HTML-only polyfill for the no longer supported<blink>
element. - rsvp.js - Implementation of Promises/A with mixin for turning objects into event targets.
- Webshims Lib several Polyfills using lightweight capability based loading concept (shiv, innershiv, canvas, forms, ES5, localStorage/sessionStorage, JSON, geolocation) by Alexander Farkas
- Assorted file formats decoding of several file formats done in javascript, documented on the excellent jswiki
- Polyfill.js Polyfills loaded dynamically based on need (list of available polyfills on the linked page) by James Brumond
- ES5/DOM shim implements DOM API and EcmaScript 5 (and some from ES6), and bug fixing in IE6+ and other browsers:
- Add methods such [add/remove]EventListener, querySelector[All], setSelectionRange, etc in IE6+
- Add Element/Node properties such classList, children, [first/last]ElementChild, reversed, control, labels, etc in IE6+
- Add methods such insertAdjacentHTML (old FF), stopImmediatePropagation (Opera < 12) and properties reversed, control, labels, etc in W3C browsers
- Add ES5/6 methods in all browsers
- Add DOM4 methods append, prepend, after, before, replace, remove, match in all browsers
- Provide bugs fixing for DOM and ES in IE, Opera, Chrome, FF
- and more with low cost (~8KiB for W3C browsers, ~16KiB for IE8 and ~18KiB for IE6/7 [gzip])
-
Google Chrome Frame
- Not exactly a feature shim, but... well... It'll help. :)
-
ie7.js, ie8.js, ie9.js by Dean Edwards
- A JavaScript library to make MSIE behave like a modern browser. Many fixes including PNG transparency, CSS styles/selectors, rendering bug fixes, etc.
Edited and maintained by Paul Irish. Contributions from Jonathan Cook, Mark Boas, Michael Behan, Mathias Bynens, Eli Grey, Øyvind Sean Kinsey, and others.