@duckduckgo/autoconsent 6.6.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ # v7.0.0 (Thu Dec 28 2023)
2
+
3
+ #### 💥 Breaking Change
4
+
5
+ - Fix CSP errors when running eval rules in MV3 extension [#318](https://github.com/duckduckgo/autoconsent/pull/318) ([@muodov](https://github.com/muodov))
6
+
7
+ #### Authors: 1
8
+
9
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
10
+
11
+ ---
12
+
13
+ # v6.7.0 (Thu Dec 28 2023)
14
+
15
+ #### 🚀 Enhancement
16
+
17
+ - Add a rule for ciaopeople.it [#320](https://github.com/duckduckgo/autoconsent/pull/320) ([@seia-soto](https://github.com/seia-soto) [@muodov](https://github.com/muodov))
18
+ - Add a rule for roofingmegastore.co.uk [#325](https://github.com/duckduckgo/autoconsent/pull/325) ([@seia-soto](https://github.com/seia-soto))
19
+ - Add a rule for csu-landtag.de [#324](https://github.com/duckduckgo/autoconsent/pull/324) ([@seia-soto](https://github.com/seia-soto))
20
+
21
+ #### Authors: 2
22
+
23
+ - HoJeong Go ([@seia-soto](https://github.com/seia-soto))
24
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
25
+
26
+ ---
27
+
1
28
  # v6.6.1 (Wed Dec 27 2023)
2
29
 
3
30
  #### 🐛 Bug Fix
@@ -2,6 +2,119 @@
2
2
  // lib/config.ts
3
3
  var enableLogs = false;
4
4
 
5
+ // lib/eval-snippets.ts
6
+ var snippets = {
7
+ // code-based rules
8
+ EVAL_0: () => console.log(1),
9
+ EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
10
+ EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
11
+ EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
12
+ EVAL_CONSENTMANAGER_4: () => __cmp("setConsent", 1),
13
+ EVAL_CONSENTMANAGER_5: () => __cmp("consentStatus").userChoiceExists,
14
+ EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
15
+ EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
16
+ EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
17
+ EVAL_COOKIEBOT_4: () => window.Cookiebot.hide() || true,
18
+ EVAL_COOKIEBOT_5: () => window.Cookiebot.declined === true,
19
+ EVAL_KLARO_1: () => klaro.getManager().config.services.every((c) => c.required || !klaro.getManager().consents[c.name]),
20
+ EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
21
+ EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
22
+ // declarative rules
23
+ EVAL_ADROLL_0: () => !document.cookie.includes("__adroll_fpc"),
24
+ EVAL_ALMACMP_0: () => document.cookie.includes('"name":"Google","consent":false'),
25
+ EVAL_AFFINITY_SERIF_COM_0: () => document.cookie.includes("serif_manage_cookies_viewed") && !document.cookie.includes("serif_allow_analytics"),
26
+ EVAL_AXEPTIO_0: () => document.cookie.includes("axeptio_authorized_vendors=%2C%2C"),
27
+ EVAL_BING_0: () => document.cookie.includes("AL=0") && document.cookie.includes("AD=0") && document.cookie.includes("SM=0"),
28
+ EVAL_BLOCKSY_0: () => document.cookie.includes("blocksy_cookies_consent_accepted=no"),
29
+ EVAL_BORLABS_0: () => !JSON.parse(decodeURIComponent(document.cookie.split(";").find((c) => c.indexOf("borlabs-cookie") !== -1).split("=", 2)[1])).consents.statistics,
30
+ EVAL_BUNDESREGIERUNG_DE_0: () => document.cookie.match("cookie-allow-tracking=0"),
31
+ EVAL_CANVA_0: () => !document.cookie.includes("gtm_fpc_engagement_event"),
32
+ EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
33
+ EVAL_CLICKIO_0: () => document.cookie.includes("__lxG__consent__v2_daisybit="),
34
+ EVAL_CLINCH_0: () => document.cookie.includes("ctc_rejected=1"),
35
+ EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
36
+ EVAL_COMPLIANZ_BANNER_0: () => document.cookie.includes("cmplz_banner-status=dismissed"),
37
+ EVAL_COMPLIANZ_CATEGORIES_0: () => !!document.cookie.match(/cmplz_[^=]+=deny/),
38
+ EVAL_COMPLIANZ_OPTIN_0: () => !!document.cookie.match(/cookieconsent_preferences_disabled=[^;]+/),
39
+ EVAL_COOKIE_LAW_INFO_0: () => CLI.disableAllCookies() || CLI.reject_close() || true,
40
+ EVAL_COOKIE_LAW_INFO_1: () => document.cookie.indexOf("cookielawinfo-checkbox-non-necessary=yes") === -1,
41
+ EVAL_COOKIE_MANAGER_POPUP_0: () => JSON.parse(document.cookie.split(";").find((c) => c.trim().startsWith("CookieLevel")).split("=")[1]).social === false,
42
+ EVAL_COOKIEALERT_0: () => document.querySelector("body").removeAttribute("style") || true,
43
+ EVAL_COOKIEALERT_1: () => document.querySelector("body").removeAttribute("style") || true,
44
+ EVAL_COOKIEALERT_2: () => window.CookieConsent.declined === true,
45
+ EVAL_COOKIEFIRST_0: () => ((o) => o.performance === false && o.functional === false && o.advertising === false)(JSON.parse(decodeURIComponent(document.cookie.split(";").find((c) => c.indexOf("cookiefirst") !== -1).trim()).split("=")[1])),
46
+ EVAL_COOKIEFIRST_1: () => document.querySelectorAll("button[data-cookiefirst-accent-color=true][role=checkbox]:not([disabled])").forEach((i) => i.getAttribute("aria-checked") == "true" && i.click()) || true,
47
+ EVAL_COOKIEINFORMATION_0: () => CookieInformation.declineAllCategories() || true,
48
+ EVAL_COOKIEINFORMATION_1: () => CookieInformation.submitAllCategories() || true,
49
+ EVAL_COOKIEINFORMATION_2: () => document.cookie.includes("CookieInformationConsent="),
50
+ EVAL_COOKIEYES_0: () => document.cookie.includes("advertisement:no"),
51
+ EVAL_DAILYMOTION_0: () => !!document.cookie.match("dm-euconsent-v2"),
52
+ EVAL_DSGVO_0: () => !document.cookie.includes("sp_dsgvo_cookie_settings"),
53
+ EVAL_DUNELM_0: () => document.cookie.includes("cc_functional=0") && document.cookie.includes("cc_targeting=0"),
54
+ EVAL_ETSY_0: () => document.querySelectorAll(".gdpr-overlay-body input").forEach((toggle) => {
55
+ toggle.checked = false;
56
+ }) || true,
57
+ EVAL_ETSY_1: () => document.querySelector(".gdpr-overlay-view button[data-wt-overlay-close]").click() || true,
58
+ EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
59
+ EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
60
+ EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
61
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
62
+ EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
63
+ EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
64
+ if (x.checked)
65
+ x.click();
66
+ }) || true,
67
+ EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
68
+ EVAL_JQUERY_COOKIEBAR_0: () => !document.cookie.includes("cookies-state=accepted"),
69
+ EVAL_MEDIAVINE_0: () => document.querySelectorAll('[data-name="mediavine-gdpr-cmp"] input[type=checkbox]').forEach((x) => x.checked && x.click()) || true,
70
+ EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
71
+ EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
72
+ EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
73
+ EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
74
+ if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
75
+ i.checked = false;
76
+ }) || true,
77
+ EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
78
+ EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
79
+ EVAL_PAYPAL_0: () => document.cookie.includes("cookie_prefs") === true,
80
+ EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
81
+ EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
82
+ EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
83
+ EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
84
+ EVAL_SIRDATA_0: () => document.cookie.includes("euconsent-v2"),
85
+ EVAL_SNIGEL_0: () => !!document.cookie.match("snconsent"),
86
+ EVAL_STEAMPOWERED_0: () => JSON.parse(decodeURIComponent(document.cookie.split(";").find((s) => s.trim().startsWith("cookieSettings")).split("=")[1])).preference_state === 2,
87
+ EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
88
+ EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
89
+ EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
90
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
91
+ EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
92
+ EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
93
+ EVAL_TEALIUM_2: () => utag.gdpr.setConsentValue(true) || true,
94
+ EVAL_TEALIUM_3: () => utag.gdpr.getConsentState() !== 1,
95
+ EVAL_TESTCMP_0: () => window.results.results[0] === "button_clicked",
96
+ EVAL_TESTCMP_COSMETIC_0: () => window.results.results[0] === "banner_hidden",
97
+ EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
98
+ EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
99
+ EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
100
+ EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
101
+ EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
102
+ EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
103
+ EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
104
+ EVAL_USERCENTRICS_API_2: () => !!UC_UI.denyAllConsents(),
105
+ EVAL_USERCENTRICS_API_3: () => !!UC_UI.acceptAllConsents(),
106
+ EVAL_USERCENTRICS_API_4: () => !!UC_UI.closeCMP(),
107
+ EVAL_USERCENTRICS_API_5: () => UC_UI.areAllConsentsAccepted() === true,
108
+ EVAL_USERCENTRICS_API_6: () => UC_UI.areAllConsentsAccepted() === false,
109
+ EVAL_USERCENTRICS_BUTTON_0: () => JSON.parse(localStorage.getItem("usercentrics")).consents.every((c) => c.isEssential || !c.consentStatus),
110
+ EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true,
111
+ EVAL_WAITROSE_1: () => document.cookie.includes("wtr_cookies_advertising=0") && document.cookie.includes("wtr_cookies_analytics=0"),
112
+ EVAL_WP_COOKIE_NOTICE_0: () => document.cookie.includes("wpl_viewed_cookie=no"),
113
+ EVAL_XING_0: () => document.cookie.includes("userConsent=%7B%22marketing%22%3Afalse"),
114
+ EVAL_YOUTUBE_DESKTOP_0: () => !!document.cookie.match(/SOCS=CAE/),
115
+ EVAL_YOUTUBE_MOBILE_0: () => !!document.cookie.match(/SOCS=CAE/)
116
+ };
117
+
5
118
  // addon/mv-compat.ts
6
119
  var manifestVersion = chrome.runtime.getManifest().manifest_version;
7
120
  var storage = {};
@@ -110,7 +223,7 @@
110
223
  rules: await res.json()
111
224
  });
