<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="resources/print.js"></script>
</head>

<body>
<p>This page tests the beforeload event on script elements.  You should see a PASS message below if everything
works.</p>
<hr/>
<div id="console"></div>

<script>
if (window.layoutTestController)
    layoutTestController.dumpAsText();
    
function beforeLoadFunc()
{
    print("PASS", "green");
    event.preventDefault();
}

document.body.addEventListener("beforeload", beforeLoadFunc, true);
</script>
<script src="resources/fail.js"></script>

</body>
</html>