@duckduckgo/autoconsent 9.2.0 → 9.3.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
+ # v9.3.0 (Fri Jan 26 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - Add rules from Jan 10 Ghostery fixes [#341](https://github.com/duckduckgo/autoconsent/pull/341) ([@seia-soto](https://github.com/seia-soto))
6
+ - Fix the Canonical rule [#345](https://github.com/duckduckgo/autoconsent/pull/345) ([@muodov](https://github.com/muodov))
7
+ - Update the EZoic rule [#344](https://github.com/duckduckgo/autoconsent/pull/344) ([@muodov](https://github.com/muodov))
8
+
9
+ #### Authors: 2
10
+
11
+ - HoJeong Go ([@seia-soto](https://github.com/seia-soto))
12
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
13
+
14
+ ---
15
+
16
+ # v9.2.1 (Fri Jan 26 2024)
17
+
18
+ #### 🐛 Bug Fix
19
+
20
+ - Handle absence of structuredClone() [#356](https://github.com/duckduckgo/autoconsent/pull/356) ([@muodov](https://github.com/muodov))
21
+
22
+ #### Authors: 1
23
+
24
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
25
+
26
+ ---
27
+
1
28
  # v9.2.0 (Thu Jan 25 2024)
2
29
 
3
30
  #### 🚀 Enhancement
@@ -69,7 +69,7 @@
69
69
  EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
70
70
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
71
71
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
72
- EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
72
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
73
73
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
74
74
  EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
75
75
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
@@ -112,7 +112,7 @@
112
112
  EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
113
113
  EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
114
114
  EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
115
- EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
115
+ EVAL_UBUNTU_COM_0: () => document.cookie.includes("_cookies_accepted=essential"),
116
116
  EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
117
117
  EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
118
118
  EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
@@ -161,6 +161,12 @@
161
161
  }
162
162
 
163
163
  // lib/utils.ts
164
+ function copyObject(data) {
165
+ if (globalThis.structuredClone) {
166
+ return structuredClone(data);
167
+ }
168
+ return JSON.parse(JSON.stringify(data));
169
+ }
164
170
  function normalizeConfig(providedConfig) {
165
171
  const defaultConfig = {
166
172
  enabled: true,
@@ -180,7 +186,7 @@
180
186
  messages: false
181
187
  }
182
188
  };
183
- const updatedConfig = structuredClone(defaultConfig);
189
+ const updatedConfig = copyObject(defaultConfig);
184
190
  for (const key of Object.keys(defaultConfig)) {
185
191
  if (typeof providedConfig[key] !== "undefined") {
186
192
  updatedConfig[key] = providedConfig[key];
@@ -516,7 +516,7 @@
516
516
  EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
517
517
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
518
518
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
519
- EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
519
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
520
520
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
521
521
  EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
522
522
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
@@ -559,7 +559,7 @@
559
559
  EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
560
560
  EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
561
561
  EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
562
- EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
562
+ EVAL_UBUNTU_COM_0: () => document.cookie.includes("_cookies_accepted=essential"),
563
563
  EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
564
564
  EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
565
565
  EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
@@ -951,6 +951,12 @@
951
951
  }
952
952
  return false;
953
953
  }
954
+ function copyObject(data) {
955
+ if (globalThis.structuredClone) {
956
+ return structuredClone(data);
957
+ }
958
+ return JSON.parse(JSON.stringify(data));
959
+ }
954
960
  function normalizeConfig(providedConfig) {
955
961
  const defaultConfig = {
956
962
  enabled: true,
@@ -970,7 +976,7 @@
970
976
  messages: false
971
977
  }
972
978
  };
973
- const updatedConfig = structuredClone(defaultConfig);
979
+ const updatedConfig = copyObject(defaultConfig);
974
980
  for (const key of Object.keys(defaultConfig)) {
975
981
  if (typeof providedConfig[key] !== "undefined") {
976
982
  updatedConfig[key] = providedConfig[key];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2024.1.11",
4
+ "version": "2024.1.26",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -770,6 +770,38 @@
770
770
  }
771
771
  ]
772
772
  },
773
+ {
774
+ "name": "canyon.com",
775
+ "runContext": {
776
+ "urlPattern": "^https://www\\.canyon\\.com/"
777
+ },
778
+ "prehideSelectors": [
779
+ "div.modal.cookiesModal.is-open"
780
+ ],
781
+ "detectCmp": [
782
+ {
783
+ "exists": "div.modal.cookiesModal.is-open"
784
+ }
785
+ ],
786
+ "detectPopup": [
787
+ {
788
+ "visible": "div.modal.cookiesModal.is-open"
789
+ }
790
+ ],
791
+ "optIn": [
792
+ {
793
+ "click": "div.cookiesModal__buttonWrapper > button[data-closecause=\"close-by-submit\"]"
794
+ }
795
+ ],
796
+ "optOut": [
797
+ {
798
+ "click": "div.cookiesModal__buttonWrapper > button[data-closecause=\"close-by-manage-cookies\"]"
799
+ },
800
+ {
801
+ "waitForThenClick": "button#js-manage-data-privacy-save-button"
802
+ }
803
+ ]
804
+ },
773
805
  {
774
806
  "name": "cc-banner-springer",
775
807
  "prehideSelectors": [
@@ -2116,7 +2148,7 @@
2116
2148
  "waitFor": "#ez-cookie-dialog input[type=checkbox]"
2117
2149
  },
2118
2150
  {
2119
- "click": "#ez-cookie-dialog input[type=checkbox][checked]",
2151
+ "click": "#ez-cookie-dialog input[type=checkbox]:checked",
2120
2152
  "all": true
2121
2153
  },
2122
2154
  {
@@ -2413,6 +2445,35 @@
2413
2445
  }
2414
2446
  ]
2415
2447
  },
2448
+ {
2449
+ "name": "hetzner.com",
2450
+ "runContext": {
2451
+ "urlPattern": "^https://www\\.hetzner\\.com/"
2452
+ },
2453
+ "prehideSelectors": [
2454
+ "#CookieConsent"
2455
+ ],
2456
+ "detectCmp": [
2457
+ {
2458
+ "exists": "#CookieConsent"
2459
+ }
2460
+ ],
2461
+ "detectPopup": [
2462
+ {
2463
+ "visible": "#CookieConsent"
2464
+ }
2465
+ ],
2466
+ "optIn": [
2467
+ {
2468
+ "click": "#CookieConsentGiven"
2469
+ }
2470
+ ],
2471
+ "optOut": [
2472
+ {
2473
+ "click": "#CookieConsentDeclined"
2474
+ }
2475
+ ]
2476
+ },
2416
2477
  {
2417
2478
  "name": "hl.co.uk",
2418
2479
  "prehideSelectors": [
@@ -4019,6 +4080,38 @@
4019
4080
  }
4020
4081
  ]
4021
4082
  },
4083
+ {
4084
+ "name": "rog-forum.asus.com",
4085
+ "runContext": {
4086
+ "urlPattern": "^https://rog-forum\\.asus\\.com/"
4087
+ },
4088
+ "prehideSelectors": [
4089
+ "#cookie-policy-info"
4090
+ ],
4091
+ "detectCmp": [
4092
+ {
4093
+ "exists": "#cookie-policy-info"
4094
+ }
4095
+ ],
4096
+ "detectPopup": [
4097
+ {
4098
+ "visible": "#cookie-policy-info"
4099
+ }
4100
+ ],
4101
+ "optIn": [
4102
+ {
4103
+ "click": "div.cookie-btn-box > div[aria-label=\"Accept\"]"
4104
+ }
4105
+ ],
4106
+ "optOut": [
4107
+ {
4108
+ "click": "div.cookie-btn-box > div[aria-label=\"Reject\"]"
4109
+ },
4110
+ {
4111
+ "waitForThenClick": ".cookie-policy-lightbox-bottom > div[aria-label=\"Save Settings\"]"
4112
+ }
4113
+ ]
4114
+ },
4022
4115
  {
4023
4116
  "name": "roofingmegastore.co.uk",
4024
4117
  "runContext": {
@@ -4261,6 +4354,39 @@
4261
4354
  }
4262
4355
  ]
4263
4356
  },
