@duckduckgo/autoconsent 17.4.0 → 18.1.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 (102) hide show
  1. package/.github/workflows/ddg-release.yml +6 -3
  2. package/.prettierignore +1 -0
  3. package/AGENTS.md +2 -0
  4. package/CHANGELOG.md +57 -0
  5. package/dist/addon-firefox/background.bundle.js +4 -1
  6. package/dist/addon-firefox/compact-rules.json +1 -1
  7. package/dist/addon-firefox/content.bundle.js +608 -61
  8. package/dist/addon-firefox/manifest.json +1 -1
  9. package/dist/addon-firefox/rule-index.json +1 -1
  10. package/dist/addon-firefox/rules.json +1 -1
  11. package/dist/addon-mv3/background.bundle.js +4 -1
  12. package/dist/addon-mv3/compact-rules.json +1 -1
  13. package/dist/addon-mv3/content.bundle.js +608 -61
  14. package/dist/addon-mv3/manifest.json +1 -1
  15. package/dist/addon-mv3/rule-index.json +1 -1
  16. package/dist/addon-mv3/rules.json +1 -1
  17. package/dist/autoconsent.cjs.js +614 -67
  18. package/dist/autoconsent.esm.js +614 -67
  19. package/dist/autoconsent.playwright.js +608 -61
  20. package/dist/autoconsent.standalone.js +615 -68
  21. package/dist/heuristics.cjs.js +621 -52
  22. package/dist/heuristics.mjs +609 -50
  23. package/dist/types/cmps/tiktok.d.ts +0 -2
  24. package/dist/types/eval-snippets.d.ts +2 -0
  25. package/dist/types/heuristic-classify.d.ts +2 -6
  26. package/dist/types/heuristic-detect.d.ts +32 -0
  27. package/dist/types/heuristic-literals.d.ts +1 -0
  28. package/dist/types/heuristic-negatives.d.ts +25 -0
  29. package/dist/types/heuristic-patterns.d.ts +18 -2
  30. package/dist/types/heuristic-prefilter.d.ts +13 -0
  31. package/docs/heuristic-detection.md +78 -0
  32. package/docs/heuristic-prefilter.md +62 -0
  33. package/eslint.config.mjs +16 -1
  34. package/lib/cmps/evidon.ts +5 -4
  35. package/lib/cmps/tiktok.ts +0 -5
  36. package/lib/eval-snippets.ts +3 -0
  37. package/lib/heuristic-classify.ts +4 -39
  38. package/lib/heuristic-detect.ts +209 -0
  39. package/lib/heuristic-literals.ts +207 -0
  40. package/lib/heuristic-negatives.ts +173 -0
  41. package/lib/heuristic-patterns.ts +104 -31
  42. package/lib/heuristic-prefilter.ts +40 -0
  43. package/lib/heuristics.ts +8 -4
  44. package/lib/web.ts +1 -1
  45. package/package.json +2 -1
  46. package/rules/autoconsent/binogi.json +32 -0
  47. package/rules/autoconsent/bokio.json +32 -0
  48. package/rules/autoconsent/botble-cookie-consent.json +16 -0
  49. package/rules/autoconsent/calcolo-tools.json +23 -0
  50. package/rules/autoconsent/consilium-europa-eu.json +35 -0
  51. package/rules/autoconsent/dtu-findit.json +47 -0
  52. package/rules/autoconsent/hikvision.com.json +18 -0
  53. package/rules/autoconsent/hmgroup-turbocookie.json +18 -0
  54. package/rules/autoconsent/hmrc-tracking-consent.json +40 -0
  55. package/rules/autoconsent/hurra-consent.json +16 -0
  56. package/rules/autoconsent/isidewith.com.json +38 -0
  57. package/rules/autoconsent/landgate.json +10 -0
  58. package/rules/autoconsent/meta-cookie-dialog-v2.json +40 -0
  59. package/rules/autoconsent/pakamera.json +19 -0
  60. package/rules/autoconsent/purecookie-cosmetic.json +13 -0
  61. package/rules/autoconsent/random-org.json +41 -0
  62. package/rules/autoconsent/reverb-gdpr-nag.json +18 -0
  63. package/rules/autoconsent/reverb.json +24 -0
  64. package/rules/autoconsent/tallink.json +13 -0
  65. package/rules/autoconsent/tealium.json +4 -1
  66. package/rules/autoconsent/typo3-cookieconsent.json +9 -0
  67. package/rules/autoconsent/vinnies-org-au.json +29 -0
  68. package/rules/autoconsent/zoho.json +23 -0
  69. package/rules/compact-rules.json +1 -1
  70. package/rules/rule-index.json +1 -1
  71. package/rules/rules.json +1 -1
  72. package/scripts/build-heuristic-literals.ts +24 -0
  73. package/scripts/required-literals.ts +177 -0
  74. package/tests/binogi.spec.ts +3 -0
  75. package/tests/bokio.spec.ts +6 -0
  76. package/tests/botble-cookie-consent.spec.ts +11 -0
  77. package/tests/calcolo-tools.spec.ts +3 -0
  78. package/tests/consilium-europa-eu.spec.ts +3 -0
  79. package/tests/dtu-findit.spec.ts +3 -0
  80. package/tests/evidon.spec.ts +2 -1
  81. package/tests/hikvision.com.spec.ts +3 -0
  82. package/tests/hmgroup-turbocookie.spec.ts +7 -0
  83. package/tests/hmrc-tracking-consent.spec.ts +7 -0
  84. package/tests/hurra-consent.spec.ts +8 -0
  85. package/tests/isidewith.com.spec.ts +3 -0
  86. package/tests/landgate.spec.ts +3 -0
  87. package/tests/meta-cookie-dialog-v2.spec.ts +10 -0
  88. package/tests/pakamera.spec.ts +5 -0
  89. package/tests/purecookie-cosmetic.spec.ts +8 -0
  90. package/tests/random-org.spec.ts +3 -0
  91. package/tests/reverb.spec.ts +7 -0
  92. package/tests/tallink.spec.ts +3 -0
  93. package/tests/tiktok.spec.ts +2 -2
  94. package/tests/typo3-cookieconsent.spec.ts +10 -0
  95. package/tests/vinnies-org-au.spec.ts +3 -0
  96. package/tests/zoho.spec.ts +5 -0
  97. package/tests-wtr/heuristics/heuristics-utils.test.ts +222 -8
  98. package/tests-wtr/heuristics/regex-syntax.test.ts +81 -0
  99. package/rules/generated/auto_GB_capcut.com_0.json +0 -28
  100. package/rules/generated/auto_NL_bonprix.nl_ovi.json +0 -40
  101. package/tests/generated/auto_GB_capcut.com_0.spec.ts +0 -2
  102. package/tests/generated/auto_NL_bonprix.nl_ovi.spec.ts +0 -2
