CustomEvent shim for Safari