Skip to content

Commit

Permalink
Merge pull request #183 from felixaschultz/development
Browse files Browse the repository at this point in the history
Refactor intastellar partner domain iframe creation and postMessage h…
  • Loading branch information
felixaschultz authored Aug 15, 2024
2 parents a9cd9c7 + d66484a commit d3168f4
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions dev/cb.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,8 @@ function setIntastellarPartnerDomain() {
intastellarSharingIframe.style.left = "-100%";

console.log("Partner domain: ", window.INTA.settings.partnerDomain);
document.body.appendChild(intastellarSharingIframe);
if (document.getElementById("intastellarCrossSiteCheck") != null) {
const intastellariframe = document.getElementById("intastellarCrossSiteCheck");
window.addEventListener("message", function (event) {
if (event.origin !== "https://consents.cdn.intastellarsolutions.com") return;
if (event.data === "ready") {
intastellariframe.contentWindow.postMessage(intaConsentsObjectVariable, "https://consents.cdn.intastellarsolutions.com");
}
});
}
//document.body.appendChild(intastellarSharingIframe);

}
}
setIntastellarPartnerDomain();
Expand Down Expand Up @@ -771,7 +763,15 @@ window.addEventListener("load", function () {
trImage.src = intastellarCookieBannerRootDomain + "/cookieSharingIframe.html";

document.body.appendChild(trImage);
console.log(trImage);
if (document.querySelector("[name=intastellar-solutions-sharinglibrary-iframe]") != null) {
const intastellariframe = document.querySelector("[name=intastellar-solutions-sharinglibrary-iframe]");
window.addEventListener("message", function (event) {
if (event.origin !== "https://consents.cdn.intastellarsolutions.com") return;
if (event.data === "ready") {
intastellariframe.contentWindow.postMessage(intaConsentsObjectVariable, "https://consents.cdn.intastellarsolutions.com");
}
});
}

gtag('set', {
'user_id': (getCookie(int_hideCookieBannerName)) ? JSON.parse(decodeIntaConsentsObject(getCookie(int_hideCookieBannerName)?.split(".")[2])).uid : intaConsentsObjectVariable.uid
Expand Down

0 comments on commit d3168f4

Please sign in to comment.