x-tag / core

The Heart of X-Tag
http://x-tag.github.io/
Other
1.25k stars 151 forks source link

Fix for prefix detection on IE #170

Closed asppsa closed 4 years ago

asppsa commented 7 years ago

This is a proposed solution for #164. The issue there is that x-tag looks for an ms prefix in window, but won't find one there in IE11. On that browser (and presumably IE10 too) it needs to instead look in window's prototype.

I've tested this by running the specs on Firefox, Chrome, IE11 and Edge, but not IE<11. The patch uses Object.getPrototypeOf(), which should be available on IE9+ according to caniuse.

I get that this code also needs to work on lots of browsers that I don't have access to, so I've tried to keep the logic similar to what was already there. I did however add a match on /,(webkit)/ before /,(O)/ ...

Happy to iterate on this if you have any feedback.