Picture, srcset and sizes is now gaining some traction in browsers so why download picturefill by default? This gist (hopefully) only loads picturefill if it is required using a test from picturefill itself.
Test it out here
- Safari 8 (Poor support, loads picturefill)
- Safari 9 (Limited support, loads picturefill)
- Chrome 45 (Good support, picturefill not required, doesn't load)
- Firefox 40 (Good support, picturefill not required, doesn't load)
- Opera 31 (Good support, picturefill not required, doesn't load)
- IE 8 (Haha, what is this support word? loads all the things)
- IE 9 (Poor support, loads picturefill)