@duckduckgo/autoconsent 10.7.0 → 10.9.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.
Files changed (37) hide show
  1. package/.github/workflows/ddg-release.yml +5 -9
  2. package/CHANGELOG.md +51 -0
  3. package/ci/asana-create-tasks.js +2 -2
  4. package/ci/clients_pr_template.md +3 -0
  5. package/data/coverage.json +997 -1011
  6. package/dist/addon-firefox/background.bundle.js +5 -0
  7. package/dist/addon-firefox/content.bundle.js +28 -10
  8. package/dist/addon-firefox/manifest.json +1 -1
  9. package/dist/addon-firefox/rules.json +135 -17
  10. package/dist/addon-mv3/background.bundle.js +5 -0
  11. package/dist/addon-mv3/content.bundle.js +28 -10
  12. package/dist/addon-mv3/manifest.json +1 -1
  13. package/dist/addon-mv3/rules.json +135 -17
  14. package/dist/autoconsent.cjs.js +28 -10
  15. package/dist/autoconsent.esm.js +28 -10
  16. package/dist/autoconsent.playwright.js +1 -1
  17. package/dist/autoconsent.unit.js +163 -27
  18. package/lib/cmps/evidon.ts +4 -3
  19. package/lib/cmps/trustarc-frame.ts +25 -6
  20. package/lib/cmps/trustarc-top.ts +2 -1
  21. package/lib/eval-snippets.ts +5 -0
  22. package/package.json +1 -1
  23. package/readme.md +2 -4
  24. package/rules/autoconsent/aquasana-com.json +12 -3
  25. package/rules/autoconsent/complianz-opt-out.json +12 -1
  26. package/rules/autoconsent/cookiecuttr.json +37 -0
  27. package/rules/autoconsent/fides.json +5 -2
  28. package/rules/autoconsent/instagram.json +1 -1
  29. package/rules/autoconsent/ketch.json +8 -5
  30. package/rules/autoconsent/roblox.json +36 -0
  31. package/rules/autoconsent/uswitch.json +10 -5
  32. package/rules/rules.json +135 -17
  33. package/tests/aquasana-com.spec.ts +4 -1
  34. package/tests/cookiecuttr.spec.ts +7 -0
  35. package/tests/fides.spec.ts +1 -0
  36. package/tests/ketch.spec.ts +6 -0
  37. package/tests/roblox.spec.ts +5 -0
@@ -498,6 +498,8 @@
498
498
  },
499
499
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
500
500
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
501
+ EVAL_TRUSTARC_FRAME_TEST: () => window && window.QueryString && window.QueryString.preferences === "0",
502
+ EVAL_TRUSTARC_FRAME_GTM: () => window && window.QueryString && window.QueryString.gtm === "1",
501
503
  // declarative rules
502
504
  EVAL_ADROLL_0: () => !document.cookie.includes("__adroll_fpc"),
503
505
  EVAL_ALMACMP_0: () => document.cookie.includes('"name":"Google","consent":false'),
@@ -542,6 +544,7 @@
542
544
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
543
545
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
544
546
  EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
547
+ EVAL_FIDES_DETECT_POPUP: () => window.Fides?.initialized,
545
548
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
546
549
  EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
547
550
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
@@ -551,6 +554,7 @@
551
554
  EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
552
555
  EVAL_IWINK_TEST: () => document.cookie.includes("cookie_permission_granted=no"),
553
556
  EVAL_JQUERY_COOKIEBAR_0: () => !document.cookie.includes("cookies-state=accepted"),
557
+ EVAL_KETCH_TEST: () => document.cookie.includes("_ketch_consent_v1_"),
554
558
  EVAL_MEDIAVINE_0: () => document.querySelectorAll('[data-name="mediavine-gdpr-cmp"] input[type=checkbox]').forEach((x) => x.checked && x.click()) || true,
555
559
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Reject|Ablehnen"))[0].click() || true,
556
560
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll("div > button")).filter((el) => el.innerText.match("Accept|Annehmen"))[0].click() || true,
@@ -565,6 +569,7 @@
565
569
  EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
