@duckduckgo/autoconsent 10.5.0 → 10.6.1

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.
@@ -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
@@ -111,7 +127,7 @@
111
127
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
112
128
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
113
129
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
114
- EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
130
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)?.[0].includes("false"),
115
131
  EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
116
132
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
117
133
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
@@ -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
@@ -558,7 +574,7 @@
558
574
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
559
575
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
560
576
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
561
- EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
577
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)?.[0].includes("false"),
562
578
  EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
563
579
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
564
580
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
@@ -1499,14 +1515,14 @@
1499
1515
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1500
1516
  }
1501
1517
  async optOut() {
1502
- if (this.click(".klaro .cn-decline")) {
1518
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1519
+ if (apiOptOutSuccess) {
1503
1520
  return true;
1504
1521
  }
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;
1522
+ if (this.click(".klaro .cn-decline")) {
1523
+ return true;
1509
1524
  }
1525
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1510
1526
  if (this.click(".klaro .cn-decline")) {
1511
1527
  return true;
1512
1528
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2024.3.26",
4
+ "version": "2024.4.12",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -5549,7 +5549,7 @@
5549
5549
  ],
5550
5550
  "detectPopup": [
5551
5551
  {
5552
- "visible": "#tarteaucitronRoot #tarteaucitronAlertSmall,#tarteaucitronRoot #tarteaucitronAlertBig",
5552
+ "visible": "#tarteaucitronRoot #tarteaucitronAlertBig",
5553
5553
  "check": "any"
5554
5554
  }
5555
5555
  ],
@@ -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
@@ -111,7 +127,7 @@
111
127
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
112
128
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
113
129
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
114
- EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
130
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)?.[0].includes("false"),
115
131
  EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
116
132
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
117
133
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
@@ -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
@@ -558,7 +574,7 @@
558
574
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
559
575
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
560
576
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
561
- EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
577
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)?.[0].includes("false"),
562
578
  EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
563
579
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
564
580
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
@@ -1499,14 +1515,14 @@
1499
1515
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1500
1516
  }
1501
1517
  async optOut() {
1502
- if (this.click(".klaro .cn-decline")) {
1518
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1519
+ if (apiOptOutSuccess) {
1503
1520
  return true;
1504
1521
  }
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;
1522
+ if (this.click(".klaro .cn-decline")) {
1523
+ return true;
1509
1524
  }
1525
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1510
1526
  if (this.click(".klaro .cn-decline")) {
1511
1527
  return true;
1512
1528
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2024.3.26",
4
+ "version": "2024.4.12",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },
@@ -5549,7 +5549,7 @@
5549
5549
  ],
5550
5550
  "detectPopup": [
5551
5551
  {
5552
- "visible": "#tarteaucitronRoot #tarteaucitronAlertSmall,#tarteaucitronRoot #tarteaucitronAlertBig",
5552
+ "visible": "#tarteaucitronRoot #tarteaucitronAlertBig",
5553
5553
  "check": "any"
5554
5554
  }
5555
5555
  ],
@@ -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
@@ -581,7 +597,7 @@ var snippets = {
581
597
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
582
598
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
583
599
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
584
- EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
600
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)?.[0].includes("false"),
585
601
  EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
586
602
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
587
603
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
@@ -1522,14 +1538,14 @@ var Klaro = class extends AutoConsentCMPBase {
1522
1538
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1523
1539
  }
1524
1540
  async optOut() {
1525
- if (this.click(".klaro .cn-decline")) {
1541
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1542
+ if (apiOptOutSuccess) {
1526
1543
  return true;
1527
1544
  }
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;
1545
+ if (this.click(".klaro .cn-decline")) {
1546
+ return true;
1532
1547
  }
1548
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1533
1549
  if (this.click(".klaro .cn-decline")) {
1534
1550
  return true;
1535
1551
  }
@@ -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
@@ -556,7 +572,7 @@ var snippets = {
556
572
  EVAL_TAKEALOT_0: () => document.body.classList.remove("freeze") || (document.body.style = "") || true,
557
573
  EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true,
558
574
  EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true,
559
- EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes("false"),
575
+ EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)?.[0].includes("false"),
560
576
  EVAL_TAUNTON_TEST: () => document.cookie.includes("taunton_user_consent_submitted=true"),
561
577
  EVAL_TEALIUM_0: () => typeof window.utag !== "undefined" && typeof utag.gdpr === "object",
562
578
  EVAL_TEALIUM_1: () => utag.gdpr.setConsentValue(false) || true,
@@ -1497,14 +1513,14 @@ var Klaro = class extends AutoConsentCMPBase {
1497
1513
  return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
1498
1514
  }
1499
1515
  async optOut() {
1500
- if (this.click(".klaro .cn-decline")) {
1516
+ const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
1517
+ if (apiOptOutSuccess) {
1501
1518
  return true;
1502
1519
  }
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;
1520
+ if (this.click(".klaro .cn-decline")) {
1521
+ return true;
1507
1522
  }
1523
+ await this.mainWorldEval("EVAL_KLARO_OPEN_POPUP");
1508
1524
  if (this.click(".klaro .cn-decline")) {
1509
1525
  return true;
1510
1526
  }