Simpler polyfill, any big differences?
niksy opened this issue · 3 comments
https://github.com/jonathantneal/polyfill/blob/master/source/Window.prototype.matchMedia.js
Are there any big differences in using your polyfill instead of the linked one? Support for more features such as media types is the one thing that comes to my mind.
I think it depends on what you want to support. I original developed this when I needed to support IE6+. It wasn't enough to just support it either. I wanted it to be as performant as possible. At one time, this repo was many 100s of times faster than any other version that also supported older browsers. Since then, I've contributed to https://github.com/paulirish/matchMedia.js which is really for IE9 and other devices that support matchMedium such as older Android browsers.
In short, do what best fits your needs. You now have 3 options to choose from. Good luck and thanks for your participation.
David
What did you end up choosing for your project? Did you have any more questions or clarification needed? I'm going to go ahead and close out this question if you have nothing else.
Thanks
Oh, yeah, sorry for not answering. I’m still using your polyfill, I think it has much better coverage, and as you say, it’s more performant than other solutions.