566
570
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
567
571
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
572
+ EVAL_ROBLOX_TEST: () => document.cookie.includes("RBXcb"),
568
573
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
569
574
  document.documentElement.classList.forEach((cls) => {
570
575
  if (cls.startsWith("sd-cmp-"))
@@ -1043,7 +1048,7 @@
1043
1048
  this._optInDone = false;
1044
1049
  }
1045
1050
  get hasSelfTest() {
1046
- return false;
1051
+ return true;
1047
1052
  }
1048
1053
  get isIntermediate() {
1049
1054
  if (this._optInDone) {
@@ -1090,6 +1095,7 @@
1090
1095
  return true;
1091
1096
  }
1092
1097
  async test() {
1098
+ await this.wait(500);
1093
1099
  return await this.mainWorldEval("EVAL_TRUSTARC_TOP");
1094
1100
  }
1095
1101
  };
@@ -1106,7 +1112,7 @@
1106
1112
  };
1107
1113
  }
1108
1114
  get hasSelfTest() {
1109
- return false;
1115
+ return true;
1110
1116
  }
1111
1117
  get isIntermediate() {
1112
1118
  return false;
@@ -1142,27 +1148,34 @@
1142
1148
  );
1143
1149
  }
1144
1150
  async optOut() {
1151
+ if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_TEST")) {
1152
+ return true;
1153
+ }
1154
+ let timeout = 3e3;
1155
+ if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_GTM")) {
1156
+ timeout = 1500;
1157
+ }
1145
1158
  await waitFor(() => document.readyState === "complete", 20, 100);
1146
- await this.waitForElement(".mainContent[aria-hidden=false]", 5e3);
1159
+ await this.waitForElement(".mainContent[aria-hidden=false]", timeout);
1147
1160
  if (this.click(".rejectAll")) {
1148
1161
  return true;
1149
1162
  }
1150
1163
  if (this.elementExists(".prefPanel")) {
1151
- await this.waitForElement('.prefPanel[style="visibility: visible;"]', 3e3);
1164
+ await this.waitForElement('.prefPanel[style="visibility: visible;"]', timeout);
1152
1165
  }
1153
1166
  if (this.click("#catDetails0")) {
1154
1167
  this.click(".submit");
1155
- this.waitForThenClick("#gwt-debug-close_id", 5e3);
1168
+ this.waitForThenClick("#gwt-debug-close_id", timeout);
1156
1169
  return true;
1157
1170
  }
1158
1171
  if (this.click(".required")) {
1159
- this.waitForThenClick("#gwt-debug-close_id", 5e3);
1172
+ this.waitForThenClick("#gwt-debug-close_id", timeout);
1160
1173
  return true;
1161
1174
  }
1162
1175
  await this.navigateToSettings();
1163
1176
  this.click(".switch span:nth-child(1):not(.active)", true);
1164
1177
  this.click(".submit");
1165
- this.waitForThenClick("#gwt-debug-close_id", 3e5);
1178
+ this.waitForThenClick("#gwt-debug-close_id", timeout * 10);
1166
1179
  return true;
1167
1180
  }
1168
1181
  async optIn() {
@@ -1177,6 +1190,10 @@
1177
1190
  });
1178
1191
  return true;
1179
1192
  }
1193
+ async test() {
1194
+ await this.wait(500);
1195
+ return await this.mainWorldEval("EVAL_TRUSTARC_FRAME_TEST");
1196
+ }
1180
1197
  };
1181
1198
 
1182
1199
  // lib/cmps/cookiebot.ts
@@ -1425,10 +1442,11 @@
1425
1442
  if (this.click("#_evidon-decline-button")) {
1426
1443
  return true;
1427
1444
  }
1428
- hideElements(getStyleElement(), "#evidon-prefdiag-overlay,#evidon-prefdiag-background");
1429
- this.click("#_evidon-option-button");
1445
+ hideElements(getStyleElement(), "#evidon-prefdiag-overlay,#evidon-prefdiag-background,#_evidon-background");
1446
+ await this.waitForThenClick("#_evidon-option-button");
1430
1447
  await this.waitForElement("#evidon-prefdiag-overlay", 5e3);
1431
- this.click("#evidon-prefdiag-decline");
1448
+ await this.wait(500);
1449
+ await this.waitForThenClick("#evidon-prefdiag-decline");
1432
1450
  return true;
1433
1451
  }
1434
1452
  async optIn() {
@@ -2749,7 +2767,6 @@
2749
2767
  },
2750
2768
  {
2751
2769
  name: "aquasana.com",
2752
- cosmetic: true,
2753
2770
  prehideSelectors: [
2754
2771
  "#consent-tracking"
2755
2772
  ],
@@ -2765,12 +2782,24 @@
2765
2782
  ],
