@duckduckgo/autoconsent 10.6.0 → 10.6.2

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
+ # v10.6.2 (Tue Apr 23 2024)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - Click 'Save & Exit' instead of 'Cancel' in dmgmedia popup [#425](https://github.com/duckduckgo/autoconsent/pull/425) ([@sammacbeth](https://github.com/sammacbeth))
6
+ - Fix sibbo rule [#423](https://github.com/duckduckgo/autoconsent/pull/423) ([@sammacbeth](https://github.com/sammacbeth))
7
+ - Update readme.md [#420](https://github.com/duckduckgo/autoconsent/pull/420) ([@hyebahi](https://github.com/hyebahi))
8
+
9
+ #### Authors: 2
10
+
11
+ - [@hyebahi](https://github.com/hyebahi)
12
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
13
+
14
+ ---
15
+
16
+ # v10.6.1 (Fri Apr 12 2024)
17
+
18
+ #### 🐛 Bug Fix
19
+
20
+ - Fix Klaro rule (wogibtswas.de, www.suedtirol.com) [#404](https://github.com/duckduckgo/autoconsent/pull/404) ([@sammacbeth](https://github.com/sammacbeth))
21
+
22
+ #### Authors: 1
23
+
24
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
25
+
26
+ ---
27
+
1
28
  # v10.6.0 (Fri Apr 12 2024)
2
29
 
3
30
  #### 🚀 Enhancement
@@ -28,6 +28,22 @@
28
28
  return Object.keys(consents).filter((k) => optionalServices.includes(k)).every((k) => consents[k] === false);
29
29
  }
30
30
  },
31
+ EVAL_KLARO_OPEN_POPUP: () => {
32
+ klaro.show(void 0, true);
33
+ },
34
+ EVAL_KLARO_TRY_API_OPT_OUT: () => {
35
+ if (window.klaro && typeof klaro.show === "function" && typeof klaro.getManager === "function") {
36
+ try {
37
+ klaro.getManager().changeAll(false);
38
+ klaro.getManager().saveAndApplyConsents();
39
+ return true;
40
+ } catch (e) {
41
+ console.warn(e);
42
+ return false;
43
+ }
44
+ }
45
+ return false;
46
+ },
31
47
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
32
48
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
33
49
  // declarative rules
@@ -97,7 +113,6 @@
97
113
  EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
98
114
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
99
115
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
100
- EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
101
116
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
102
117
  document.documentElement.classList.forEach((cls) => {
103
118
  if (cls.startsWith("sd-cmp-"))
@@ -475,6 +475,22 @@
475
475
  return Object.keys(consents).filter((k) => optionalServices.includes(k)).every((k) => consents[k] === false);
476
476
  }
477
477
  },
478
+ EVAL_KLARO_OPEN_POPUP: () => {
479
+ klaro.show(void 0, true);
480
+ },
481
+ EVAL_KLARO_TRY_API_OPT_OUT: () => {
482
+ if (window.klaro && typeof klaro.show === "function" && typeof klaro.getManager === "function") {
483
+ try {
484
+ klaro.getManager().changeAll(false);
485
+ klaro.getManager().saveAndApplyConsents();
486
+ return true;
487
+ } catch (e) {
488
+ console.warn(e);
489
+ return false;
490
+ }
491
+ }
492
+ return false;
493
+ },
478
494
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
479
495
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
480
496
  // declarative rules
@@ -544,7 +560,6 @@
544
560
  EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
545
561
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
546
562
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
547
- EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
548
563
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
549
564
  document.documentElement.classList.forEach((cls) => {
550
565
  if (cls.startsWith("sd-cmp-"))
@@ -1499,14 +1514,14 @@
1499
1514
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1500
1515
  }
1501
1516
  async optOut() {
1502
- if (this.click(".klaro .cn-decline")) {
1517
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1518
+ if (apiOptOutSuccess) {
1503
1519
  return true;
1504
1520
  }
1505
- if (!this.settingsOpen) {
1506
- this.click(".klaro .cn-learn-more,.klaro .cm-button-manage");
1507
- await this.waitForElement(".klaro > .cookie-modal", 2e3);
1508
- this.settingsOpen = true;
1521
+ if (this.click(".klaro .cn-decline")) {
1522
+ return true;
1509
1523
  }
1524
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1510
1525
  if (this.click(".klaro .cn-decline")) {
1511
1526
  return true;
1512
1527
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2024.4.2",
4
+ "version": "2024.4.12",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -2391,7 +2391,10 @@
2391
2391
  "all": true
2392
2392
  },
2393
2393
  {
2394
- "waitForThenClick": "[data-project=\"mol-fe-cmp\"] button[class*=white]"
2394
+ "waitForThenClick": [
2395
+ "[data-project=\"mol-fe-cmp\"] [class*=footer]",
2396
+ "xpath///button[contains(., 'Save & Exit')]"
2397
+ ]
2395
2398
  }
2396
2399
  ]
2397
2400
  },
@@ -5265,48 +5268,17 @@
5265
5268
  ],
5266
5269
  "detectPopup": [
5267
5270
  {
5268
- "visible": "sibbo-cmp-layout"
5271
+ "visible": "#rejectAllMain"
5269
5272
  }
5270
5273
  ],
5271
5274
  "optIn": [
5272
5275
  {
5273
- "click": "sibbo-cmp-layout [data-accept-all]"
5276
+ "click": "#acceptAllMain"
5274
5277
  }
5275
5278
  ],
5276
5279
  "optOut": [
5277
5280
  {
5278
- "click": ".sibbo-panel__aside__buttons a[data-nav=\"purposes\"]"
5279
- },
5280
- {
5281
- "click": ".sibbo-panel__main__header__actions a[data-focusable=\"reject-all\"]"
5282
- },
5283
- {
5284
- "if": {
5285
- "exists": "[data-view=purposes] .sibbo-panel__main__footer__actions [data-save-and-exit]"
5286
- },
5287
- "then": [],
5288
- "else": [
5289
- {
5290
- "waitFor": ".sibbo-panel__main__footer__actions a[data-focusable=\"next\"]:not(.sibbo-cmp-button--disabled)"
5291
- },
5292
- {
5293
- "click": ".sibbo-panel__main__footer__actions a[data-focusable=\"next\"]"
5294
- },
5295
- {
5296
- "click": ".sibbo-panel__main div[data-view=\"purposesLegInt\"] a[data-focusable=\"reject-all\"]"
5297
- }
5298
- ]
5299
- },
5300
- {
5301
- "waitFor": ".sibbo-panel__main__footer__actions [data-save-and-exit]:not(.sibbo-cmp-button--disabled)"
5302
- },
5303
- {
5304
- "click": ".sibbo-panel__main__footer__actions [data-save-and-exit]:not(.sibbo-cmp-button--disabled)"
5305
- }
5306
- ],
5307
- "test": [
5308
- {
5309
- "eval": "EVAL_SIBBO_0"
5281
+ "click": "#rejectAllMain"
5310
5282
  }
5311
5283
  ]
5312
5284
  },
@@ -28,6 +28,22 @@
28
28
  return Object.keys(consents).filter((k) => optionalServices.includes(k)).every((k) => consents[k] === false);
29
29
  }
30
30
  },
