(() => { window.addEventListener('message', m => { if (m.origin === "https://embed.tapkat.org" && m.data.type === "tapkat:ready") { const p = window.location.search.match(/(?:\?|&)promo=([^&]+)(?:&|$)/); if (p) { m.source.postMessage({ promo: p[1] }, "*"); } } }, false); document.addEventListener('DOMContentLoaded', () => { const p = window.location.search.match(/(?:\?|&)promo=([^&]+)(?:&|$)/); if (p) { const iframes = document.querySelectorAll("iframe[src^='https://embed.tapkat.org']"); for (iframe of iframes) { iframe.contentWindow.postMessage({ promo: p[1] }, "*"); } } }); })()