This API is deprecated, you should use `CustomEvent()` instead: https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent
More details here: https://developer.mozilla.org/en-US/docs/Web/API/document.createEvent