31
+ EVAL_KLARO_OPEN_POPUP: () => {
32
+ klaro.show(void 0, true);
33
+ },
34
+ EVAL_KLARO_TRY_API_OPT_OUT: () => {
35
+ if (window.klaro && typeof klaro.show === "function" && typeof klaro.getManager === "function") {
36
+ try {
37
+ klaro.getManager().changeAll(false);
38
+ klaro.getManager().saveAndApplyConsents();
39
+ return true;
40
+ } catch (e) {
41
+ console.warn(e);
42
+ return false;
43
+ }
44
+ }
45
+ return false;
46
+ },
31
47
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
32
48
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
33
49
  // declarative rules
@@ -97,7 +113,6 @@
97
113
  EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
98
114
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
99
115
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
100
- EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
101
116
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
102
117
  document.documentElement.classList.forEach((cls) => {
103
118
  if (cls.startsWith("sd-cmp-"))
@@ -475,6 +475,22 @@
475
475
  return Object.keys(consents).filter((k) => optionalServices.includes(k)).every((k) => consents[k] === false);
476
476
  }
477
477
  },
478
+ EVAL_KLARO_OPEN_POPUP: () => {
479
+ klaro.show(void 0, true);
480
+ },
481
+ EVAL_KLARO_TRY_API_OPT_OUT: () => {
482
+ if (window.klaro && typeof klaro.show === "function" && typeof klaro.getManager === "function") {
483
+ try {
484
+ klaro.getManager().changeAll(false);
485
+ klaro.getManager().saveAndApplyConsents();
486
+ return true;
487
+ } catch (e) {
488
+ console.warn(e);
489
+ return false;
490
+ }
491
+ }
492
+ return false;
493
+ },
478
494
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
479
495
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
480
496
  // declarative rules