@@ -138,7 +138,8 @@ jobs:
138
138
  token: ${{ secrets.DAX_WEB_AUTOFILL_AUTOMATION }}
139
139
  - uses: actions/setup-node@v3
140
140
  with:
141
- node-version: current
141
+ # the Android repo has no .nvmrc, so use our own pinned Node version
142
+ node-version-file: autoconsent/.node-version
142
143
  - name: Update Android autoconsent reference
143
144
  run: |
144
145
  cd android
@@ -200,7 +201,8 @@ jobs:
200
201
  token: ${{ secrets.DAX_WEB_AUTOFILL_AUTOMATION }}
201
202
  - uses: actions/setup-node@v3
202
203
  with:
203
- node-version: current
204
+ # use the app's own Node version, to avoid package.lock inconsistencies
205
+ node-version-file: apple-monorepo/.nvmrc
204
206
  - name: Update autoconsent version
205
207
  run: |
206
208
  cd apple-monorepo/
@@ -274,7 +276,8 @@ jobs:
274
276
  token: ${{ secrets.DAX_WEB_AUTOFILL_AUTOMATION }}
275
277
  - uses: actions/setup-node@v3
276
278
  with:
277
- node-version: current
279
+ # use the app's own Node version, to avoid package.lock inconsistencies
280
+ node-version-file: windows/.nvmrc
278
281
  - name: Update Windows autoconsent reference
279
282
  run: |
280
283
  cd windows/WindowsBrowser/Application/Autoconsent/External
package/.prettierignore CHANGED
@@ -1,4 +1,5 @@
1
1
  lib/consentomatic
2
+ lib/heuristic-literals.ts
2
3
  dist
3
4
  data
4
5
  package.json
package/AGENTS.md CHANGED
@@ -138,6 +138,8 @@ shadow root or same-origin iframe.
138
138
  - After updating an existing generic rule, do a heavy testing run: all known sites (specs + data/coverage.json + publicwww) across the expanded set. Inspect both API results AND screenshots.
139
139
  - **When adding or fixing a rule for a site, remove stale site-specific rules covering the same site.** If a site-specific rule is obsolete in all regions (the site switched CMP), remove it rather than leaving it alongside the new or updated rule.
