@duckduckgo/autoconsent 16.17.0 → 16.18.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 (41) hide show
  1. package/.agents/skills/proxy-testing/SKILL.md +17 -3
  2. package/.agents/skills/proxy-testing/scripts/regional-proxy.mjs +10 -3
  3. package/AGENTS.md +5 -4
  4. package/CHANGELOG.md +20 -0
  5. package/dist/addon-firefox/compact-rules.json +1 -1
  6. package/dist/addon-firefox/content.bundle.js +0 -90
  7. package/dist/addon-firefox/manifest.json +1 -1
  8. package/dist/addon-firefox/rule-index.json +1 -1
  9. package/dist/addon-firefox/rules.json +1 -1
  10. package/dist/addon-mv3/compact-rules.json +1 -1
  11. package/dist/addon-mv3/content.bundle.js +0 -90
  12. package/dist/addon-mv3/manifest.json +1 -1
  13. package/dist/addon-mv3/rule-index.json +1 -1
  14. package/dist/addon-mv3/rules.json +1 -1
  15. package/dist/autoconsent.cjs.js +0 -90
  16. package/dist/autoconsent.esm.js +0 -90
  17. package/dist/autoconsent.playwright.js +0 -90
  18. package/dist/autoconsent.standalone.js +1 -91
  19. package/lib/cmps/all.ts +0 -2
  20. package/package.json +1 -1
  21. package/rules/autoconsent/borlabs.json +48 -17
  22. package/rules/autoconsent/pornhub.json +27 -3
  23. package/rules/autoconsent/samsung-com.json +1 -1
  24. package/rules/compact-rules.json +1 -1
  25. package/rules/rule-index.json +1 -1
  26. package/rules/rules.json +1 -1
  27. package/tests/borlabs.spec.ts +1 -1
  28. package/tests/onetrust.spec.ts +4 -0
  29. package/tests/pornhub.spec.ts +2 -1
  30. package/tests/trustarc-newcm.spec.ts +1 -1
  31. package/tests/trustarc.spec.ts +0 -7
  32. package/tests-wtr/rules/cmp-test-urls.json +0 -1
  33. package/dist/types/cmps/trustarc-frame.d.ts +0 -15
  34. package/lib/cmps/trustarc-frame.ts +0 -126
  35. package/rules/autoconsent/complianz-opt-both.json +0 -12
  36. package/rules/autoconsent/deepl.json +0 -14
  37. package/rules/autoconsent/jdsports.json +0 -41
  38. package/rules/autoconsent/pornhub-compact-cookie-banner.json +0 -28
  39. package/tests/complianz-opt-both.spec.ts +0 -3
  40. package/tests/deepl.spec.ts +0 -5
  41. package/tests/jdsports.spec.ts +0 -3
@@ -1,5 +1,5 @@
1
1
  import generateCMPTests from '../playwright/runner';
2
2
 
