gecko-dev/browser/devtools/inspector/test/doc_inspector_remove-iframe...

44 строки
1.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>iframe creation/deletion test</title>
</head>
<body>
<div id="yay"></div>
<script type="text/javascript">
var yay = document.querySelector("#yay");
yay.textContent = "nothing";
// Create a custom event to let the test know when the window has finished
// loading.
var event = new Event("test-page-processing-done");
// Create/remove an iframe before load.
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.remove();
yay.textContent = "before events";
// Create/remove an iframe on DOMContentLoaded.
document.addEventListener("DOMContentLoaded", function() {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.remove();
yay.textContent = "DOMContentLoaded";
});
// Create/remove an iframe on window load.
window.addEventListener("load", function() {
var iframe = document.createElement("iframe");
document.body.appendChild(iframe);
iframe.remove();
yay.textContent = "load";
// Dispatch the done event.
window.dispatchEvent(event);
});
</script>
</body>
</html>