140
140
  - **Heuristic pattern changes must keep the labelled button benchmark green.** `lib/heuristic-patterns.ts` is the source of truth for heuristic patterns; downstream projects (e.g. tracker-radar-collector) should import them rather than keep copies. `tests-wtr/heuristics/button-classification-accuracy.test.ts` checks `classifyButtonTextRegex` against `data/labelled-button-texts.csv` (no false positives, >90% weighted accuracy per label). Use `npm run benchmark-buttons` to see what a change gains or loses, and the `optimize-button-patterns` skill to tune patterns against it. New labelled rows come from the tracker-radar-collector post-processing scripts (`collect-popup-button-texts.js`, `label-button-texts.js`). Fix a mislabelled row in the CSV rather than bending patterns to fit it.
141
+ - **Heuristic detection is described in [docs/heuristic-detection.md](docs/heuristic-detection.md)**: detect patterns (`lib/heuristic-patterns.ts`), context negatives and popup exclusions (`lib/heuristic-negatives.ts`), and the matching engine (`lib/heuristic-detect.ts`).
142
+ - **After changing `DETECT_PATTERNS`, run `npm run build-heuristic-literals` and commit `lib/heuristic-literals.ts`.** It holds the detection prefilter's literals; a unit test fails while it is stale. See [docs/heuristic-prefilter.md](docs/heuristic-prefilter.md).
141
143
  - 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. Do **not** click a TIER2 (single Accept) button — see General Guidelines.
142
144
  - do not keep outdated selectors in changed rules, unless they are actually used in some conditions
143
145
 