@@ -544,7 +560,6 @@
544
560
  EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
545
561
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
546
562
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
547
- EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
548
563
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
549
564
  document.documentElement.classList.forEach((cls) => {
550
565
  if (cls.startsWith("sd-cmp-"))
@@ -1499,14 +1514,14 @@
1499
1514
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1500
1515
  }
1501
1516
  async optOut() {
1502
- if (this.click(".klaro .cn-decline")) {
1517
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1518
+ if (apiOptOutSuccess) {
1503
1519
  return true;
1504
1520
  }
1505
- if (!this.settingsOpen) {
1506
- this.click(".klaro .cn-learn-more,.klaro .cm-button-manage");
1507
- await this.waitForElement(".klaro > .cookie-modal", 2e3);
1508
- this.settingsOpen = true;
1521
+ if (this.click(".klaro .cn-decline")) {
1522
+ return true;
1509
1523
  }
1524
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1510
1525
  if (this.click(".klaro .cn-decline")) {
1511
1526
  return true;
1512
1527
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2024.4.2",
4
+ "version": "2024.4.12",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },
@@ -2391,7 +2391,10 @@
2391
2391
  "all": true
2392
2392
  },
2393
2393
  {
2394
- "waitForThenClick": "[data-project=\"mol-fe-cmp\"] button[class*=white]"
2394
+ "waitForThenClick": [
2395
+ "[data-project=\"mol-fe-cmp\"] [class*=footer]",
2396
+ "xpath///button[contains(., 'Save & Exit')]"
2397
+ ]
2395
2398
  }
2396
2399
  ]
2397
2400
  },
@@ -5265,48 +5268,17 @@
5265
5268
  ],
5266
5269
  "detectPopup": [
5267
5270
  {
5268
- "visible": "sibbo-cmp-layout"
5271
+ "visible": "#rejectAllMain"
5269
5272
  }
5270
5273
  ],
5271
5274
  "optIn": [
5272
5275
  {
5273
- "click": "sibbo-cmp-layout [data-accept-all]"
5276
+ "click": "#acceptAllMain"
5274
5277
  }
5275
5278
  ],
5276
5279
  "optOut": [
5277
5280
  {
5278
- "click": ".sibbo-panel__aside__buttons a[data-nav=\"purposes\"]"
5279
- },
5280
- {
5281
- "click": ".sibbo-panel__main__header__actions a[data-focusable=\"reject-all\"]"
5282
- },
5283
- {
5284
- "if": {
5285
- "exists": "[data-view=purposes] .sibbo-panel__main__footer__actions [data-save-and-exit]"
5286
- },
5287
- "then": [],
5288
- "else": [
5289
- {
5290
- "waitFor": ".sibbo-panel__main__footer__actions a[data-focusable=\"next\"]:not(.sibbo-cmp-button--disabled)"
5291
- },
5292
- {
5293
- "click": ".sibbo-panel__main__footer__actions a[data-focusable=\"next\"]"
5294
- },
5295
- {
5296
- "click": ".sibbo-panel__main div[data-view=\"purposesLegInt\"] a[data-focusable=\"reject-all\"]"
5297
- }
5298
- ]
5299
- },
5300
- {
5301
- "waitFor": ".sibbo-panel__main__footer__actions [data-save-and-exit]:not(.sibbo-cmp-button--disabled)"
5302
- },
5303
- {
5304
- "click": ".sibbo-panel__main__footer__actions [data-save-and-exit]:not(.sibbo-cmp-button--disabled)"
5305
- }
5306
- ],
5307
- "test": [
5308
- {
5309
- "eval": "EVAL_SIBBO_0"
5281
+ "click": "#rejectAllMain"
5310
5282
  }
5311
5283
  ]
