@duckduckgo/autoconsent 14.74.0 → 14.76.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 +40 -0
- package/dist/addon-firefox/background.bundle.js +5 -3
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +25 -12
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +5 -3
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +25 -12
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +25 -12
- package/dist/autoconsent.esm.js +25 -12
- package/dist/autoconsent.extra.cjs.js +317 -230
- package/dist/autoconsent.extra.esm.js +317 -230
- package/dist/autoconsent.playwright.js +25 -12
- package/lib/cmps/onetrust.ts +25 -4
- package/lib/cmps/trustarc-frame.ts +1 -6
- package/lib/eval-snippets.ts +8 -3
- package/lib/filterlist-engine.ts +2 -2
- package/lib/heuristic-patterns.ts +2 -2
- package/package.json +1 -1
- package/rules/autoconsent/cookieconsent2.json +2 -2
- package/rules/autoconsent/cookieconsent3.json +14 -1
- package/rules/autoconsent/didomi.json +2 -2
- package/rules/compact-rules.json +1 -1
- package/rules/filterlist.txt +198 -180
- package/rules/rules.json +1 -1
- package/tests/cookieconsent3.spec.ts +1 -1
- package/tests/didomi.spec.ts +11 -0
- package/tests/onetrust.spec.ts +21 -0
- package/tests/trustarc.spec.ts +1 -1
- package/tests-wtr/heuristics/heuristics-utils.test.ts +9 -0
- package/tests-wtr/lifecycle/find-cmp.html +1 -0
- package/tests-wtr/lifecycle/find-cmp.ts +7 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import generateCMPTests from '../playwright/runner';
|
|
2
2
|
|
|
3
|
-
generateCMPTests('cookieconsent3', ['https://playground.cookieconsent.orestbida.com/']);
|
|
3
|
+
generateCMPTests('cookieconsent3', ['https://playground.cookieconsent.orestbida.com/', 'https://www.testsieger.de/after-shaves/']);
|
package/tests/didomi.spec.ts
CHANGED
|
@@ -12,7 +12,18 @@ generateCMPTests(
|
|
|
12
12
|
],
|
|
13
13
|
{
|
|
14
14
|
testOptIn: true,
|
|
15
|
+
// Self-test is disabled because some sites (e.g. planet.fr) navigate away
|
|
16
|
+
// after clicking the disagree button, which destroys the Didomi state.
|
|
15
17
|
testSelfTest: false,
|
|
16
18
|
skipRegions: ['US'],
|
|
17
19
|
},
|
|
18
20
|
);
|
|
21
|
+
|
|
22
|
+
// US-specific Didomi sites where the CMP runs in CCPA/CPRA mode.
|
|
23
|
+
// In CCPA mode there is no explicit reject button, so the rule relies on the
|
|
24
|
+
// Didomi JS API (EVAL_DIDOMI_OPT_OUT) instead of clicking a DOM element.
|
|
25
|
+
generateCMPTests('didomi', ['https://newrepublic.com/article/162247/andreas-malm-blow-up-pipeline-climate-direct-action'], {
|
|
26
|
+
testOptIn: false,
|
|
27
|
+
testSelfTest: true,
|
|
28
|
+
onlyRegions: ['US'],
|
|
29
|
+
});
|
package/tests/onetrust.spec.ts
CHANGED
|
@@ -6,6 +6,8 @@ generateCMPTests('Onetrust', [
|
|
|
6
6
|
'https://www.okcupid.com/',
|
|
7
7
|
'https://doodle.com/',
|
|
8
8
|
'https://www.coca-cola.com/us/en',
|
|
9
|
+
'https://www.seur.com/es/index.html',
|
|
10
|
+
'https://satsuite.collegeboard.org/sat/dates-deadlines',
|
|
9
11
|
]);
|
|
10
12
|
|
|
11
13
|
generateCMPTests('Onetrust', ['https://mailchimp.com/', 'https://www.accenture.com/', 'https://www.zoom.us'], {
|
|
@@ -34,3 +36,22 @@ generateCMPTests('Onetrust', ['https://www.newyorker.com/', 'https://www.adobe.c
|
|
|
34
36
|
generateCMPTests('Onetrust', ['https://eu.icebreaker.com/de-de?country=DE'], {
|
|
35
37
|
skipRegions: ['US'],
|
|
36
38
|
});
|
|
39
|
+
|
|
40
|
+
// CCPA notice-only banner variant: only a "Close" button, no Accept/Reject/Settings.
|
|
41
|
+
// Only appears in the US (CCPA). The rule clicks Close to dismiss the banner; opt-in
|
|
42
|
+
// and self-test don't apply (no real consent state to flip).
|
|
43
|
+
// See lib/cmps/onetrust.ts for the variant detection.
|
|
44
|
+
generateCMPTests(
|
|
45
|
+
'Onetrust',
|
|
46
|
+
[
|
|
47
|
+
'https://www.columbia.com/c/mens-insulated-puffer-jackets/',
|
|
48
|
+
'https://www.mountainhardwear.com/',
|
|
49
|
+
'https://www.prana.com/',
|
|
50
|
+
'https://www.sorel.com/',
|
|
51
|
+
],
|
|
52
|
+
{
|
|
53
|
+
onlyRegions: ['US'],
|
|
54
|
+
testOptIn: false,
|
|
55
|
+
testSelfTest: false,
|
|
56
|
+
},
|
|
57
|
+
);
|
package/tests/trustarc.spec.ts
CHANGED
|
@@ -12,7 +12,7 @@ generateCMPTests('TrustArc-top', ['https://www.garmin.com/de-DE/'], {
|
|
|
12
12
|
skipRegions: ['US'],
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
generateCMPTests('TrustArc-frame', ['https://www.wish.com/'], {
|
|
15
|
+
generateCMPTests('TrustArc-frame', ['https://www.wish.com/', 'https://www.usa.philips.com/'], {
|
|
16
16
|
testOptOut: true,
|
|
17
17
|
testSelfTest: false,
|
|
18
18
|
testOptIn: false, // opt-in works, but is triggered by the top frame
|
|
@@ -75,6 +75,15 @@ describe('isRejectButton', () => {
|
|
|
75
75
|
expect(isRejectButton('let us Reject All cookies', [/reject all/gi], [/let us/gi])).to.be.false;
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
+
it('matches "except strictly necessary" qualifier', () => {
|
|
79
|
+
// OneTrust on apnews.com labels the reject button "I Reject All (except Strictly Necessary)"
|
|
80
|
+
expect(isRejectButton('I Reject All (except Strictly Necessary)')).to.be.true;
|
|
81
|
+
expect(isRejectButton('Reject All (except Strictly Necessary)')).to.be.true;
|
|
82
|
+
expect(isRejectButton('Reject All (except Necessary)')).to.be.true;
|
|
83
|
+
expect(isRejectButton('Deny All (except Strictly Essential)')).to.be.true;
|
|
84
|
+
expect(isRejectButton('I Reject All except necessary')).to.be.true;
|
|
85
|
+
});
|
|
86
|
+
|
|
78
87
|
it('returns false for empty string', () => {
|
|
79
88
|
expect(isRejectButton('')).to.be.false;
|
|
80
89
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { expect } from '@esm-bundle/chai';
|
|
2
2
|
import Autoconsent from '../../lib/web';
|
|
3
|
+
import Onetrust from '../../lib/cmps/onetrust';
|
|
3
4
|
|
|
4
5
|
describe('Autoconsent.findCmp', () => {
|
|
5
6
|
let autoconsent: Autoconsent;
|
|
@@ -64,6 +65,12 @@ describe('Autoconsent.findCmp', () => {
|
|
|
64
65
|
expect(found).to.have.length(0);
|
|
65
66
|
});
|
|
66
67
|
|
|
68
|
+
it('does not match Onetrust for a hidden preference center without a banner', async () => {
|
|
69
|
+
autoconsent.rules.push(new Onetrust(autoconsent));
|
|
70
|
+
const found = await autoconsent.findCmp(0);
|
|
71
|
+
expect(found).to.have.length(0);
|
|
72
|
+
});
|
|
73
|
+
|
|
67
74
|
it('does not return a rule if the runContext does not match: frame-only rule', async () => {
|
|
68
75
|
autoconsent.addDeclarativeCMP({
|
|
69
76
|
name: 'runContextRule',
|