package/CHANGELOG.md CHANGED
@@ -1,3 +1,60 @@
1
+ # v18.1.0 (Sat Nov 07 2026)
2
+
3
+ #### Rules
4
+
5
+ - Rule update: CPM crawl #830: reverb.com [#2483](https://github.com/duckduckgo/autoconsent/pull/2483) ([@daxtheduck](https://github.com/daxtheduck))
6
+ - Rule update: CPM crawl #1383: lenovo.com [#2480](https://github.com/duckduckgo/autoconsent/pull/2480) ([@daxtheduck](https://github.com/daxtheduck))
7
+ - Rule update: CPM crawl #2621: zoho.com [#2479](https://github.com/duckduckgo/autoconsent/pull/2479) ([@daxtheduck](https://github.com/daxtheduck))
8
+ - Rule update: CPM crawl #951: capcut.com [#2478](https://github.com/duckduckgo/autoconsent/pull/2478) ([@daxtheduck](https://github.com/daxtheduck))
9
+ - Rule update: Cookie Popup on www2.hm.com [#2481](https://github.com/duckduckgo/autoconsent/pull/2481) ([@daxtheduck](https://github.com/daxtheduck))
10
+ - Rule update: CPM crawl #1806: meta.com [#2482](https://github.com/duckduckgo/autoconsent/pull/2482) ([@daxtheduck](https://github.com/daxtheduck))
11
+ - Rule update: Cookie popup on tax.service.gov.uk [#2484](https://github.com/duckduckgo/autoconsent/pull/2484) ([@daxtheduck](https://github.com/daxtheduck))
12
+
13
+ #### CI / Release Automation
14
+
15
+ - Pin Node in ddg-release app jobs instead of node-version: current [#2485](https://github.com/duckduckgo/autoconsent/pull/2485) ([@muodov](https://github.com/muodov))
16
+
17
+ #### Authors: 2
18
+
19
+ - Dax ([@daxtheduck](https://github.com/daxtheduck))
20
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
21
+
22
+ ---
23
+
24
+ # v18.0.0 (Thu Nov 05 2026)
25
+
26
+ #### Rules
27
+
28
+ - Rule update: Check whether www.telekom.de still needs its autoconsent exception [#2476](https://github.com/duckduckgo/autoconsent/pull/2476) ([@daxtheduck](https://github.com/daxtheduck))
29
+ - Rule update: CPM crawl #4508: europa.eu [#2477](https://github.com/duckduckgo/autoconsent/pull/2477) ([@daxtheduck](https://github.com/daxtheduck))
30
+ - Rule update: typo3-cookieconsent [#2469](https://github.com/duckduckgo/autoconsent/pull/2469) ([@daxtheduck](https://github.com/daxtheduck) [@muodov](https://github.com/muodov))
31
+ - Rule update: pakamera.pl [#2471](https://github.com/duckduckgo/autoconsent/pull/2471) ([@daxtheduck](https://github.com/daxtheduck))
32
+ - Rule update: hurra-consent, remove auto_NL_bonprix.nl_ovi [#2459](https://github.com/duckduckgo/autoconsent/pull/2459) ([@daxtheduck](https://github.com/daxtheduck))
33
+ - Rule update: isidewith.com [#2474](https://github.com/duckduckgo/autoconsent/pull/2474) ([@daxtheduck](https://github.com/daxtheduck))
34
+ - Rule update: binogi [#2473](https://github.com/duckduckgo/autoconsent/pull/2473) ([@daxtheduck](https://github.com/daxtheduck))
35
+ - Rule update: bokio [#2472](https://github.com/duckduckgo/autoconsent/pull/2472) ([@daxtheduck](https://github.com/daxtheduck))
36
+ - Rule update: purecookie-cosmetic [#2470](https://github.com/duckduckgo/autoconsent/pull/2470) ([@daxtheduck](https://github.com/daxtheduck))
37
+ - Rule update: calcolo.tools [#2468](https://github.com/duckduckgo/autoconsent/pull/2468) ([@daxtheduck](https://github.com/daxtheduck))
38
+ - Rule update: botble-cookie-consent [#2466](https://github.com/duckduckgo/autoconsent/pull/2466) ([@daxtheduck](https://github.com/daxtheduck))
39
+ - Rule update: vinnies-org-au [#2465](https://github.com/duckduckgo/autoconsent/pull/2465) ([@daxtheduck](https://github.com/daxtheduck))
40
+ - Rule update: hikvision.com [#2464](https://github.com/duckduckgo/autoconsent/pull/2464) ([@daxtheduck](https://github.com/daxtheduck))
41
+ - Rule update: tallink [#2463](https://github.com/duckduckgo/autoconsent/pull/2463) ([@daxtheduck](https://github.com/daxtheduck))
42
+ - Rule update: random-org [#2462](https://github.com/duckduckgo/autoconsent/pull/2462) ([@daxtheduck](https://github.com/daxtheduck))
43
+ - Rule update: dtu-findit [#2461](https://github.com/duckduckgo/autoconsent/pull/2461) ([@daxtheduck](https://github.com/daxtheduck))
44
+ - Rule update: landgate [#2460](https://github.com/duckduckgo/autoconsent/pull/2460) ([@daxtheduck](https://github.com/daxtheduck))
45
+
46
+ #### Enhancements
47
+
48
+ - Heuristic detection: fewer false positives, more languages, faster prefilter [#2103](https://github.com/duckduckgo/autoconsent/pull/2103) ([@sammacbeth](https://github.com/sammacbeth))
49
+
50
+ #### Authors: 3
51
+
52
+ - Dax ([@daxtheduck](https://github.com/daxtheduck))
53
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
54
+ - Sam Macbeth ([@sammacbeth](https://github.com/sammacbeth))
55
+
56
+ ---
57
+
1
58
  # v17.4.0 (Wed Nov 04 2026)
2
59
 
3
60
  #### Rules
@@ -222,6 +222,8 @@
222
222
  EVAL_TEALIUM_2: () => utag.gdpr.setConsentValue(true) || true,
223
223
  EVAL_TEALIUM_3: () => utag.gdpr.getConsentState() !== 1,
224
224
  EVAL_TEALIUM_DONOTSELL_CHECK: () => utag.gdpr.dns?.getDnsState() !== 1,
225
+ // 0 means no stored decision; otherwise the user reopened the prompt themselves
226
+ EVAL_TEALIUM_NO_DECISION: () => utag.gdpr.getConsentState() === 0,
225
227
  EVAL_TESTCMP_STEP: () => !!document.querySelector("#reject-all"),
226
228
  EVAL_TESTCMP_0: () => window.results.results[0] === "button_clicked",
227
229
  EVAL_TESTCMP_COSMETIC_0: () => window.results.results[0] === "banner_hidden",
@@ -236,7 +238,8 @@
236
238
  EVAL_USERCENTRICS_API_6: () => UC_UI.areAllConsentsAccepted() === false,
237
239
  EVAL_USERCENTRICS_BUTTON_0: () => JSON.parse(localStorage.getItem("usercentrics")).consents.every((c) => c.isEssential || !c.consentStatus),
238
240
  EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true,
239
- EVAL_WBD_LTP_CLOSE: () => document.querySelector("dialog#ltp-dialog").close() || true
241
+ EVAL_WBD_LTP_CLOSE: () => document.querySelector("dialog#ltp-dialog").close() || true,
242
+ EVAL_ZOHO_TEST: () => localStorage.getItem("zglobal_Acookie_optOut") === "3"
240
243
  };
241
244
 
242
245
  // addon/mv-compat.ts