2766
2783
  optIn: [
2767
2784
  {
2768
- click: "#accept_consent"
2785
+ waitForThenClick: "#consent-tracking .affirm.btn"
2769
2786
  }
2770
2787
  ],
2771
2788
  optOut: [
2772
2789
  {
2773
- hide: "#consent-tracking"
2790
+ if: {
2791
+ exists: "#consent-tracking .decline.btn"
2792
+ },
2793
+ then: [
2794
+ {
2795
+ click: "#consent-tracking .decline.btn"
2796
+ }
2797
+ ],
2798
+ else: [
2799
+ {
2800
+ hide: "#consent-tracking"
2801
+ }
2802
+ ]
2774
2803
  }
2775
2804
  ]
2776
2805
  },
@@ -3946,7 +3975,20 @@
3946
3975
  ],
3947
3976
  else: [
3948
3977
  {
3949
- hide: '[aria-describedby="cookieconsent:desc"]'
3978
+ if: {
3979
+ exists: ".cmp-pref-link"
3980
+ },
3981
+ then: [
3982
+ {
3983
+ click: ".cmp-pref-link"
3984
+ },
3985
+ {
3986
+ waitForThenClick: ".cmp-body [id*=rejectAll]"
3987
+ },
3988
+ {
3989
+ waitForThenClick: ".cmp-body .cmp-save-btn"
3990
+ }
3991
+ ]
3950
3992
  }
3951
3993
  ]
3952
3994
  }
@@ -4340,6 +4382,51 @@
4340
4382
  }
4341
4383
  ]
4342
4384
  },
4385
+ {
4386
+ name: "cookiecuttr",
4387
+ vendorUrl: "https://github.com/cdwharton/cookieCuttr",
4388
+ cosmetic: false,
4389
+ runContext: {
4390
+ main: true,
4391
+ frame: false,
4392
+ urlPattern: ""
4393
+ },
4394
+ prehideSelectors: [
4395
+ ".cc-cookies"
4396
+ ],
4397
+ detectCmp: [
4398
+ {
4399
+ exists: ".cc-cookies .cc-cookie-accept"
4400
+ }
4401
+ ],
4402
+ detectPopup: [
4403
+ {
4404
+ visible: ".cc-cookies .cc-cookie-accept"
4405
+ }
4406
+ ],
4407
+ optIn: [
4408
+ {
4409
+ waitForThenClick: ".cc-cookies .cc-cookie-accept"
4410
+ }
4411
+ ],
4412
+ optOut: [
4413
+ {
4414
+ if: {
4415
+ exists: ".cc-cookies .cc-cookie-decline"
4416
+ },
4417
+ then: [
4418
+ {
4419
+ click: ".cc-cookies .cc-cookie-decline"
4420
+ }
4421
+ ],
4422
+ else: [
4423
+ {
4424
+ hide: ".cc-cookies"
4425
+ }
4426
+ ]
4427
+ }
4428
+ ]
4429
+ },
4343
4430
  {
4344
4431
  name: "cookiefirst.com",
4345
4432
  prehideSelectors: [
@@ -5259,16 +5346,19 @@
5259
5346
  detectPopup: [
5260
5347
  {
5261
5348
  visible: "#fides-overlay #fides-banner"
5349
+ },
5350
+ {
5351
+ eval: "EVAL_FIDES_DETECT_POPUP"
5262
5352
  }
5263
5353
  ],
5264
5354
  optIn: [
5265
5355
  {
5266
- waitForThenClick: '#fides-banner [data-testid="Accept all-btn"]'
5356
+ waitForThenClick: "#fides-banner .fides-accept-all-button"
5267
5357
  }
5268
5358
  ],
5269
5359
  optOut: [
5270
5360
  {
5271
- waitForThenClick: '#fides-banner [data-testid="Reject all-btn"]'
5361
+ waitForThenClick: "#fides-banner .fides-reject-all-button"
5272
5362
  }
5273
5363
  ]
5274
5364
  },
@@ -5751,7 +5841,7 @@
5751
5841
  urlPattern: "^https://www\\.instagram\\.com/"
5752
5842
  },
