Skip to content

Commit

Permalink
Add message event for consent retrieval and log origin in cookieShari…
Browse files Browse the repository at this point in the history
…ngIframe.html
  • Loading branch information
felixaschultz committed Oct 2, 2024
1 parent 699c4de commit 6a5c3c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cb.js
Original file line number Diff line number Diff line change
Expand Up @@ -777,10 +777,11 @@ window.addEventListener("load", function () {
intastellariframe.contentWindow.postMessage(intaConsentsObjectVariable, "https://consents.cdn.intastellarsolutions.com");


intastellariframe.contentWindow.postMessage("getConsents", "https://consents.cdn.intastellarsolutions.com");

}
}
window.addEventListener("message", sendCookieInformation);
window.removeEventListener("message", sendCookieInformation);
}
}

Expand Down
1 change: 1 addition & 0 deletions cookieSharingIframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
const localStorageData = localStorage.getItem("cookieSharing");
const partnerDomains = JSON.parse(localStorage.getItem("cookieSharing"));
if (partnerDomains.sharingDomains.includes(origin.replace("https://", "").replace("http://", "").replace("www.", ""))) {
console.log("origin", origin, event.data);
if (event.data === "getConsents") {
const cookie = localStorageData;
window.parent.postMessage(cookie, "*");
Expand Down

0 comments on commit 6a5c3c8

Please sign in to comment.