Skip to content

Commit

Permalink
Refactor cookie banner code to lazily load template and update privac…
Browse files Browse the repository at this point in the history
…y & cookie policy URL
  • Loading branch information
felixaschultz committed Aug 23, 2024
1 parent 21fbb30 commit 79436f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cb.js

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion dev/cb.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -1765,7 +1765,14 @@ const IntastellarCookieConsent = {
const intastellarDefaultConfigFile = "https://downloads.intastellarsolutions.com/cookieconsents/" + host + "/config.js";
const configScript = document.createElement("script");
configScript.src = intastellarDefaultConfigFile;
document.head.insertBefore(configScript, document.currentScript);

const xhr = new XMLHttpRequest();
xhr.open("GET", intastellarDefaultConfigFile);
xhr.send();

if (xhr.status === 200) {
document.head.insertBefore(configScript, document.currentScript);
}
}
document.body.append(template);
});
Expand Down

0 comments on commit 79436f5

Please sign in to comment.