<!DOCTYPE html>
<body>
</body>
<script>
const dialog = document.createElement("dialog");
dialog.innerText = "hello world";
document.body.appendChild(dialog);
dialog.showModal();
document.body.offsetWidth;
document.body.removeChild(dialog);
document.body.offsetWidth;
</script>