5312
5284
  },
@@ -498,6 +498,22 @@ var snippets = {
498
498
  return Object.keys(consents).filter((k) => optionalServices.includes(k)).every((k) => consents[k] === false);
499
499
  }
500
500
  },
501
+ EVAL_KLARO_OPEN_POPUP: () => {
502
+ klaro.show(void 0, true);
503
+ },
504
+ EVAL_KLARO_TRY_API_OPT_OUT: () => {
505
+ if (window.klaro && typeof klaro.show === "function" && typeof klaro.getManager === "function") {
506
+ try {
507
+ klaro.getManager().changeAll(false);
508
+ klaro.getManager().saveAndApplyConsents();
509
+ return true;
510
+ } catch (e) {
511
+ console.warn(e);
512
+ return false;
513
+ }
514
+ }
515
+ return false;
516
+ },
501
517
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
502
518
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
503
519
  // declarative rules
@@ -567,7 +583,6 @@ var snippets = {
567
583
  EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
568
584
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
569
585
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
570
- EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
571
586
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
572
587
  document.documentElement.classList.forEach((cls) => {
573
588
  if (cls.startsWith("sd-cmp-"))
@@ -1522,14 +1537,14 @@ var Klaro = class extends AutoConsentCMPBase {
1522
1537
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1523
1538
  }
1524
1539
  async optOut() {
1525
- if (this.click(".klaro .cn-decline")) {
1540
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1541
+ if (apiOptOutSuccess) {
1526
1542
  return true;
1527
1543
  }
1528
- if (!this.settingsOpen) {
1529
- this.click(".klaro .cn-learn-more,.klaro .cm-button-manage");
1530
- await this.waitForElement(".klaro > .cookie-modal", 2e3);
1531
- this.settingsOpen = true;
1544
+ if (this.click(".klaro .cn-decline")) {
1545
+ return true;
1532
1546
  }
1547
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1533
1548
  if (this.click(".klaro .cn-decline")) {
1534
1549
  return true;
1535
1550
  }
@@ -473,6 +473,22 @@ var snippets = {
473
473
  return Object.keys(consents).filter((k) => optionalServices.includes(k)).every((k) => consents[k] === false);
474
474
  }
475
475
  },
476
+ EVAL_KLARO_OPEN_POPUP: () => {
477
+ klaro.show(void 0, true);
478
+ },
479
+ EVAL_KLARO_TRY_API_OPT_OUT: () => {
480
+ if (window.klaro && typeof klaro.show === "function" && typeof klaro.getManager === "function") {
481
+ try {
482
+ klaro.getManager().changeAll(false);
483
+ klaro.getManager().saveAndApplyConsents();
484
+ return true;
485
+ } catch (e) {
486
+ console.warn(e);
487
+ return false;
488
+ }
489
+ }
490
+ return false;
491
+ },
476
492
  EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
477
493
  EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
478
494
  // declarative rules
@@ -542,7 +558,6 @@ var snippets = {
542
558
  EVAL_PRIMEBOX_0: () => !document.cookie.includes("cb-enabled=accepted"),
543
559
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
544
560
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
545
- EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
546
561
  EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
547
562
  document.documentElement.classList.forEach((cls) => {
548
563
  if (cls.startsWith("sd-cmp-"))
@@ -1497,14 +1512,14 @@ var Klaro = class extends AutoConsentCMPBase {
1497
1512
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1498
1513
  }
1499
1514
  async optOut() {
1500
- if (this.click(".klaro .cn-decline")) {
1515
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1516
+ if (apiOptOutSuccess) {
1501
1517
  return true;
1502
1518
  }
1503
- if (!this.settingsOpen) {
1504
- this.click(".klaro .cn-learn-more,.klaro .cm-button-manage");
1505
- await this.waitForElement(".klaro > .cookie-modal", 2e3);
1506
- this.settingsOpen = true;
1519
+ if (this.click(".klaro .cn-decline")) {
1520
+ return true;
1507
1521
  }
1522
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1508
1523
  if (this.click(".klaro .cn-decline")) {
1509
1524
  return true;
1510
1525
  }