The “load” event on document elements bubbles, but it stops bubbling at the Document object and does not propagate on to the Window object.
<h1 id="h1">Hello from the script!</h1>
<script>
// catch on document
document.addEventListener("hello", function(e) {
console.log("Hello from " + e.target.tagName); // Hello from H1
});
// ⭐️ bubbling event
let event = new Event("hello", {bubbles: true});
// dispatch on h1
h1.dispatchEvent(event);
</script>