blob: 89c6d1e8282097b5258588f688ae9fd2cbd69ad7 [file] [log] [blame]
window.result = [];
function log(msg) {
window.result.push(msg);
}
function checkIfReachedBodyEnd() {
const endelement = document.getElementById("bodyend");
// `<pre id="bodyend">End</pre>` is needed at the end of HTML.
if (endelement && endelement.textContent === "End") {
log("EndOfBody");
endelement.textContent = "Detected";
}
}
function logScript(msg) {
checkIfReachedBodyEnd();
log(msg);
}
document.addEventListener("DOMContentLoaded", function() { logScript("DOMContentLoaded"); });