@duckduckgo/autoconsent 16.48.0 → 16.50.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 (115) hide show
  1. package/.agents/skills/optimize-button-patterns/SKILL.md +145 -0
  2. package/.agents/skills/oxylabs-testing/SKILL.md +1 -1
  3. package/.claude/skills/optimize-button-patterns/SKILL.md +7 -0
  4. package/.github/workflows/release-labels.yml +2 -6
  5. package/AGENTS.md +2 -0
  6. package/CHANGELOG.md +77 -0
  7. package/data/Readme.md +6 -0
  8. package/data/labelled-button-texts.csv +7006 -0
  9. package/dist/addon-firefox/background.bundle.js +6 -1
  10. package/dist/addon-firefox/compact-rules.json +1 -1
  11. package/dist/addon-firefox/content.bundle.js +26 -13
  12. package/dist/addon-firefox/manifest.json +1 -1
  13. package/dist/addon-firefox/rule-index.json +1 -1
  14. package/dist/addon-firefox/rules.json +1 -1
  15. package/dist/addon-mv3/background.bundle.js +6 -1
  16. package/dist/addon-mv3/compact-rules.json +1 -1
  17. package/dist/addon-mv3/content.bundle.js +26 -13
  18. package/dist/addon-mv3/manifest.json +1 -1
  19. package/dist/addon-mv3/rule-index.json +1 -1
  20. package/dist/addon-mv3/rules.json +1 -1
  21. package/dist/autoconsent.cjs.js +26 -13
  22. package/dist/autoconsent.esm.js +26 -13
  23. package/dist/autoconsent.playwright.js +26 -13
  24. package/dist/autoconsent.standalone.js +27 -14
  25. package/dist/types/eval-snippets.d.ts +3 -0
  26. package/lib/eval-snippets.ts +7 -0
  27. package/lib/heuristic-patterns.ts +20 -11
  28. package/package.json +3 -1
  29. package/rules/autoconsent/amazon-hiring.json +16 -0
  30. package/rules/autoconsent/avada-cookie-consent.json +43 -0
  31. package/rules/autoconsent/axeptio.json +17 -4
  32. package/rules/autoconsent/bigcrunch.json +39 -0
  33. package/rules/autoconsent/borlabs.json +5 -0
  34. package/rules/autoconsent/bricklink.json +33 -0
  35. package/rules/autoconsent/ceneo.json +9 -0
  36. package/rules/autoconsent/conjointly.json +43 -0
  37. package/rules/autoconsent/consentmo.json +51 -7
  38. package/rules/autoconsent/cookie-popup-close-cookies.json +37 -0
  39. package/rules/autoconsent/cookieconsent2.json +6 -1
  40. package/rules/autoconsent/costco.json +27 -0
  41. package/rules/autoconsent/datasign.json +85 -0
  42. package/rules/autoconsent/dhbbank.json +13 -0
  43. package/rules/autoconsent/ee-consent-notice.json +40 -0
  44. package/rules/autoconsent/ensembleartsphilly.json +33 -0
  45. package/rules/autoconsent/evium.de.json +33 -0
  46. package/rules/autoconsent/fera-cookies.json +67 -0
  47. package/rules/autoconsent/iubenda.json +13 -7
  48. package/rules/autoconsent/la7-cmp.json +30 -0
  49. package/rules/autoconsent/laravel-cookie-consent.json +45 -0
  50. package/rules/autoconsent/legislation-gov-uk.json +43 -0
  51. package/rules/autoconsent/mackeeper.json +34 -0
  52. package/rules/autoconsent/ndl-go-jp.json +35 -0
  53. package/rules/autoconsent/pandectes.json +48 -15
  54. package/rules/autoconsent/passle.json +32 -0
  55. package/rules/autoconsent/paypal-us.json +3 -3
  56. package/rules/autoconsent/paypal.json +5 -2
  57. package/rules/autoconsent/primeconsent.json +39 -0
  58. package/rules/autoconsent/shinden.pl.json +34 -0
  59. package/rules/autoconsent/texas-instruments.json +17 -0
  60. package/rules/autoconsent/thegrandyork.json +46 -0
  61. package/rules/autoconsent/thenounproject.json +61 -0
  62. package/rules/autoconsent/toyota.json +16 -5
  63. package/rules/autoconsent/tri-table.json +14 -0
  64. package/rules/autoconsent/truevault-polaris.json +63 -0
  65. package/rules/autoconsent/uft-cookie-notice.json +15 -0
  66. package/rules/autoconsent/wbd-legal-terms.json +32 -0
  67. package/rules/autoconsent/webflow.json +1 -1
  68. package/rules/autoconsent/wix.json +90 -8
  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/benchmark-button-classification.ts +75 -0
  73. package/scripts/button-text-benchmark.ts +102 -0
  74. package/tests/amazon-hiring.spec.ts +3 -0
  75. package/tests/avada-cookie-consent.spec.ts +9 -0
  76. package/tests/axeptio.spec.ts +8 -4
  77. package/tests/bigcrunch.spec.ts +16 -0
  78. package/tests/borlabs.spec.ts +7 -3
  79. package/tests/bricklink.spec.ts +3 -0
  80. package/tests/ceneo.spec.ts +3 -0
  81. package/tests/conjointly.spec.ts +3 -0
  82. package/tests/consentmo.spec.ts +1 -0
  83. package/tests/cookie-popup-close-cookies.spec.ts +10 -0
  84. package/tests/cookieconsent2.spec.ts +6 -1
  85. package/tests/costco.spec.ts +5 -0
  86. package/tests/datasign.spec.ts +8 -0
  87. package/tests/dhbbank.spec.ts +6 -0
  88. package/tests/ee-consent-notice.spec.ts +9 -0
  89. package/tests/ensembleartsphilly.spec.ts +6 -0
  90. package/tests/evium.de.spec.ts +5 -0
  91. package/tests/fera-cookies.spec.ts +6 -0
  92. package/tests/iubenda.spec.ts +6 -0
  93. package/tests/la7-cmp.spec.ts +6 -0
  94. package/tests/laravel-cookie-consent.spec.ts +10 -0
  95. package/tests/legislation-gov-uk.spec.ts +3 -0
  96. package/tests/mackeeper.spec.ts +3 -0
  97. package/tests/ndl-go-jp.spec.ts +8 -0
  98. package/tests/pandectes.spec.ts +20 -1
  99. package/tests/passle.spec.ts +8 -0
  100. package/tests/paypal-us.spec.ts +2 -3
  101. package/tests/primeconsent.spec.ts +11 -0
  102. package/tests/shinden.pl.spec.ts +5 -0
  103. package/tests/texas-instruments.spec.ts +3 -0
  104. package/tests/thegrandyork.spec.ts +3 -0
  105. package/tests/thenounproject.spec.ts +3 -0
  106. package/tests/tri-table.spec.ts +5 -0
  107. package/tests/truevault-polaris.spec.ts +9 -0
  108. package/tests/uft-cookie-notice.spec.ts +3 -0
  109. package/tests/wbd-legal-terms.spec.ts +18 -0
  110. package/tests/webflow.spec.ts +7 -1
  111. package/tests/wix.spec.ts +8 -1
  112. package/tests-wtr/heuristics/button-classification-accuracy.test.ts +41 -0
  113. package/tests-wtr/heuristics/heuristics-utils.test.ts +64 -0
  114. package/rules/autoconsent/paypal-cookieprefs.json +0 -29
  115. package/tests/paypal-cookieprefs.spec.ts +0 -7
