Add support for window.addEventListener