5753
5843
  prehideSelectors: [
5754
- ".x78zum5.xdt5ytf.xg6iff7.x1n2onr6"
5844
+ ".x78zum5.xdt5ytf.xg6iff7.x1n2onr6:has(._a9--)"
5755
5845
  ],
5756
5846
  detectCmp: [
5757
5847
  {
@@ -6113,29 +6203,34 @@
6113
6203
  },
6114
6204
  then: [
6115
6205
  {
6116
- waitForThenClick: "#lanyard_root div[class*=buttons] > button[class*=secondaryButton]",
6206
+ waitForThenClick: "#lanyard_root div[class*=buttons] > button[class*=secondaryButton], #lanyard_root button[class*=buttons-secondary]",
6117
6207
  comment: "can be either settings or reject button"
6118
6208
  }
6119
6209
  ]
6120
6210
  },
6121
6211
  {
6122
- waitFor: "#lanyard_root [aria-describedby=preference-description],#lanyard_root [aria-describedby=modal-description]",
6212
+ waitFor: "#lanyard_root [aria-describedby=preference-description],#lanyard_root [aria-describedby=modal-description], #ketch-preferences",
6123
6213
  timeout: 1e3,
6124
6214
  optional: true
6125
6215
  },
6126
6216
  {
6127
6217
  if: {
6128
- exists: "#lanyard_root [aria-describedby=preference-description],#lanyard_root [aria-describedby=modal-description]"
6218
+ exists: "#lanyard_root [aria-describedby=preference-description],#lanyard_root [aria-describedby=modal-description], #ketch-preferences"
6129
6219
  },
6130
6220
  then: [
6131
6221
  {
6132
- waitForThenClick: "#lanyard_root button[class*=rejectButton]"
6222
+ waitForThenClick: "#lanyard_root button[class*=rejectButton], #lanyard_root button[class*=rejectAllButton]"
6133
6223
  },
6134
6224
  {
6135
- click: "#lanyard_root button[class*=confirmButton],#lanyard_root div[class*=actions_] > button:nth-child(1)"
6225
+ click: "#lanyard_root button[class*=confirmButton],#lanyard_root div[class*=actions_] > button:nth-child(1), #lanyard_root button[class*=actionButton]"
6136
6226
  }
6137
6227
  ]
6138
6228
  }
6229
+ ],
6230
+ test: [
6231
+ {
6232
+ eval: "EVAL_KETCH_TEST"
6233
+ }
6139
6234
  ]
6140
6235
  },
6141
6236
  {
@@ -7537,6 +7632,42 @@
7537
7632
  }
7538
7633
  ]
7539
7634
  },
7635
+ {
7636
+ name: "roblox",
7637
+ vendorUrl: "https://roblox.com",
7638
+ cosmetic: false,
7639
+ runContext: {
7640
+ main: true,
7641
+ frame: false,
7642
+ urlPattern: "^https://(www\\.)?roblox\\.com/"
7643
+ },
7644
+ prehideSelectors: [],
7645
+ detectCmp: [
7646
+ {
7647
+ exists: ".cookie-banner-wrapper"
7648
+ }
7649
+ ],
7650
+ detectPopup: [
7651
+ {
7652
+ visible: ".cookie-banner-wrapper .cookie-banner"
7653
+ }
7654
+ ],
7655
+ optIn: [
7656
+ {
7657
+ waitForThenClick: ".cookie-banner-wrapper button.btn-cta-lg"
7658
+ }
7659
+ ],
7660
+ optOut: [
7661
+ {
7662
+ waitForThenClick: ".cookie-banner-wrapper button.btn-secondary-lg"
7663
+ }
7664
+ ],
7665
+ test: [
7666
+ {
7667
+ eval: "EVAL_ROBLOX_TEST"
7668
+ }
7669
+ ]
7670
+ },
7540
7671
  {
7541
7672
  name: "rog-forum.asus.com",
7542
7673
  runContext: {
@@ -8958,27 +9089,32 @@
8958
9089
  },
8959
9090
  {
8960
9091
  name: "uswitch.com",
9092
+ runContext: {
9093
+ main: true,
9094
+ frame: false,
9095
+ urlPattern: "^https://(www\\.)?uswitch\\.com/"
9096
+ },
8961
9097
  prehideSelectors: [
8962
- "#cookie-banner-wrapper"
9098
+ ".ucb"
8963
9099
  ],
8964
9100
  detectCmp: [
8965
9101
  {
8966
- exists: "#cookie-banner-wrapper"
9102
+ exists: ".ucb-banner"
8967
9103
  }
8968
9104
  ],
8969
9105
  detectPopup: [
8970
9106
  {
8971
- visible: "#cookie-banner-wrapper"
9107
+ visible: ".ucb-banner"
8972
9108
  }
8973
9109
  ],
8974
9110
  optIn: [
8975
9111
  {
8976
- click: "#cookie_banner_accept_mobile"
9112
+ waitForThenClick: ".ucb-banner .ucb-btn-accept"
8977
9113
  }
8978
9114
  ],
8979
9115
  optOut: [
8980
9116
  {
8981
- click: "#cookie_banner_save"
9117
+ waitForThenClick: ".ucb-banner .ucb-btn-save"
8982
9118
  }
8983
9119
  ]
8984
9120
  },
@@ -29,12 +29,13 @@ export default class Evidon extends AutoConsentCMPBase {
29
29
  return true;
30
30
  }
31
31
 
32
- hideElements(getStyleElement(), "#evidon-prefdiag-overlay,#evidon-prefdiag-background");
33
- this.click("#_evidon-option-button");
32
+ hideElements(getStyleElement(), "#evidon-prefdiag-overlay,#evidon-prefdiag-background,#_evidon-background");
33
+ await this.waitForThenClick("#_evidon-option-button");
34
34
 
35
35
  await this.waitForElement("#evidon-prefdiag-overlay", 5000);
36
36
 
37
- this.click("#evidon-prefdiag-decline");
37
+ await this.wait(500);
38
+ await this.waitForThenClick("#evidon-prefdiag-decline");
38
39
  return true;
39
40
  }