4357
+ {
4358
+ "name": "strato.de",
4359
+ "prehideSelectors": [
4360
+ "#cookie_initial_modal",
4361
+ ".modal-backdrop"
4362
+ ],
4363
+ "runContext": {
4364
+ "urlPattern": "^https://www\\.strato\\.de/"
4365
+ },
4366
+ "detectCmp": [
4367
+ {
4368
+ "exists": "#cookie_initial_modal"
4369
+ }
4370
+ ],
4371
+ "detectPopup": [
4372
+ {
4373
+ "visible": "#cookie_initial_modal"
4374
+ }
4375
+ ],
4376
+ "optIn": [
4377
+ {
4378
+ "click": "button#jss_consent_all_initial_modal"
4379
+ }
4380
+ ],
4381
+ "optOut": [
4382
+ {
4383
+ "click": "button#jss_open_settings_modal"
4384
+ },
4385
+ {
4386
+ "click": "button#jss_consent_checked"
4387
+ }
4388
+ ]
4389
+ },
4264
4390
  {
4265
4391
  "name": "takealot.com",
4266
4392
  "cosmetic": true,
@@ -4697,6 +4823,61 @@
4697
4823
  }
4698
4824
  ]
4699
4825
  },
4826
+ {
4827
+ "name": "transip-nl",
4828
+ "runContext": {
4829
+ "urlPattern": "^https://www\\.transip\\.nl/"
4830
+ },
4831
+ "prehideSelectors": [
4832
+ "#consent-modal"
4833
+ ],
4834
+ "detectCmp": [
4835
+ {
4836
+ "any": [
4837
+ {
4838
+ "exists": "#consent-modal"
4839
+ },
4840
+ {
4841
+ "exists": "#privacy-settings-content"
4842
+ }
4843
+ ]
4844
+ }
4845
+ ],
4846
+ "detectPopup": [
4847
+ {
4848
+ "any": [
4849
+ {
4850
+ "visible": "#consent-modal"
4851
+ },
4852
+ {
4853
+ "visible": "#privacy-settings-content"
4854
+ }
4855
+ ]
4856
+ }
4857
+ ],
4858
+ "optIn": [
4859
+ {
4860
+ "click": "button[type=\"submit\"]"
4861
+ }
4862
+ ],
4863
+ "optOut": [
4864
+ {
4865
+ "if": {
4866
+ "exists": "#privacy-settings-content"
4867
+ },
4868
+ "then": [
4869
+ {
4870
+ "click": "button[type=\"submit\"]"
4871
+ }
4872
+ ],
4873
+ "else": [
4874
+ {
4875
+ "click": "div.one-modal__action-footer-column--secondary > a"
4876
+ }
4877
+ ]
4878
+ }
4879
+ ]
4880
+ },
4700
4881
  {
4701
4882
  "name": "tropicfeel-com",
4702
4883
  "prehideSelectors": [
@@ -4946,7 +5127,7 @@
4946
5127
  {
4947
5128
  "any": [
4948
5129
  {
4949
- "waitForThenClick": "button.p-button"
5130
+ "waitForThenClick": "button.js-manage"
4950
5131
  },
4951
5132
  {
4952
5133
  "waitForThenClick": "xpath///*[@id=\"cookie-policy-content\"]/p[4]/button[2]"
@@ -4954,14 +5135,15 @@
4954
5135
  ]
4955
5136
  },
4956
5137
  {
4957
- "waitForThenClick": ".p-switch__input:checked",
5138
+ "waitForThenClick": "dialog.cookie-policy .p-switch__input:checked",
4958
5139
  "optional": true,
4959
- "all": true
5140
+ "all": true,
5141
+ "timeout": 500
4960
5142
  },
4961
5143
  {
4962
5144
  "any": [
4963
5145
  {
4964
- "waitForThenClick": "div > button"
5146
+ "waitForThenClick": "dialog.cookie-policy .js-save-preferences"
4965
5147
  },
4966
5148
  {
4967
5149
  "waitForThenClick": "xpath///*[@id=\"modal\"]/div/button"
@@ -69,7 +69,7 @@
69
69
  EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
70
70
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
71
71
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
72
- EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
72
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
73
73
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
74
74
  EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
75
75
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
@@ -112,7 +112,7 @@
112
112
  EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
113
113
  EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
114
114
  EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
115
- EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
115
+ EVAL_UBUNTU_COM_0: () => document.cookie.includes("_cookies_accepted=essential"),
116
116
  EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
117
117
  EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
118
118
  EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
@@ -161,6 +161,12 @@
161
161
  }
162
162
 
163
163
  // lib/utils.ts
164
+ function copyObject(data) {
165
+ if (globalThis.structuredClone) {
166
+ return structuredClone(data);
167
+ }
168
+ return JSON.parse(JSON.stringify(data));
169
+ }
164
170
  function normalizeConfig(providedConfig) {
165
171
  const defaultConfig = {
166
172
  enabled: true,
@@ -180,7 +186,7 @@
180
186
  messages: false
181
187
  }
182
188
  };
183
- const updatedConfig = structuredClone(defaultConfig);
189
+ const updatedConfig = copyObject(defaultConfig);
184
190
  for (const key of Object.keys(defaultConfig)) {
185
191
  if (typeof providedConfig[key] !== "undefined") {
186
192
  updatedConfig[key] = providedConfig[key];
@@ -516,7 +516,7 @@
516
516
  EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
517
517
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
518
518
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
519
- EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
519
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
520
520
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
521
521
  EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
522
522
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
@@ -559,7 +559,7 @@
559
559
  EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
560
560
  EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
561
561
  EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
562
- EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
562
+ EVAL_UBUNTU_COM_0: () => document.cookie.includes("_cookies_accepted=essential"),
563
563
  EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
564
564
  EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
565
565
  EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
@@ -951,6 +951,12 @@
951
951
  }
952
952
  return false;
953
953
  }
954
+ function copyObject(data) {
955
+ if (globalThis.structuredClone) {
956
+ return structuredClone(data);
957
+ }
958
+ return JSON.parse(JSON.stringify(data));
959
+ }
954
960
  function normalizeConfig(providedConfig) {
955
961
  const defaultConfig = {
956
962
  enabled: true,
@@ -970,7 +976,7 @@
970
976
  messages: false
971
977
  }
972
978
  };
973
- const updatedConfig = structuredClone(defaultConfig);
979
+ const updatedConfig = copyObject(defaultConfig);
974
980
  for (const key of Object.keys(defaultConfig)) {
975
981
  if (typeof providedConfig[key] !== "undefined") {
976
982
  updatedConfig[key] = providedConfig[key];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2024.1.11",
4
+ "version": "2024.1.26",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },
@@ -30,6 +30,12 @@
30
30
  }
31
31
 
32
32
  // lib/utils.ts
33
+ function copyObject(data) {
34
+ if (globalThis.structuredClone) {
35
+ return structuredClone(data);
36
+ }
37
+ return JSON.parse(JSON.stringify(data));
38
+ }
33
39
  function normalizeConfig(providedConfig) {
34
40
  const defaultConfig = {
35
41
  enabled: true,
@@ -49,7 +55,7 @@
49
55
  messages: false
50
56
  }
51
57
  };
52
- const updatedConfig = structuredClone(defaultConfig);
58
+ const updatedConfig = copyObject(defaultConfig);
53
59
  for (const key of Object.keys(defaultConfig)) {
54
60
  if (typeof providedConfig[key] !== "undefined") {
55
61
  updatedConfig[key] = providedConfig[key];