Skip to content

Commit

Permalink
fix(playground): dispatch load on document, only bubble DOMContentLoaded
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner committed Apr 18, 2024
1 parent 7b835fb commit c1c88d0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/public/runner.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@
script.textContent = state.js;
document.body.appendChild(script);

["DOMContentLoaded", "readystatechange", "load"].forEach((type) => {
document.dispatchEvent(new Event(type, { bubbles: true }));
});
document.dispatchEvent(
new Event("DOMContentLoaded", { bubbles: true })
);
document.dispatchEvent(new Event("readystatechange"));
window.dispatchEvent(new Event("load"));

initialized = true;
}
window.addEventListener("message", (event) => {
Expand Down

0 comments on commit c1c88d0

Please sign in to comment.