<!DOCTYPE html> | |
<html> | |
<body> | |
<script> | |
window.addEventListener("beforeunload", (event) => { | |
xhr = new XMLHttpRequest(); | |
xhr.open("GET", "/resources/dummy.xml", false); | |
try { | |
xhr.send(null); | |
opener.testFailed("Doing a synchronous XHR in the beforeunload event handler did not throw"); | |
} catch (e) { | |
opener.testPassed("Doing a synchronous XHR in the beforeunload event handler threw an exception"); | |
} | |
opener.finishJSTest(); | |
}); | |
</script> | |
</body> | |
</html> |