Skip to content

Commit

Permalink
Blocking now Google Fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
felixaschultz committed Sep 30, 2023
1 parent b0729cc commit 2248f64
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
32 changes: 20 additions & 12 deletions gdpr.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,12 @@ function checkCookieStatus() {
mutations.forEach(({ addedNodes }) => {
addedNodes.forEach((node) => {

/* if(getCookie(int_hideCookieBannerName) != "" && getCookie(int_hideCookieBannerName).indexOf("__inta") > -1 && !intaCookieConsents?.functionalCookies){
window.INTA.settings.settings.styleSheets.map((sheet) => {
})
} */

/* Adding custom button to all blocked embedded content on the site */
if (node.nodeType === 1 && node.tagName === "IFRAME") {
allScripts.map((script) => {
Expand Down Expand Up @@ -1787,18 +1793,20 @@ function checkCookieStatus() {
});
}

if (node.nodeType === 1 && node.tagName === "LINK") {
const linkSrc = node.href;

if(notRequired.test(linkSrc)){
if(getCookie(int_hideCookieBannerName) != "" && getCookie(int_hideCookieBannerName).indexOf("__inta") > -1 && !intaCookieConsents?.functionalCookies){
console.log("Remove cookie");
node.parentElement.removeChild(node);
/* if(node.parentElement !== null){
node.parentElement.removeChild(node);
} */
}
}


if(getCookie(int_hideCookieBannerName) == "" || getCookie(int_hideCookieBannerName).indexOf("__inta") == -1 || intaCookieConsents?.advertisementCookies == "false" && getCookie(int_hideCookieBannerName) != "" && getCookie(int_hideCookieBannerName).indexOf("__inta") > -1 && intaCookieConsents?.functionalCookies == "false" && getCookie(int_hideCookieBannerName) != "" && getCookie(int_hideCookieBannerName).indexOf("__inta") > -1 && intaCookieConsents?.staticsticCookies == "false" || intaCookieConsents?.advertisementCookies == "null" && intaCookieConsents?.functionalCookies == "null" && intaCookieConsents?.staticsticCookies== "null"
|| intaCookieConsents?.advertisementCookies == "" && intaCookieConsents?.functionalCookies == "" && intaCookieConsents?.staticsticCookies == ""){
if (node.nodeType === 1 && node.tagName === "LINK") {
addedNodes.forEach((link) => {
const linkSrc = link.href;

console.log(linkSrc);
if(notRequired.test(linkSrc)){
link.disabled = true;
}
})
}
}

if (node.nodeType === 1 && node.tagName === "SCRIPT" && node.type !== 'application/ld+json' && node.innerText.indexOf("window.INTA") == -1 && node.innerText.indexOf("window.INT") == -1 && node.innerText.indexOf("window.INTA") == -1 && node.innerText.toLowerCase().indexOf("elementor") == -1 && node.innerText.toLowerCase().indexOf("chic_lite_data") == -1 && node.innerText.toLowerCase().indexOf("mailchimp_public_data") == -1 && node.innerText.toLowerCase().indexOf("monsterinsights_frontend") == -1) {
Expand Down
2 changes: 1 addition & 1 deletion gdpr.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/test-on-site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Google Fonts Testing -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@100;400;500;600;700;800&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;900&display=swap">

<link rel="stylesheet" href="style.css">
<title>Test site for GDPR Banner from Intastellar Solutions</title>
<style>
body {
Expand Down

0 comments on commit 2248f64

Please sign in to comment.