Closed dgraham closed 9 years ago
Isn't this a WebKit bug?
If so, you could just change the if statement to...
if ((!window.CustomEvent || typeof window.CustomEvent !== 'function')&&!( 'WebkitAppearance' in document.documentElement.style)) {
Updated the polyfill with behavior as suggested by @dgraham, thanks! Added some test cases that can be run against sauce labs locally (cant get their badges working correctly). These are currently passing against ie 9-11 on win7 and safari 7, 8 and 8.2 (ios).
All changes are in effect on v0.2.1
:zap:
The
typeof window.CustomEvent === 'function'
test returns false for Safari. This Safari bug incorrectly reports constructable types as "object" rather than "function", which causes the polyfill to override Safari's native support for theCustomEvent
constructor.Another way to detect support for the constructor is to call it and trap any resulting errors. This would work around the bug in Safari.