@@ -311,6 +311,8 @@
311
311
  ).consents.statistics,
312
312
  EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
313
313
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
314
+ // the close icon is an SVG, which has no click() method
315
+ EVAL_COOKIE_POPUP_CLOSE: () => document.querySelector("#cookie-popup #close-cookies").dispatchEvent(new MouseEvent("click", { bubbles: true })) || true,
314
316
  EVAL_COOKIE_LAW_INFO_0: () => {
315
317
  if (CLI.disableAllCookies) CLI.disableAllCookies();
316
318
  if (CLI.reject_close) CLI.reject_close();
@@ -334,6 +336,8 @@
334
336
  EVAL_COOKIEFIRST_1: () => document.querySelectorAll("button[data-cookiefirst-accent-color=true][role=checkbox]:not([disabled])").forEach((i) => i.getAttribute("aria-checked") === "true" && i.click()) || true,
335
337
  EVAL_COOKIEINFORMATION_0: () => CookieInformation.declineAllCategories() || true,
336
338
  EVAL_COOKIEINFORMATION_1: () => CookieInformation.submitAllCategories() || true,
339
+ // turn the single-button form into a decline submission, same fields as the CMP's own decline form
340
+ EVAL_EE_CONSENT_DECLINE_0: () => document.querySelectorAll('#cookieConsentFormAccept input[name^="ee:cookies_"]').forEach((i) => i.value = "n") || true,
337
341
  EVAL_ETSY_0: () => document.querySelectorAll(".gdpr-overlay-body input").forEach((toggle) => {
338
342
  toggle.checked = false;
339
343
  }) || true,
@@ -420,7 +424,8 @@
420
424
  EVAL_USERCENTRICS_API_5: () => UC_UI.areAllConsentsAccepted() === true,
421
425
  EVAL_USERCENTRICS_API_6: () => UC_UI.areAllConsentsAccepted() === false,
422
426
  EVAL_USERCENTRICS_BUTTON_0: () => JSON.parse(localStorage.getItem("usercentrics")).consents.every((c) => c.isEssential || !c.consentStatus),
423
- EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true
427
+ EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true,
428
+ EVAL_WBD_LTP_CLOSE: () => document.querySelector("dialog#ltp-dialog").close() || true
424
429
  };