40
41
 
@@ -12,7 +12,7 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
12
12
  }
13
13
 
14
14
  get hasSelfTest(): boolean {
15
- return false;
15
+ return true;
16
16
  }
17
17
 
18
18
  get isIntermediate(): boolean {
@@ -66,25 +66,37 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
66
66
  }
67
67
 
68
68
  async optOut() {
69
+
70
+ // if the user has already opted out, let's not close the window
71
+ if (await this.mainWorldEval('EVAL_TRUSTARC_FRAME_TEST')){
72
+ return true;
73
+ }
74
+
75
+ //When Tags are being controlled through a tag managment system, the window will not call the vendors' opt-out
76
+ let timeout = 3000;
77
+ if (await this.mainWorldEval('EVAL_TRUSTARC_FRAME_GTM')) {
78
+ timeout = 1500;
79
+ }
80
+
69
81
  await waitFor(() => document.readyState === 'complete', 20, 100);
70
- await this.waitForElement(".mainContent[aria-hidden=false]", 5000);
82
+ await this.waitForElement(".mainContent[aria-hidden=false]", timeout);
71
83
 
72
84
  if (this.click(".rejectAll")) {
73
85
  return true;
74
86
  }
75
87
 
76
88
  if (this.elementExists('.prefPanel')) {
77
- await this.waitForElement('.prefPanel[style="visibility: visible;"]', 3000);
89
+ await this.waitForElement('.prefPanel[style="visibility: visible;"]', timeout);
78
90
  }
79
91
 
80
92
  if (this.click("#catDetails0")) {
81
93
  this.click(".submit");
82
- this.waitForThenClick("#gwt-debug-close_id", 5000);
94
+ this.waitForThenClick("#gwt-debug-close_id", timeout);
83
95
  return true;
84
96
  }
85
97
 
86
98
  if (this.click(".required")) {
87
- this.waitForThenClick("#gwt-debug-close_id", 5000);
99
+ this.waitForThenClick("#gwt-debug-close_id", timeout);
88
100
  return true;
89
101
  }
90
102
 
@@ -95,7 +107,7 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
95
107
  this.click(".submit");
96
108
 
97
109
  // at this point, iframe usually closes. Sometimes we need to close manually, but we don't wait for it to report success
98
- this.waitForThenClick("#gwt-debug-close_id", 300000);
110
+ this.waitForThenClick("#gwt-debug-close_id", timeout*10);
99
111
 
100
112
  return true;
101
113
  }
@@ -116,4 +128,11 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
116
128
 
117
129
  return true;
118
130
  }