112
225
  }
113
- async function evalInTab(tabId, frameId, code) {
226
+ async function evalInTab(tabId, frameId, code, snippetId) {
114
227
  if (manifestVersion === 2) {
115
228
  return new Promise((resolve) => {
116
229
  chrome.tabs.executeScript(tabId, {
@@ -130,15 +243,7 @@
130
243
  frameIds: [frameId]
131
244
  },
132
245
  world: "MAIN",
133
- args: [code],
134
- func: (code2) => {
135
- try {
136
- return window.eval(code2);
137
- } catch (e) {
138
- console.warn("eval error", code2, e);
139
- return;
140
- }
141
- }
246
+ func: snippets[snippetId]
142
247
  });
143
248
  }
144
249
  async function getTabReports(tabId) {
@@ -187,7 +292,7 @@
187
292
  });
188
293
  break;
189
294
  case "eval":
190
- evalInTab(tabId, frameId, msg.code).then(([result]) => {
295
+ evalInTab(tabId, frameId, msg.code, msg.snippetId).then(([result]) => {
191
296
  if (enableLogs) {
192
297
  console.groupCollapsed(`eval result for ${sender.origin || sender.url}`);
193
298
  console.log(msg.code, result.result);
@@ -600,12 +600,13 @@
600
600
  pending: /* @__PURE__ */ new Map(),
601
601
  sendContentMessage: null
602
602
  };
603
- function requestEval(code) {
603
+ function requestEval(code, snippetId) {
604
604
  const id = getRandomID();
605
605
  evalState.sendContentMessage({
606
606
  type: "eval",
607
607
  id,
608
- code
608
+ code,
609
+ snippetId
609
610
  });
610
611
  const deferred = new Deferred(id);
611
612
  evalState.pending.set(deferred.id, deferred);
@@ -689,7 +690,7 @@
689
690
  EVAL_MEDIAVINE_0: () => document.querySelectorAll('[data-name="mediavine-gdpr-cmp"] input[type=checkbox]').forEach((x) => x.checked && x.click()) || true,
690
691
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
691
692
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
692
- EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC"),
693
+ EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
693
694
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
694
695
  if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
695
696
  i.checked = false;
@@ -777,7 +778,7 @@
777
778
  }
778
779
  const snippetSrc = getFunctionBody(snippet);
779
780
  enableLogs && console.log("async eval:", snippetId, snippetSrc);
780
- return requestEval(snippetSrc).catch((e) => {
781
+ return requestEval(snippetSrc, snippetId).catch((e) => {
781
782
  enableLogs && console.error("error evaluating rule", snippetId, e);
782
783
  return false;
783
784
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2023.12.20",
4
+ "version": "2023.12.28",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -883,6 +883,44 @@
883
883
  }
884
884
  ]
885
885
  },
886
+ {
887
+ "name": "ciaopeople.it",
888
+ "prehideSelectors": [
889
+ "#cp-gdpr-choices"
890
+ ],
891
+ "detectCmp": [
892
+ {
893
+ "exists": "#cp-gdpr-choices"
894
+ }
895
+ ],
896
+ "detectPopup": [
897
+ {
898
+ "visible": "#cp-gdpr-choices"
899
+ }
900
+ ],
901
+ "optIn": [
902
+ {
903
+ "waitForThenClick": ".gdpr-btm__right > button:nth-child(2)"
904
+ }
905
+ ],
906
+ "optOut": [
907
+ {
908
+ "waitForThenClick": ".gdpr-top-content > button"
909
+ },
910
+ {
911
+ "waitFor": ".gdpr-top-back"
912
+ },
913
+ {
914
+ "waitForThenClick": ".gdpr-btm__right > button:nth-child(1)"
915
+ }
916
+ ],
917
+ "test": [
918
+ {
919
+ "visible": "#cp-gdpr-choices",
920
+ "check": "none"
921
+ }
922
+ ]
923
+ },
886
924
  {
887
925
  "vendorUrl": "https://www.civicuk.com/cookie-control/",
888
926
  "name": "civic-cookie-control",
@@ -1661,6 +1699,35 @@
1661
1699
  }
1662
1700
  ]
1663
1701
  },
1702
+ {
1703
+ "name": "csu-landtag-de",
1704
+ "runContext": {
1705
+ "urlPattern": "^https://(www|)?\\.csu-landtag\\.de"
1706
+ },
1707
+ "prehideSelectors": [
1708
+ "#cookie-disclaimer"
1709
+ ],
1710
+ "detectCmp": [
1711
+ {
1712
+ "exists": "#cookie-disclaimer"
1713
+ }
1714
+ ],
1715
+ "detectPopup": [
1716
+ {
1717
+ "visible": "#cookie-disclaimer"
1718
+ }
1719
+ ],
1720
+ "optIn": [
1721
+ {
1722
+ "click": "#cookieall"
1723
+ }
1724
+ ],
1725
+ "optOut": [
1726
+ {
1727
+ "click": "#cookiesel"
1728
+ }
1729
+ ]
1730
+ },
1664
1731
  {
1665
1732
  "name": "dailymotion-us",
1666
1733
  "cosmetic": true,
@@ -3914,6 +3981,38 @@
3914
3981
  }
3915
3982
  ]
3916
3983
  },
3984
+ {
3985
+ "name": "roofingmegastore.co.uk",
3986
+ "runContext": {
3987
+ "urlPattern": "^https://(www\\.)?roofingmegastore\\.co\\.uk"
3988
+ },
3989
+ "prehideSelectors": [
3990
+ "#m-cookienotice"
3991
+ ],
3992
+ "detectCmp": [
3993
+ {
3994
+ "exists": "#m-cookienotice"
3995
+ }
3996
+ ],
3997
+ "detectPopup": [
3998
+ {
3999
+ "visible": "#m-cookienotice"
4000
+ }
4001
+ ],
4002
+ "optIn": [
4003
+ {
4004
+ "click": "#accept-cookies"
4005
+ }
4006
+ ],
4007
+ "optOut": [
4008
+ {
4009
+ "click": "#manage-cookies"
4010
+ },
4011
+ {
4012
+ "waitForThenClick": "#accept-selected"
4013
+ }
4014
+ ]
4015
+ },
3917
4016
  {
3918
4017
  "name": "samsung.com",
3919
4018
  "runContext": {
@@ -2,6 +2,119 @@
2
2
  // lib/config.ts
3
3
  var enableLogs = false;
4
4
 
5
+ // lib/eval-snippets.ts
6
+ var snippets = {
7
+ // code-based rules
8
+ EVAL_0: () => console.log(1),
9
+ EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
10
+ EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
11
+ EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
12
+ EVAL_CONSENTMANAGER_4: () => __cmp("setConsent", 1),
13
+ EVAL_CONSENTMANAGER_5: () => __cmp("consentStatus").userChoiceExists,
14
+ EVAL_COOKIEBOT_1: () => !!window.Cookiebot,
15
+ EVAL_COOKIEBOT_2: () => !window.Cookiebot.hasResponse && window.Cookiebot.dialog?.visible === true,
16
+ EVAL_COOKIEBOT_3: () => window.Cookiebot.withdraw() || true,
17
+ EVAL_COOKIEBOT_4: () => window.Cookiebot.hide() || true,
18
+ EVAL_COOKIEBOT_5: () => window.Cookiebot.declined === true,
19
+ EVAL_KLARO_1: () => klaro.getManager().config.services.every((c) => c.required || !klaro.getManager().consents[c.name]),
20
+ EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
21
+ EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
22
+ // declarative rules
23
+ EVAL_ADROLL_0: () => !document.cookie.includes("__adroll_fpc"),
24
+ EVAL_ALMACMP_0: () => document.cookie.includes('"name":"Google","consent":false'),
25
+ EVAL_AFFINITY_SERIF_COM_0: () => document.cookie.includes("serif_manage_cookies_viewed") && !document.cookie.includes("serif_allow_analytics"),
26
+ EVAL_AXEPTIO_0: () => document.cookie.includes("axeptio_authorized_vendors=%2C%2C"),
27
+ EVAL_BING_0: () => document.cookie.includes("AL=0") && document.cookie.includes("AD=0") && document.cookie.includes("SM=0"),
28
+ EVAL_BLOCKSY_0: () => document.cookie.includes("blocksy_cookies_consent_accepted=no"),
29
+ EVAL_BORLABS_0: () => !JSON.parse(decodeURIComponent(document.cookie.split(";").find((c) => c.indexOf("borlabs-cookie") !== -1).split("=", 2)[1])).consents.statistics,
30
+ EVAL_BUNDESREGIERUNG_DE_0: () => document.cookie.match("cookie-allow-tracking=0"),
31
+ EVAL_CANVA_0: () => !document.cookie.includes("gtm_fpc_engagement_event"),
32
+ EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
33
+ EVAL_CLICKIO_0: () => document.cookie.includes("__lxG__consent__v2_daisybit="),
34
+ EVAL_CLINCH_0: () => document.cookie.includes("ctc_rejected=1"),
35
+ EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
36
+ EVAL_COMPLIANZ_BANNER_0: () => document.cookie.includes("cmplz_banner-status=dismissed"),
37
+ EVAL_COMPLIANZ_CATEGORIES_0: () => !!document.cookie.match(/cmplz_[^=]+=deny/),
38
+ EVAL_COMPLIANZ_OPTIN_0: () => !!document.cookie.match(/cookieconsent_preferences_disabled=[^;]+/),
39
+ EVAL_COOKIE_LAW_INFO_0: () => CLI.disableAllCookies() || CLI.reject_close() || true,
40
+ EVAL_COOKIE_LAW_INFO_1: () => document.cookie.indexOf("cookielawinfo-checkbox-non-necessary=yes") === -1,
41
+ EVAL_COOKIE_MANAGER_POPUP_0: () => JSON.parse(document.cookie.split(";").find((c) => c.trim().startsWith("CookieLevel")).split("=")[1]).social === false,
42
+ EVAL_COOKIEALERT_0: () => document.querySelector("body").removeAttribute("style") || true,
43
+ EVAL_COOKIEALERT_1: () => document.querySelector("body").removeAttribute("style") || true,
44
+ EVAL_COOKIEALERT_2: () => window.CookieConsent.declined === true,
45
+ EVAL_COOKIEFIRST_0: () => ((o) => o.performance === false && o.functional === false && o.advertising === false)(JSON.parse(decodeURIComponent(document.cookie.split(";").find((c) => c.indexOf("cookiefirst") !== -1).trim()).split("=")[1])),
46
+ EVAL_COOKIEFIRST_1: () => document.querySelectorAll("button[data-cookiefirst-accent-color=true][role=checkbox]:not([disabled])").forEach((i) => i.getAttribute("aria-checked") == "true" && i.click()) || true,
47
+ EVAL_COOKIEINFORMATION_0: () => CookieInformation.declineAllCategories() || true,
48
+ EVAL_COOKIEINFORMATION_1: () => CookieInformation.submitAllCategories() || true,
49
+ EVAL_COOKIEINFORMATION_2: () => document.cookie.includes("CookieInformationConsent="),
50
+ EVAL_COOKIEYES_0: () => document.cookie.includes("advertisement:no"),
51
+ EVAL_DAILYMOTION_0: () => !!document.cookie.match("dm-euconsent-v2"),
52
+ EVAL_DSGVO_0: () => !document.cookie.includes("sp_dsgvo_cookie_settings"),
53
+ EVAL_DUNELM_0: () => document.cookie.includes("cc_functional=0") && document.cookie.includes("cc_targeting=0"),
54
+ EVAL_ETSY_0: () => document.querySelectorAll(".gdpr-overlay-body input").forEach((toggle) => {
55
+ toggle.checked = false;
56
+ }) || true,
57
+ EVAL_ETSY_1: () => document.querySelector(".gdpr-overlay-view button[data-wt-overlay-close]").click() || true,
58
+ EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
59
+ EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
60
+ EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
61
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
62
+ EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
63
+ EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
64
+ if (x.checked)
65
+ x.click();
66
+ }) || true,
67
+ EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
68
+ EVAL_JQUERY_COOKIEBAR_0: () => !document.cookie.includes("cookies-state=accepted"),
69
+ EVAL_MEDIAVINE_0: () => document.querySelectorAll('[data-name="mediavine-gdpr-cmp"] input[type=checkbox]').forEach((x) => x.checked && x.click()) || true,
70
+ EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
71
+ EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
72
+ EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
73
+ EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
74
+ if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
75
+ i.checked = false;
76
+ }) || true,
77
+ EVAL_ONENINETWO_0: () => document.cookie.includes("CC_ADVERTISING=NO") && document.cookie.includes("CC_ANALYTICS=NO"),
78
+ EVAL_OPERA_0: () => document.cookie.includes("cookie_consent_essential=true") && !document.cookie.includes("cookie_consent_marketing=true"),
79
+ EVAL_PAYPAL_0: () => document.cookie.includes("cookie_prefs") === true,
80
+ EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
81
+ EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
82
+ EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
83
+ EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
84
+ EVAL_SIRDATA_0: () => document.cookie.includes("euconsent-v2"),
85
+ EVAL_SNIGEL_0: () => !!document.cookie.match("snconsent"),
86
+ EVAL_STEAMPOWERED_0: () => JSON.parse(decodeURIComponent(document.cookie.split(";").find((s) => s.trim().startsWith("cookieSettings")).split("=")[1])).preference_state === 2,
87
+ EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
88
+ EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
89
+ EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
90
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
91
+ EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
92
+ EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
93
+ EVAL_TEALIUM_2: () => utag.gdpr.setConsentValue(true) || true,
94
+ EVAL_TEALIUM_3: () => utag.gdpr.getConsentState() !== 1,
95
+ EVAL_TESTCMP_0: () => window.results.results[0] === "button_clicked",
96
+ EVAL_TESTCMP_COSMETIC_0: () => window.results.results[0] === "banner_hidden",
97
+ EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
98
+ EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
99
+ EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
100
+ EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
101
+ EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
102
+ EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
103
+ EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
104
+ EVAL_USERCENTRICS_API_2: () => !!UC_UI.denyAllConsents(),
105
+ EVAL_USERCENTRICS_API_3: () => !!UC_UI.acceptAllConsents(),
106
+ EVAL_USERCENTRICS_API_4: () => !!UC_UI.closeCMP(),
107
+ EVAL_USERCENTRICS_API_5: () => UC_UI.areAllConsentsAccepted() === true,
108
+ EVAL_USERCENTRICS_API_6: () => UC_UI.areAllConsentsAccepted() === false,
109
+ EVAL_USERCENTRICS_BUTTON_0: () => JSON.parse(localStorage.getItem("usercentrics")).consents.every((c) => c.isEssential || !c.consentStatus),
110
+ EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true,
111
+ EVAL_WAITROSE_1: () => document.cookie.includes("wtr_cookies_advertising=0") && document.cookie.includes("wtr_cookies_analytics=0"),
112
+ EVAL_WP_COOKIE_NOTICE_0: () => document.cookie.includes("wpl_viewed_cookie=no"),
113
+ EVAL_XING_0: () => document.cookie.includes("userConsent=%7B%22marketing%22%3Afalse"),
114
+ EVAL_YOUTUBE_DESKTOP_0: () => !!document.cookie.match(/SOCS=CAE/),
115
+ EVAL_YOUTUBE_MOBILE_0: () => !!document.cookie.match(/SOCS=CAE/)
116
+ };
117
+
5
118
  // addon/mv-compat.ts
6
119
  var manifestVersion = chrome.runtime.getManifest().manifest_version;
7
120
  var storage = {};
@@ -110,7 +223,7 @@
110
223
  rules: await res.json()
111
224
  });
