@duckduckgo/autoconsent 16.14.0 → 16.16.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/AGENTS.md CHANGED
@@ -64,7 +64,8 @@ Use `if`/`then`/`else` to handle regional variants within a single rule.
64
64
 
65
65
  ### Generic vs Site-Specific Rules
66
66
 
67
- **Always prefer writing a generic CMP rule over a site-specific rule.** One CMP rule can cover multiple sites. See "Identifying a Consent Management Platform" below for common techniques. If the popup is genuinely custom-built, a site-specific rule is the right call.
67
+ Site-specific rules are rules scoped to specific sites with a `urlPattern`. Rules without a urlPattern are called generic.
68
+ **Always prefer writing a generic CMP rule over a site-specific rule.** One CMP rule can cover multiple sites. See "Identifying a Consent Management Platform" below for common techniques. If the popup is custom-built, but applies to multiple sibling sites, use a generic rule. If the rule is unlikely to be useful for other sites, a site-specific rule is the right call.
68
69
 
69
70
  ### JSON Rules vs Code-based rules
70
71
 
@@ -102,21 +103,33 @@ Single-string selectors cannot pierce — use arrays whenever the target is insi
102
103
  shadow root or same-origin iframe.
103
104
 
104
105
  ### General Guidelines and Gotchas
105
- - **Regional testing is mandatory** for any rule change — CMPs behave differently under GDPR (EU), CCPA (US), and other jurisdictions. Run the rule against different regions using available regional testing tooling before considering the change done.
106
- - When verifying a rule, **look at the screenshots** on top of the API results — sometimes a rule reports success, but the popup is not actually handled - a screenshot will detect this.
107
106
  - **Paywalls do not need to be handled.** If the website presents the choice to pay or agree to cookies, the correct solution is to disable the feature on that site, so no code changes required in this case.
108
- - If the pop-up has an explicit "reject"-like button, you should first consider why HEURISTIC rule didn't handle it. A fix to the heuristic rule is always preferred to a new rule, as long as it doesn't cause potential false-positives on other sites.
109
- - **Watch out for race conditions**. A common pitfall is that a rule starts clicking before JS handlers are ready. If you detect this, add an appropriate wait step before the click, preferably based on a specific DOM state. Unconditional `wait` is a LAST RESORT because it leads to a poor UX.
110
- - **Watch out for false positive detections**. Always verify that the rule does NOT match after the popup is dismissed and the page is reloaded. Over-detection can lead to reload loops.
111
- - **selfTests are optional.** It is okay to NOT have a self-test, or have it failing as long as the popup is handled correctly. Confirm this with screenshots.
112
- - If you cover a new CMP or a new flavor of the existing CMP, ALWAYS try to look for more examples of that case, and add to the spec file.
113
107
  - `detectCmp` and `detectPopup` must be fast. Do NOT use waiting steps — the engine retries automatically.
114
- - Keep regexes in `urlPattern` as simple as possible to avoid unnecessary performance overhead.
108
+ - Keep regexes in `urlPattern` as simple as possible to avoid unnecessary performance overhead. In most cases, a simple "^https?://(\w+\.)?domain\.com/" is sufficient.
115
109
  - **`prehideSelectors` do not affect autoconsent visibility checks.** Prehide selectors are injected early to prevent flicker, and are intentionally implemented using opacity, which hides elements from the user, but not from built-in steps such as `waitForVisible` and `visible`. That said, _prehide selectors should be narrow_: overly broad selectors (e.g. `body`) could hide the entire page.
110
+ - If you cover a new CMP or a new flavor of the existing CMP, ALWAYS try to look for more examples of that case, and add to the spec file.
116
111
  - Prefer DOM-based steps when possible — `eval` steps are a last resort.
117
112
  - Set `minimumRuleStepVersion: 2` if using `removeClass`, `setStyle`, or `addStyle`.
118
113
  - Prefer `cookieContains` in `test` when the CMP stores consent in cookies.
119
114
  - Use `npm run create-rule` to scaffold a new rule and a spec file.