425
430
  function getFunctionBody(snippetFunc) {
426
431
  const snippetStr = snippetFunc.toString();
@@ -436,7 +441,8 @@
436
441
  // "only necessary" is probably too broad
437
442
  /(?:by continuing.{0,100}cookie)|(?:cookie.{0,100}by continuing)/gi,
438
443
  /(?:by continuing.{0,100}privacy)|(?:privacy.{0,100}by continuing)/gi,
439
- /we (?:use|serve)(?: optional| essential)? cookies/gi,
444
+ // a single qualifier is common: "optional", "essential", "necessary", "analytics", ...
445
+ /we (?:use|serve)(?: \w+)? cookies/gi,
440
446
  /we are using cookies/gi,
441
447
  /use of cookies/gi,
442
448
  /website uses cookies to enhance your browsing experience/gi,
@@ -580,7 +586,10 @@
580
586
  // "файлы cookie" / "cookie-файлы" / "куки-файлы" in any phrasing
581
587
  /(?:файл[а-яё]*[\s-]+(?:cookie|куки)|(?:cookie|куки)[\s-]+файл[а-яё]*)/gi,
582
588
  // Italian (IT)
583
- /usiamo.{0,20}cookie/gi
589
+ /usiamo.{0,20}cookie/gi,
590
+ // Japanese (JA)
591
+ // e.g. "当サイトはCookieを使用しています", "クッキー(Cookie)を利用しています"
592
+ /(?:cookie|クッキー).{0,10}を(?:使用|利用)/gi
584
593
  ];
