Use CustomEvent when supported