(() => { window.addEventListener('message', m => { if (m.origin === "https://embed.tapkat.org" && m.data.type === "tapkat:ready") { m.source.postMessage({ redirectOnDonation: "true" }, "*"); } if (m.origin === "https://embed.tapkat.org" && m.data.type === "tapkat:donation") { window.location.href = "/thank-you"; } }, false); document.addEventListener('DOMContentLoaded', () => { const iframes = document.querySelectorAll("iframe[src^='https://embed.tapkat.org']"); for (iframe of iframes) { iframe.contentWindow.postMessage({ redirectOnDonation: "true" }, "*"); } }); })()