585
594
  var REJECT_PATTERNS_ENGLISH = [
586
595
  // e.g. "reject", "reject all", "reject all cookies", "deny all", "refuse cookies", "decline",
@@ -592,12 +601,12 @@
592
601
  // e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
593
602
  /^\s*(continue|proceed|continue\s+browsing)\s+without\s+(accepting|agreeing|consent|cookies|tracking)(\s*→)?\s*$/is,
594
603
  // essential/necessary/functional-only, e.g. "essential cookies only", "accept only essential cookies",
595
- // "allow necessary cookies continue", "use essential cookies only", "functional only", "i confirm necessary"
604
+ // "allow necessary cookies continue", "use essential cookies only", "functional only", "essential only cookies", "i confirm necessary"
596
605
  /^\s*(i\s+)?(want\s+to\s+)?(only\s+)?(use|accept|allow|keep|enable|choose|continue\s+with|i\s+confirm)\s*(only\s+)?(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s*(continue|only)?\s*$/is,
597
606
  /^\s*(i\s+)?(want\s+to\s+)?only\s+(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s*(continue|only)?\s*$/is,
598
- /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s+only\s*$/is,
599
- // e.g. "do not sell or share my personal information", "opt out of sale ..." (CCPA)
600
- /do\s+not\s+sell|opt\s+out\s+of\s+sale/is,
607
+ /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s+((cookies\s+)?only|only\s+cookies)\s*$/is,
608
+ // e.g. "do not sell or share my personal information", "do not share my personal information", "opt out of sale ..." (CCPA)
609
+ /do\s+not\s+sell|do\s+not\s+share\s+my\s+(personal\s+)?(information|info|data)|opt\s+out\s+of\s+sale/is,
601
610
  // e.g. "opt-out of sale/share or targeted advertising", "opt-out of advertising/social media cookies"
602
611
  /^opt[ -]?out of /is,
603
612
  // e.g. "reject all except strictly necessary", "reject all (except necessary cookies)"
@@ -744,6 +753,12 @@
744
753
  ];
745
754
  var REJECT_PATTERNS_TURKISH = ["reddet", "\xE7erezleri reddet"];
746
755
  var REJECT_PATTERNS_INDONESIAN = ["tolak cookie"];
756
+ var REJECT_PATTERNS_JAPANESE = [
757
+ // e.g. "拒否", "すべて拒否", "全て拒否する", "cookieを拒否"
758
+ /^(すべて|全て)?\s?(の)?(cookie|クッキー)?\s?(を)?拒否(する)?$/i,
759
+ "\u540C\u610F\u3057\u306A\u3044",
760
+ "\u540C\u610F\u3057\u307E\u305B\u3093"
761
+ ];
747
762
  var REJECT_PATTERNS = [
748
763
  ...REJECT_PATTERNS_ENGLISH,
749
764
  ...REJECT_PATTERNS_DUTCH,
@@ -761,7 +776,8 @@
761
776
  ...REJECT_PATTERNS_POLISH,
762
777
  ...REJECT_PATTERNS_RUSSIAN,
763
778
  ...REJECT_PATTERNS_TURKISH,
764
- ...REJECT_PATTERNS_INDONESIAN
779
+ ...REJECT_PATTERNS_INDONESIAN,
780
+ ...REJECT_PATTERNS_JAPANESE
765
781
  ];
766
782
  var BUTTON_NEVER_MATCH_PATTERNS = [
767
783
  /pay|subscribe/is,
@@ -972,12 +988,12 @@
972
988
  /^(?!.*\b(essential|necessary|required|functional|minimal|reject|deny|refuse|decline|only|dismiss)\b)(?!.*all cookies continue)(yes,?\s+)?(i\s+)?(accept|agree|allow|consent|enable)(\s+(to\s+)?(all( cookies)?|cookies|selection|selected( cookies)?|everything|recommended( cookies| settings)?|optional( cookies)?|additional cookies|analytics cookies))?(\s+(and\s+)?(continue|close|proceed|save))?\s*$/is,
973
989
  /^continue (and accept|using cookies|with (all|recommended cookies|cookies))$/is,
974
990
  // DE accept verbs
975
- /^(alle[sn]?\s+|allem\s+|ich\s+|cookies\s+|ausgewählte\s+|webanalyse\s+)?(cookies?\s+)?(akzeptieren|annehmen|zustimmen|zulassen|erlauben|einwilligen|aktivieren|auswählen)(\s+(und\s+)?(weiter|schließen))?\s*$/is,
991
+ /^(alle[sn]?\s+|allem\s+|ich\s+|cookies\s+|ausgewählte\s+|webanalyse\s+)?(cookies?\s+)?(akzeptieren|annehmen|zustimmen|zulassen|erlauben|einwilligen|aktivieren|auswählen)(\s+(und\s+)?(weiter|schlie(ß|ss)en))?\s*$/is,
976
992
  /^((meine\s+)?auswahl|alle)\s+(bestätigen|akzeptieren|auswählen)$/is,
977
993
  /^(alle[nm]?\s+)?(zustimmen|einverstanden|einwilligung|zustimmung)$/is,
978
994
  /^ich (bin einverstanden|akzeptiere( alle)?|stimme zu)$/is,
979
995
  // NL accept verbs
980
- /^(ja,?\s+)?(alle[s]?\s+|ik\s+)?(cookies?\s+)?(accepteer|accepteren|toestaan|aanvaard|aanvaarden|ga akkoord|akkoord)(\s+(en\s+(sluiten|doorgaan|verdergaan)|cookies|alle))?\s*$/is,
996
+ /^(ja,?\s+)?(alle[s]?\s+|ik\s+)?(cookies?\s+)?(accepteer|accepteren|toestaan|aanvaard|aanvaarden|ga akkoord|akkoord)(\s+((en\s+)?sluiten|en\s+(doorgaan|verdergaan)|cookies|alle))?\s*$/is,
981
997
  /^(selectie (accepteren|toestaan)|accepteer (selectie|alle)|alle (toestaan|accepteren|aanvaarden)|ja, (dat is prima|prima|alles toestaan|accepteren|ik accepteer cookies|ik ga akkoord)|is goed)$/is,
982
998
  // FR accept verbs
983
999
  /^(oui,?\s+)?(je\s+)?(tout\s+)?(accepter|jaccepte|autoriser)(\s+(tout|tous les (cookies|témoins)|les (cookies|témoins)|la sélection|et (continuer|fermer|poursuivre)))?\s*$/is,
@@ -1116,10 +1132,7 @@
1116
1132
  /^close (banner|cookie notification)$/is,
1117
1133
  /understood$/is,
1118
1134
  "confirm my choices",
1119
- // French (FR)
1120
- "accepter fermer",
1121
1135
  // German (DE)
1122
- "akzeptieren schlie\xDFen",
1123
1136
  "speichern schlie\xDFen",
1124
1137
  // Spanish (ES)
1125
1138
  /^.?( lo)?(entendido|entiendo).?$/s,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2026.10.7",
4
+ "version": "2026.10.9",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"