131
+
132
+ async test() {
133
+ //Test JS variable to check the user's preference
134
+ //preferences = undefined means no consent is set, preferences = '0' means consent is set to required only
135
+ await this.wait(500);
136
+ return await this.mainWorldEval('EVAL_TRUSTARC_FRAME_TEST');
137
+ }
119
138
  }
@@ -31,7 +31,7 @@ export default class TrustArcTop extends AutoConsentCMPBase {
31
31
  }
32
32
 
33
33
  get hasSelfTest(): boolean {
34
- return false;
34
+ return true;
35
35
  }
36
36
 
37
37
  get isIntermediate(): boolean {
@@ -97,6 +97,7 @@ export default class TrustArcTop extends AutoConsentCMPBase {
97
97
  async test() {
98
98
  //Test JS variable to check the user's preference
99
99
  //PrefCookie = undefined means no consent is set, PrefCookie = '0' means consent is set to required only
100
+ await this.wait(500);
100
101
  return await this.mainWorldEval('EVAL_TRUSTARC_TOP');
101
102
  }
102
103
  }
@@ -49,6 +49,8 @@ export const snippets = {
49
49
  },
50
50
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(',').filter(s => s.length > 0).length <= 1,
51
51
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === '0',
52
+ EVAL_TRUSTARC_FRAME_TEST: () => window && window.QueryString && window.QueryString.preferences === '0',
53
+ EVAL_TRUSTARC_FRAME_GTM: () => window && window.QueryString && window.QueryString.gtm === '1',
52
54
 
53
55
  // declarative rules
54
56
  EVAL_ADROLL_0: () => !document.cookie.includes('__adroll_fpc'),
@@ -92,12 +94,14 @@ export const snippets = {
92
94
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes('euCookie'),
93
95
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
94
96
  EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
97
+ EVAL_FIDES_DETECT_POPUP: () => window.Fides?.initialized,
95
98
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
96
99
  EVAL_HEMA_TEST_0: () => document.cookie.includes('cookies_rejected=1'),
97
100
  EVAL_IUBENDA_0: () => document.querySelectorAll('.purposes-item input[type=checkbox]:not([disabled])').forEach(x => {if(x.checked) x.click()}) || true,
98
101
  EVAL_IUBENDA_1: () => !!document.cookie.match(/_iub_cs-\d+=/),
99
102
  EVAL_IWINK_TEST: () => document.cookie.includes('cookie_permission_granted=no'),
100
103
  EVAL_JQUERY_COOKIEBAR_0: () => !document.cookie.includes('cookies-state=accepted'),
104
+ EVAL_KETCH_TEST: () => document.cookie.includes('_ketch_consent_v1_'),
101
105
  EVAL_MEDIAVINE_0: () => document.querySelectorAll("[data-name=\"mediavine-gdpr-cmp\"] input[type=checkbox]").forEach(x => x.checked && x.click()) || true,
102
106
  EVAL_MICROSOFT_0: () => Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Reject|Ablehnen'))[0].click() || true,
103
107
  EVAL_MICROSOFT_1: () => Array.from(document.querySelectorAll('div > button')).filter(el => el.innerText.match('Accept|Annehmen'))[0].click() || true,
@@ -109,6 +113,7 @@ export const snippets = {
109
113
  EVAL_PRIMEBOX_0: () => !document.cookie.includes('cb-enabled=accepted'),
110
114
  EVAL_PUBTECH_0: () => document.cookie.includes('euconsent-v2') && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)) ,
111
115
  EVAL_REDDIT_0: () => document.cookie.includes('eu_cookie={%22opted%22:true%2C%22nonessential%22:false}'),
116
+ EVAL_ROBLOX_TEST: () => document.cookie.includes('RBXcb'),
112
117
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
113
118
  document.documentElement.classList.forEach(cls => {
114
119
  if (cls.startsWith('sd-cmp-')) document.documentElement.classList.remove(cls)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckduckgo/autoconsent",
3
- "version": "10.7.0",
3
+ "version": "10.9.0",
4
4
  "description": "",
5
5
  "main": "dist/autoconsent.cjs.js",
6
6
  "module": "dist/autoconsent.esm.js",
package/readme.md CHANGED
@@ -12,10 +12,8 @@ The web extension can be built with the following steps:
12
12
  ```bash
13
13
  # Download dependencies
14
14
  npm ci
15
- # Build consent ruleset
16
- npm run build-rules
17
- # Build JS bundles (rules must be built first)
18
- npm run bundle
15
+ # Build the extension
16
+ npm run prepublish
19
17
  ```
20
18
 
21
19
  The extension-specific code can be found in the `addon` directory. There are two versions of the
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "name": "aquasana.com",
3
- "cosmetic": true,
4
3
  "prehideSelectors": ["#consent-tracking"],
5
4
  "detectCmp": [{ "exists": "#consent-tracking" }],
6
5
  "detectPopup": [{ "exists": "#consent-tracking" }],
7
- "optIn": [{ "click": "#accept_consent" }],
8
- "optOut": [{ "hide": "#consent-tracking" }]
6
+ "optIn": [
7
+ {
8
+ "waitForThenClick": "#consent-tracking .affirm.btn"
9
+ }
10
+ ],
11
+ "optOut": [
12
+ {
13
+ "if": { "exists": "#consent-tracking .decline.btn" },
14
+ "then": [{ "click": "#consent-tracking .decline.btn" }],
15
+ "else": [{ "hide": "#consent-tracking" }]
16
+ }
17
+ ]
9
18
  }
@@ -39,7 +39,18 @@
39
39
  ],
40
40
  "else": [
41
41
  {
42
- "hide": "[aria-describedby=\"cookieconsent:desc\"]"
42
+ "if": { "exists": ".cmp-pref-link" },
43
+ "then": [
44
+ {
45
+ "click": ".cmp-pref-link"
46
+ },
47
+ {
48
+ "waitForThenClick": ".cmp-body [id*=rejectAll]"
49
+ },
50
+ {
51
+ "waitForThenClick": ".cmp-body .cmp-save-btn"
52
+ }
53
+ ]
43
54
  }
44
55
  ]
45
56
  }
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "cookiecuttr",
3
+ "vendorUrl": "https://github.com/cdwharton/cookieCuttr",
4
+ "cosmetic": false,
5
+ "runContext": {
6
+ "main": true,
7
+ "frame": false,
8
+ "urlPattern": ""
9
+ },
10
+ "prehideSelectors": [".cc-cookies"],
11
+ "detectCmp": [
12
+ {
13
+ "exists": ".cc-cookies .cc-cookie-accept"
14
+ }
15
+ ],
16
+ "detectPopup": [
17
+ {
18
+ "visible": ".cc-cookies .cc-cookie-accept"
19
+ }
20
+ ],
21
+ "optIn": [
22
+ {
23
+ "waitForThenClick": ".cc-cookies .cc-cookie-accept"
24
+ }
25
+ ],
26
+ "optOut": [
27
+ {
28
+ "if": { "exists": ".cc-cookies .cc-cookie-decline" },
29
+ "then": [{
30
+ "click": ".cc-cookies .cc-cookie-decline"
31
+ }],
32
+ "else": [{
33
+ "hide": ".cc-cookies"
34
+ }]
35
+ }
36
+ ]
37
+ }
@@ -10,16 +10,19 @@
10
10
  "detectPopup": [
11
11
  {
12
12
  "visible": "#fides-overlay #fides-banner"
13
+ },
14
+ {
15
+ "eval": "EVAL_FIDES_DETECT_POPUP"
13
16
  }
14
17
  ],
15
18
  "optIn": [
16
19
  {
17
- "waitForThenClick": "#fides-banner [data-testid=\"Accept all-btn\"]"
20
+ "waitForThenClick": "#fides-banner .fides-accept-all-button"
18
21
  }
19
22
  ],
20
23
  "optOut": [
21
24
  {
22
- "waitForThenClick": "#fides-banner [data-testid=\"Reject all-btn\"]"
25
+ "waitForThenClick": "#fides-banner .fides-reject-all-button"
23
26
  }
24
27
  ]
25
28
  }
@@ -4,7 +4,7 @@
4
4
  "runContext": {
5
5
  "urlPattern": "^https://www\\.instagram\\.com/"
6
6
  },
7
- "prehideSelectors": [".x78zum5.xdt5ytf.xg6iff7.x1n2onr6"],
7
+ "prehideSelectors": [".x78zum5.xdt5ytf.xg6iff7.x1n2onr6:has(._a9--)"],
8
8
  "detectCmp": [
9
9
  {
10
10
  "exists": ".x1qjc9v5.x9f619.x78zum5.xdt5ytf.x1iyjqo2.xl56j7k"