Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<html>
<body>
<div id="captchaType" data-captcha-type="cf-turnstile"></div>
<template id="contents">
<div id="fail" style="display: none"></div>
<div id="success" style="display: none"></div>
</template>
<script>
const bodyShadowRoot = document.body.attachShadow({ mode: "closed" });
bodyShadowRoot.appendChild(
document.getElementById("contents").content.cloneNode(true)
);
// Mutation handler only fires when an attribute changes, so we need to change
// any attribute that's not in shadow DOM to trigger the mutation observer.
document.documentElement.dir = "ltr";
window.onmessage = function (event) {
if (event.data === "fail") {
bodyShadowRoot.getElementById("fail").style.display = "block";
} else if (event.data === "success") {
bodyShadowRoot.getElementById("success").style.display = "block";
}
};
window.parent.postMessage("ready", "*");
</script>
</body>
</html>