@duckduckgo/autoconsent 10.6.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.
- package/CHANGELOG.md +12 -0
- package/dist/addon-firefox/background.bundle.js +16 -0
- package/dist/addon-firefox/content.bundle.js +21 -5
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-mv3/background.bundle.js +16 -0
- package/dist/addon-mv3/content.bundle.js +21 -5
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/autoconsent.cjs.js +21 -5
- package/dist/autoconsent.esm.js +21 -5
- package/dist/autoconsent.playwright.js +1 -1
- package/dist/autoconsent.unit.js +21 -5
- package/lib/cmps/klaro.ts +8 -5
- package/lib/eval-snippets.ts +17 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v10.6.1 (Fri Apr 12 2024)
|
|
2
|
+
|
|
3
|
+
#### 🐛 Bug Fix
|
|
4
|
+
|
|
5
|
+
- Fix Klaro rule (wogibtswas.de, www.suedtirol.com) [#404](https://github.com/duckduckgo/autoconsent/pull/404) ([@sammacbeth](https://github.com/sammacbeth))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v10.6.0 (Fri Apr 12 2024)
|
|
2
14
|
|
|
3
15
|
#### 🚀 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
|
|
@@ -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
|
|
@@ -1499,14 +1515,14 @@
|
|
|
1499
1515
|
return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
|
|
1500
1516
|
}
|
|
1501
1517
|
async optOut() {
|
|
1502
|
-
|
|
1518
|
+
const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
|
|
1519
|
+
if (apiOptOutSuccess) {
|
|
1503
1520
|
return true;
|
|
1504
1521
|
}
|
|
1505
|
-
if (
|
|
1506
|
-
|
|
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
|
}
|
|
@@ -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
|
|
@@ -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
|
|
@@ -1499,14 +1515,14 @@
|
|
|
1499
1515
|
return this.elementVisible(".klaro > .cookie-notice,.klaro > .cookie-modal", "any");
|
|
1500
1516
|
}
|
|
1501
1517
|
async optOut() {
|
|
1502
|
-
|
|
1518
|
+
const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
|
|
1519
|
+
if (apiOptOutSuccess) {
|
|
1503
1520
|
return true;
|
|
1504
1521
|
}
|
|
1505
|
-
if (
|
|
1506
|
-
|
|
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
|
}
|
package/dist/autoconsent.cjs.js
CHANGED
|
@@ -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
|
|
@@ -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
|
-
|
|
1541
|
+
const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
|
|
1542
|
+
if (apiOptOutSuccess) {
|
|
1526
1543
|
return true;
|
|
1527
1544
|
}
|
|
1528
|
-
if (
|
|
1529
|
-
|
|
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
|
}
|
package/dist/autoconsent.esm.js
CHANGED
|
@@ -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
|
|
@@ -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
|
-
|
|
1516
|
+
const apiOptOutSuccess = await this.mainWorldEval("EVAL_KLARO_TRY_API_OPT_OUT");
|
|
1517
|
+
if (apiOptOutSuccess) {
|
|
1501
1518
|
return true;
|
|
1502
1519
|
}
|
|
1503
|
-
if (
|
|
1504
|
-
|
|
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
|
}
|