3
- generateCMPTests('borlabs', ['https://www.kesselheld.de/'], {
3
+ generateCMPTests('borlabs', ['https://www.kesselheld.de/', 'https://cocoon-hotels.com/de/cocoon-salzburg/'], {
4
4
  skipRegions: ['US'],
5
5
  });
@@ -37,6 +37,10 @@ generateCMPTests('Onetrust', ['https://eu.icebreaker.com/de-de?country=DE'], {
37
37
  skipRegions: ['US'],
38
38
  });
39
39
 
40
+ generateCMPTests('Onetrust', ['https://www.jdsports.co.uk/'], {
41
+ onlyRegions: ['GB'],
42
+ });
43
+
40
44
  // CCPA notice-only banner variant: only a "Close" button, no Accept/Reject/Settings.
41
45
  // Only appears in the US (CCPA). The rule clicks Close to dismiss the banner; opt-in
42
46
  // and self-test don't apply (no real consent state to flip).
@@ -1,5 +1,6 @@
1
1
  import generateCMPTests from '../playwright/runner';
2
2
 
3
3
  generateCMPTests('pornhub.com', ['https://pornhub.com/'], {
4
- expectedRuns: 2,
4
+ expectedRuns: 1,
5
+ testSelfTest: false,
5
6
  });
@@ -1,6 +1,6 @@
1
1
  import generateCMPTests from '../playwright/runner';
2
2
 
3
- generateCMPTests('TrustArc-newcm', ['https://www.gwr.com/'], {
3
+ generateCMPTests('TrustArc-newcm', ['https://www.gwr.com/', 'https://www.usa.philips.com/'], {
4
4
  testOptOut: true,
5
5
  testOptIn: false,
6
6
  testSelfTest: false,
@@ -11,10 +11,3 @@ generateCMPTests('TrustArc-top', ['https://www.garmin.com/de-DE/'], {
11
11
  testSelfTest: false,
12
12
  skipRegions: ['US'],
13
13
  });
14
-
15
- generateCMPTests('TrustArc-frame', ['https://www.wish.com/', 'https://www.usa.philips.com/'], {
16
- testOptOut: true,
17
- testSelfTest: false,
18
- testOptIn: false, // opt-in works, but is triggered by the top frame
19
- skipRegions: ['US'],
20
- });
@@ -2616,7 +2616,6 @@
2616
2616
  ["imdb", "https://m.imdb_com/"],
2617
2617
  ["instagram", "https://www.instagram.com/"],
2618
2618
  ["itopvpn.com", "https://www.itopvpn`com/"],
2619
- ["jdsports", "https://m.jdsports./"],
2620
2619
  ["kleinanzeigen-de", "http://www.kleinanzeigen.de/"],
2621
2620
  ["leafly", "https://www.leafly.com/"],
2622
2621
  ["medium", "https://zlh21abjbixzjjyxtcniej1h2evy9cmwxlnf7s9wcht2aefmv5.medium.com/"],
@@ -1,15 +0,0 @@
1
- import { RunContext } from '../rules';
2
- import AutoConsentCMPBase from './base';
3
- export default class TrustArcFrame extends AutoConsentCMPBase {
4
- name: string;
5
- runContext: RunContext;
6
- get hasSelfTest(): boolean;
7
- get isIntermediate(): boolean;
8
- get isCosmetic(): boolean;
9
- detectCmp(): Promise<boolean>;
10
- detectPopup(): Promise<boolean>;
11
- navigateToSettings(): Promise<boolean>;
12
- optOut(): Promise<boolean>;
13
- optIn(): Promise<boolean>;
14
- test(): Promise<boolean>;
15
- }
@@ -1,126 +0,0 @@
1
- import { RunContext } from '../rules';
2
- import { waitFor } from '../utils';
3
- import AutoConsentCMPBase from './base';
4
-
5
- export default class TrustArcFrame extends AutoConsentCMPBase {
6
- name = 'TrustArc-frame';
7
-
8
- runContext: RunContext = {
9
- main: false,
10
- frame: true,
11
- urlPattern: '^https://consent-pref\\.trustarc\\.com/\\?',
12
- };
13
-
14
- get hasSelfTest(): boolean {
15
- return true;
16
- }
17
-
18
- get isIntermediate(): boolean {
19
- return false;
20
- }
21
-
22
- get isCosmetic(): boolean {
23
- return false;
24
- }
25
-
26
- async detectCmp() {
27
- return true;
28
- }
29
-
30
- async detectPopup() {
31
- // we're already inside the popup
32
- return this.elementVisible('#defaultpreferencemanager', 'any') && this.elementVisible('.mainContent', 'any');
33
- }
34
-
35
- async navigateToSettings() {
36
- // wait for it to load
37
- await waitFor(
38
- async () => {
39
- return (
40
- this.elementExists('.shp') || this.elementVisible('.advance', 'any') || this.elementExists('.switch span:first-child')
41
- );
42
- },
43
- 10,
44
- 500,
45
- );
46
- // splash screen -> hit more information
47
- if (this.elementExists('.shp')) {
48
- await this.click('.shp');
49
- }
50
-
51
- await this.waitForElement('.prefPanel', 5000);
52
-
53
- // go to advanced settings if not yet shown
54
- if (this.elementVisible('.advance', 'any')) {
55
- await this.click('.advance');
56
- }
57
-
58
- // takes a while to load the opt-in/opt-out buttons
59
- return await waitFor(() => this.elementVisible('.switch span:first-child', 'any'), 5, 1000);
60
- }
61
-
62
- async optOut() {
63
- // When Tags are being controlled through a tag managment system, the window will not call the vendors' opt-out
64
- let timeout = 3000;
65
- if (await this.mainWorldEval('EVAL_TRUSTARC_FRAME_GTM')) {
66
- timeout = 1500;
67
- }
68
-
69
- await waitFor(() => document.readyState === 'complete', 20, 100);
70
- await this.waitForElement('.mainContent[aria-hidden=false]', timeout);
71
-
72
- if (await this.click('.rejectAll,.declineAllButtonLower', true)) {
73
- return true;
74
- }
75
-
76
- if (this.elementExists('.prefPanel')) {
77
- await this.waitForElement('.prefPanel[style="visibility: visible;"]', timeout);
78
- }
79
-
80
- if (await this.click('#catDetails0')) {
81
- await this.click('.submit');
82
- this.waitForThenClick('#gwt-debug-close_id', timeout);
83
- return true;
84
- }
85
-
86
- if (await this.click('.required')) {
87
- this.waitForThenClick('#gwt-debug-close_id', timeout);
88
- return true;
89
- }
90
-
91
- await this.navigateToSettings();
92
-
93
- await this.click('.switch span:nth-child(1):not(.active)', true);
94
-
95
- await this.click('.submit');
96
-
97
- // 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', timeout * 10);
99
-
100
- return true;
101
- }
102
-
103
- async optIn() {
104
- if (await this.click('.call')) {
105
- return true;
106
- }
107
- await this.navigateToSettings();
108
- await this.click('.switch span:nth-child(2)', true);
109
-
110
- await this.click('.submit');
111
-
112
- // at this point, iframe usually closes. Sometimes we need to close manually, but we don't wait for it to report success
113
- this.waitForElement('#gwt-debug-close_id', 300000).then(() => {
114
- this.click('#gwt-debug-close_id');
115
- });
116
-
117
- return true;
118
- }
119
-
120
- async test() {
121
- // Test JS variable to check the user's preference
122
- // preferences = undefined means no consent is set, preferences = '0' means consent is set to required only
123
- await this.wait(500);
124
- return await this.mainWorldEval('EVAL_TRUSTARC_FRAME_TEST');
125
- }
126
- }
@@ -1,12 +0,0 @@
1
- {
2
- "name": "Complianz opt-both",
3
- "prehideSelectors": ["[aria-describedby=\"cookieconsent:desc\"] .cc-type-opt-both"],
4
- "detectCmp": [{ "exists": "[aria-describedby=\"cookieconsent:desc\"] .cc-type-opt-both" }],
5
- "detectPopup": [{ "visible": "[aria-describedby=\"cookieconsent:desc\"] .cc-type-opt-both" }],
6
- "optIn": [
7
- { "click": ".cc-accept-all", "optional": true },
8
- { "click": ".cc-allow", "optional": true },
9
- { "click": ".cc-dismiss", "optional": true }
10
- ],
11
- "optOut": [{ "waitForThenClick": ".cc-deny" }]
12
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "deepl.com",
3
- "prehideSelectors": ["*[data-testid='dl-cookieBanner']"],
4
- "detectCmp": [{ "exists": "[data-testid='dl-cookieBanner']" }],
5
- "detectPopup": [{ "visible": "[data-testid='dl-cookieBanner']" }],
6
- "optOut": [
7
- {
8
- "if": { "exists": "button[data-testid='cookie-banner-strict-accept-selected']" },
9
- "then": [{ "click": "button[data-testid='cookie-banner-strict-accept-selected']" }],
10
- "else": [{ "hide": "[data-testid='dl-cookieBanner']" }]
11
- }
12
- ],
13
- "optIn": [{ "click": "button[data-testid='cookie-banner-strict-accept-all'],button[data-testid='cookie-banner-lax-close-button']" }]
14
- }
@@ -1,41 +0,0 @@
1
- {
2
- "name": "jdsports",
3
- "vendorUrl": "https://www.jdsports.co.uk/",
4
- "runContext": {
5
- "urlPattern": "^https://(www|m)\\.jdsports\\."
6
- },
7
- "prehideSelectors": [".miniConsent,#PrivacyPolicyBanner"],
8
- "detectCmp": [
9
- {
10
- "exists": ".miniConsent,#PrivacyPolicyBanner"
11
- }
12
- ],
13
- "detectPopup": [
14
- {
15
- "visible": ".miniConsent,#PrivacyPolicyBanner"
16
- }
17
- ],
18
- "optIn": [
19
- {
20
- "waitForThenClick": ".miniConsent .accept-all-cookies"
21
- }
22
- ],
23
- "optOut": [
24
- {
25
- "if": { "exists": "#PrivacyPolicyBanner" },
26
- "then": [
27
- {
28
- "hide": "#PrivacyPolicyBanner"
29
- }
30
- ],
31
- "else": [
32
- {
33
- "waitForThenClick": "#cookie-settings"
34
- },
35
- {
36
- "waitForThenClick": "#reject-all-cookies"
37
- }
38
- ]
39
- }
40
- ]
41
- }
@@ -1,28 +0,0 @@
1
- {
2
- "name": "pornhub-compact-cookie-banner",
3
- "runContext": {
4
- "urlPattern": "^https://(www\\.)?pornhub\\.com/"
5
- },
6
- "cosmetic": false,
7
- "prehideSelectors": ["#cookieBanner.cbShort"],
8
- "detectCmp": [
9
- {
10
- "exists": "#cookieBanner.cbShort .cbCloseButton"
11
- }
12
- ],
13
- "detectPopup": [
14
- {
15
- "visible": "#cookieBanner.cbShort .cbCloseButton"
16
- }
17
- ],
18
- "optIn": [
19
- {
20
- "click": "#cookieBanner.cbShort .cbCloseButton"
21
- }
22
- ],
23
- "optOut": [
24
- {
25
- "click": "#cookieBanner.cbShort .cbCloseButton"
26
- }
27
- ]
28
- }
@@ -1,3 +0,0 @@
1
- import generateCMPTests from '../playwright/runner';
2
-
3
- generateCMPTests('Complianz optin', ['https://www.briogeohair.com/'], {});
@@ -1,5 +0,0 @@
1
- import generateCMPTests from '../playwright/runner';
2
-
3
- generateCMPTests('deepl.com', ['https://deepl.com'], {
4
- skipRegions: ['US'],
5
- });
@@ -1,3 +0,0 @@
1
- import generateCMPTests from '../playwright/runner';
2
-
3
- generateCMPTests('jdsports', ['https://www.jdsports.co.uk/']);