Source code

Revision control

Copy as Markdown

Other Tools

<script>
window.onmessage = async (e) => {
if (e.data.type === "run") {
let token = e.data.token;
const test_url =
let response = await fetch(
new Request(test_url, {
mode: "cors",
method: "GET",
headers: [["x-print", token]],
})
);
let result = await response.text();
if (result === "1") {
parent.postMessage({ type: "pass", msg: "The CORS preflight was sent" }, "*");
} else {
parent.postMessage({ type: "fail", msg: "The CORS preflight wasn't sent" }, "*");
}
}
};
parent.postMessage({ type: "loaded" }, "*");
</script>