mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
See spec issue https://github.com/whatwg/html/issues/9869 Previous attempt on fixing reload had to be reverted because it broke Soundcloud and GitHub, but this change does not seem to introduce new crashes.
30 lines
923 B
HTML
30 lines
923 B
HTML
<!DOCTYPE html>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
let reloaded = false;
|
|
window.addEventListener('message', event => {
|
|
switch (event.data.action) {
|
|
case "loaded":
|
|
println("iframe is loaded");
|
|
if (!reloaded) {
|
|
event.source.postMessage({ action: 'reload' });
|
|
reloaded = true;
|
|
} else {
|
|
internals.signalTextTestIsDone();
|
|
}
|
|
break;
|
|
case "acknowledge-asked-to-reload":
|
|
println("iframe is going to reload");
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
});
|
|
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
const iframe = document.createElement('iframe');
|
|
iframe.src = "../../data/iframe-reload.html"
|
|
document.body.appendChild(iframe);
|
|
});
|
|
</script>
|