115
+ - Code comments: keep them brief (max one line), explain why not what, no references to specific sites in library code
116
+
117
+ ### Updating existing rules
118
+ - If an existing generic rule fails on a specific site: first look for other sites with the same failure (spec sites, data/coverage.json, publicwww). If the issue applies to more sites, update the generic rule; if the issue is truly site-specific, prefer making a site-specific rule or a config exception. Never change a generic rule to fix a site-specific implementation problem.
119
+ - After updating an existing generic rule, do a heavy testing run: all known sites (specs + data/coverage.json + publicwww) using available regional testing tooling. Inspect both API results and screenshots.
120
+ - if a site-specific rule is obsolete (the site switched CMP in ALL regions), propose removal.
121
+ - if a popup does not provide an opt-out button, `optOut` _may_ click "dismiss"/"acknowledge" instead. Check with the existing heuristic patterns in /lib/heuristic-patterns.ts for reference.
122
+ - do not keep outdated selectors in changed rules, unless they are actually used in some conditions
123
+ - If the pop-up has an explicit "reject"-like button, you should first consider why HEURISTIC rule didn't handle it. A fix to the heuristic rule is always preferred to a new rule, as long as it doesn't cause potential false-positives on other sites.
124
+
125
+ ### Verification guidelines
126
+ - **Regional testing is mandatory** for any rule change — CMPs behave differently under GDPR (EU), CCPA (US), and other jurisdictions. Run the rule against different regions using available regional testing tooling before considering the change done.
127
+ - When verifying a rule, **look at the screenshots** on top of the API results — sometimes a rule reports success, but the popup is not actually handled - a screenshot will detect this.
128
+ - **Watch out for race conditions**. A common pitfall is that a rule starts clicking before JS handlers are ready. If you detect this, add an appropriate wait step before the click, preferably based on a specific DOM state. Unconditional `wait` is a LAST RESORT because it leads to a poor UX.
129
+ - **Watch out for false positive detections**. Always verify that the rule does NOT match after the popup is dismissed and the page is reloaded. Over-detection can lead to reload loops.
130
+ - **selfTests are optional.** It is okay to NOT have a self-test, or have it failing as long as the popup is handled correctly. Confirm this with screenshots.
131
+ - Generic rules without a urlPattern MUST have at least two sites in the spec file.
132
+ - If the popup comes in different DOM structures, cover all of them in the spec file.
120
133
 
121
134
  ### Fixing breakage in cosmetic rules
122
135
  When using `hide`, the CMP may lock scrolling or add overlays. Add fixes AFTER the `hide` step, marked `"optional": true`:
package/CHANGELOG.md CHANGED
@@ -1,3 +1,37 @@
1
+ # v16.16.0 (Sat Jul 25 2026)
2
+
3
+ #### Rules
4
+
5
+ - Fix Pandectes mobile settings timing [#1458](https://github.com/duckduckgo/autoconsent/pull/1458) ([@cursoragent](https://github.com/cursoragent) [@muodov](https://github.com/muodov))
6
+ - Rule update: Admiral [#1456](https://github.com/duckduckgo/autoconsent/pull/1456) ([@cursoragent](https://github.com/cursoragent) [@daxtheduck](https://github.com/daxtheduck))
7
+
8
+ #### Authors: 3
9
+
10
+ - Cursor Agent ([@cursoragent](https://github.com/cursoragent))
11
+ - Dax ([@daxtheduck](https://github.com/daxtheduck))
12
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
13
+
14
+ ---
15
+
16
+ # v16.15.0 (Fri Jul 24 2026)
17
+
18
+ #### Rules
19
+
20
+ - Dismiss Pornhub minimized cookie banner [#1452](https://github.com/duckduckgo/autoconsent/pull/1452) ([@cursoragent](https://github.com/cursoragent) [@muodov](https://github.com/muodov))
21
+ - Rule update: cookieinfo [#1449](https://github.com/duckduckgo/autoconsent/pull/1449) ([@cursoragent](https://github.com/cursoragent) [@daxtheduck](https://github.com/daxtheduck))
22
+
23
+ #### AI / Agent Workflow
24
+
25
+ - Update AI rules [#1447](https://github.com/duckduckgo/autoconsent/pull/1447) ([@muodov](https://github.com/muodov))
26
+
27
+ #### Authors: 3
28
+
29
+ - Cursor Agent ([@cursoragent](https://github.com/cursoragent))
30
+ - Dax ([@daxtheduck](https://github.com/daxtheduck))
31
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
32
+
33
+ ---
34
+
1
35
  # v16.14.0 (Thu Jul 23 2026)
2
36
 
3
37
  #### Rules