112
225
  }
113
- async function evalInTab(tabId, frameId, code) {
226
+ async function evalInTab(tabId, frameId, code, snippetId) {
114
227
  if (manifestVersion === 2) {
115
228
  return new Promise((resolve) => {
116
229
  chrome.tabs.executeScript(tabId, {
@@ -130,15 +243,7 @@
130
243
  frameIds: [frameId]
131
244
  },
132
245
  world: "MAIN",
133
- args: [code],
134
- func: (code2) => {
135
- try {
136
- return window.eval(code2);
137
- } catch (e) {
138
- console.warn("eval error", code2, e);
139
- return;
140
- }
141
- }
246
+ func: snippets[snippetId]
142
247
  });
143
248
  }
144
249
  async function getTabReports(tabId) {
@@ -187,7 +292,7 @@
187
292
  });
188
293
  break;
189
294
  case "eval":
190
- evalInTab(tabId, frameId, msg.code).then(([result]) => {
295
+ evalInTab(tabId, frameId, msg.code, msg.snippetId).then(([result]) => {
191
296
  if (enableLogs) {
192
297
  console.groupCollapsed(`eval result for ${sender.origin || sender.url}`);
193
298
  console.log(msg.code, result.result);
@@ -600,12 +600,13 @@
600
600
  pending: /* @__PURE__ */ new Map(),
601
601
  sendContentMessage: null
602
602
  };
603
- function requestEval(code) {
603
+ function requestEval(code, snippetId) {
604
604
  const id = getRandomID();
605
605
  evalState.sendContentMessage({
606
606
  type: "eval",
607
607
  id,
608
- code
608
+ code,
609
+ snippetId
609
610
  });
610
611
  const deferred = new Deferred(id);
611
612
  evalState.pending.set(deferred.id, deferred);
@@ -689,7 +690,7 @@
689
690
  EVAL_MEDIAVINE_0: () => document.querySelectorAll('[data-name="mediavine-gdpr-cmp"] input[type=checkbox]').forEach((x) => x.checked && x.click()) || true,
690
691
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
691
692
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
692
- EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC"),
693
+ EVAL_MICROSOFT_2: () => !!document.cookie.match("MSCC|GHCC"),
693
694
  EVAL_MOOVE_0: () => document.querySelectorAll("#moove_gdpr_cookie_modal input").forEach((i) => {
694
695
  if (!i.disabled && i.name !== "moove_gdpr_strict_cookies")
695
696
  i.checked = false;
@@ -777,7 +778,7 @@
777
778
  }
778
779
  const snippetSrc = getFunctionBody(snippet);
779
780
  enableLogs && console.log("async eval:", snippetId, snippetSrc);
780
- return requestEval(snippetSrc).catch((e) => {
781
+ return requestEval(snippetSrc, snippetId).catch((e) => {
781
782
  enableLogs && console.error("error evaluating rule", snippetId, e);
782
783
  return false;
783
784
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2023.12.20",
4
+ "version": "2023.12.28",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },
@@ -883,6 +883,44 @@
883
883
  }
884
884
  ]
885
885
  },
886
+ {
887
+ "name": "ciaopeople.it",
888
+ "prehideSelectors": [
889
+ "#cp-gdpr-choices"
890
+ ],
891
+ "detectCmp": [
892
+ {
893
+ "exists": "#cp-gdpr-choices"
894
+ }
895
+ ],
896
+ "detectPopup": [
897
+ {
898
+ "visible": "#cp-gdpr-choices"
899
+ }
900
+ ],
901
+ "optIn": [
902
+ {
903
+ "waitForThenClick": ".gdpr-btm__right > button:nth-child(2)"
904
+ }
905
+ ],
906
+ "optOut": [
907
+ {
908
+ "waitForThenClick": ".gdpr-top-content > button"
909
+ },
910
+ {
911
+ "waitFor": ".gdpr-top-back"
912
+ },
913
+ {
914
+ "waitForThenClick": ".gdpr-btm__right > button:nth-child(1)"
915
+ }
916
+ ],
917
+ "test": [
918
+ {
919
+ "visible": "#cp-gdpr-choices",
920
+ "check": "none"
921
+ }
922
+ ]
923
+ },
886
924
  {
887
925
  "vendorUrl": "https://www.civicuk.com/cookie-control/",
888
926
  "name": "civic-cookie-control",
@@ -1661,6 +1699,35 @@
1661
1699
  }
1662
1700
  ]
1663
1701
  },
1702
+ {
1703
+ "name": "csu-landtag-de",
1704
+ "runContext": {
1705
+ "urlPattern": "^https://(www|)?\\.csu-landtag\\.de"
1706
+ },
1707
+ "prehideSelectors": [
1708
+ "#cookie-disclaimer"
1709
+ ],
1710
+ "detectCmp": [
1711
+ {
1712
+ "exists": "#cookie-disclaimer"
1713
+ }
1714
+ ],
1715
+ "detectPopup": [
1716
+ {
1717
+ "visible": "#cookie-disclaimer"
1718
+ }
1719
+ ],
1720
+ "optIn": [
1721
+ {
1722
+ "click": "#cookieall"
1723
+ }
1724
+ ],
1725
+ "optOut": [
1726
+ {
1727
+ "click": "#cookiesel"
1728
+ }
1729
+ ]
1730
+ },
1664
1731
  {
1665
1732
  "name": "dailymotion-us",
1666
1733
  "cosmetic": true,
@@ -3914,6 +3981,38 @@
3914
3981
  }
3915
3982
  ]
3916
3983
  },
3984
+ {
3985
+ "name": "roofingmegastore.co.uk",
3986
+ "runContext": {
3987
+ "urlPattern": "^https://(www\\.)?roofingmegastore\\.co\\.uk"
3988
+ },
3989
+ "prehideSelectors": [
3990
+ "#m-cookienotice"
3991
+ ],
3992
+ "detectCmp": [
3993
+ {
3994
+ "exists": "#m-cookienotice"
3995
+ }
3996
+ ],
3997
+ "detectPopup": [
3998
+ {
3999
+ "visible": "#m-cookienotice"
4000
+ }
4001
+ ],
4002
+ "optIn": [
4003
+ {
4004
+ "click": "#accept-cookies"
4005
+ }
4006
+ ],
4007
+ "optOut": [
4008
+ {
4009
+ "click": "#manage-cookies"
4010
+ },
4011
+ {
4012
+ "waitForThenClick": "#accept-selected"
4013
+ }
4014
+ ]
4015
+ },
3917
4016
  {
3918
4017
  "name": "samsung.com",
3919
4018
  "runContext": {