Skip to content

Commit

Permalink
Merge pull request #81 from felixaschultz:development
Browse files Browse the repository at this point in the history
Blocking now Google Fonts
  • Loading branch information
felixaschultz authored Sep 30, 2023
2 parents 5586226 + 2248f64 commit d2874c4
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 7 deletions.
80 changes: 75 additions & 5 deletions gdpr.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -1007,11 +1007,57 @@ inta_functionalCookieList.push({
"googletagmanager.com",
"googleadservice.com",
"google-analytics.com",
"google.com"
"google.com",
"fonts.google.com"
],
vendor_privacy: "https://policies.google.com/privacy"
})

inta_functionalCookieList.push({
vendor: "Google Fonts",
cookies: [
{
cookie: "FCCDCF",
purpose: "",
},
{
cookie: "NID",
purpose: "",
},
{
cookie: "AMP_TOKEN",
purpose: "",
}
],
domains: [
"fonts.google.com"
],
vendor_privacy: "https://policies.google.com/privacy"
})

inta_functionalCookieList.push({
vendor: "jsdelivr.com",
cookies: [
{
cookie: "__cfduid",
purpose: "Used by the content network, Cloudflare, to identify trusted web traffic.",
}
],
domains: [
"jsdelivr.net",
"cdnjs.com",
"cdn.jsdelivr.net",
"jsdelivr.com",
"cdnjs.cloudflare.com",
"cloudflare.com",
"cloudflare.net",
"cloudflareinsights.com",
"cloudflarestream.com",
"cloudflarewatch.com",
],
vendor_privacy: "https://www.jsdelivr.com/terms/privacy-policy-jsdelivr-net"
})

inta_functionalCookieList.push({
vendor: "Stripe",
cookies: [
Expand Down Expand Up @@ -1280,10 +1326,10 @@ const allScripts = [
/* Functional Scripts which are beeing blocked */
type: "functional",
scripts: [
"(maps.google.com)",
"(www.google.com/maps/)",
/* "(recaptcha+)",
"(grecaptcha+)", */
"(maps.google.com+)",
"(www.google.com/maps/+)",
"(recaptcha+)",
"(grecaptcha+)",
"([\-\.]googleapis+)",
"([\-\.]gstatics+)",
"([\-\.]cludo+)",
Expand All @@ -1292,6 +1338,8 @@ const allScripts = [
"([\-\.]paypal+)",
"([\-\.]usersnap+)",
"([\-\.]zoom+)",
"([\-\.]cdnjs+)",
"([\-\.]jsdelivr+)",
"([\-\.]disqus+)([a-z]+){2,5}(:[0-9]{1,5})?(\\\\.*)"
]
}
Expand Down Expand Up @@ -1632,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 @@ -1739,6 +1793,22 @@ function checkCookieStatus() {
});
}



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) {
let src = node.src || "";

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 d2874c4

Please sign in to comment.