@duckduckgo/autoconsent 16.47.0 → 16.49.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 (74) 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/AGENTS.md +5 -0
  5. package/CHANGELOG.md +56 -0
  6. package/data/Readme.md +6 -0
  7. package/data/labelled-button-texts.csv +7006 -0
  8. package/dist/addon-firefox/background.bundle.js +2 -0
  9. package/dist/addon-firefox/compact-rules.json +1 -1
  10. package/dist/addon-firefox/content.bundle.js +6 -7
  11. package/dist/addon-firefox/manifest.json +1 -1
  12. package/dist/addon-firefox/rule-index.json +1 -1
  13. package/dist/addon-firefox/rules.json +1 -1
  14. package/dist/addon-mv3/background.bundle.js +2 -0
  15. package/dist/addon-mv3/compact-rules.json +1 -1
  16. package/dist/addon-mv3/content.bundle.js +6 -7
  17. package/dist/addon-mv3/manifest.json +1 -1
  18. package/dist/addon-mv3/rule-index.json +1 -1
  19. package/dist/addon-mv3/rules.json +1 -1
  20. package/dist/autoconsent.cjs.js +6 -7
  21. package/dist/autoconsent.esm.js +6 -7
  22. package/dist/autoconsent.playwright.js +6 -7
  23. package/dist/autoconsent.standalone.js +7 -8
  24. package/dist/types/eval-snippets.d.ts +1 -0
  25. package/lib/eval-snippets.ts +3 -0
  26. package/lib/heuristic-patterns.ts +4 -8
  27. package/package.json +3 -1
  28. package/rules/autoconsent/borlabs.json +5 -0
  29. package/rules/autoconsent/burpee-com.json +13 -7
  30. package/rules/autoconsent/consentmo.json +51 -7
  31. package/rules/autoconsent/cookie-popup-close-cookies.json +37 -0
  32. package/rules/autoconsent/cookieconsent2.json +6 -1
  33. package/rules/autoconsent/costco.json +27 -0
  34. package/rules/autoconsent/datasign.json +85 -0
  35. package/rules/autoconsent/ensembleartsphilly.json +33 -0
  36. package/rules/autoconsent/evium.de.json +33 -0
  37. package/rules/autoconsent/iubenda.json +13 -7
  38. package/rules/autoconsent/pandectes.json +48 -15
  39. package/rules/autoconsent/passle.json +32 -0
  40. package/rules/autoconsent/pmc-privacy-banner.json +9 -0
  41. package/rules/autoconsent/primeconsent.json +39 -0
  42. package/rules/autoconsent/shinden.pl.json +34 -0
  43. package/rules/autoconsent/tealium.json +1 -1
  44. package/rules/autoconsent/tri-table.json +14 -0
  45. package/rules/autoconsent/truevault-polaris.json +63 -0
  46. package/rules/autoconsent/webflow.json +1 -1
  47. package/rules/autoconsent/wix.json +90 -8
  48. package/rules/compact-rules.json +1 -1
  49. package/rules/rule-index.json +1 -1
  50. package/rules/rules.json +1 -1
  51. package/scripts/benchmark-button-classification.ts +75 -0
  52. package/scripts/button-text-benchmark.ts +102 -0
  53. package/tests/borlabs.spec.ts +7 -3
  54. package/tests/burpee-com.spec.ts +10 -4
  55. package/tests/consentmo.spec.ts +1 -0
  56. package/tests/cookie-popup-close-cookies.spec.ts +10 -0
  57. package/tests/cookieconsent2.spec.ts +6 -1
  58. package/tests/costco.spec.ts +5 -0
  59. package/tests/datasign.spec.ts +8 -0
  60. package/tests/ensembleartsphilly.spec.ts +6 -0
  61. package/tests/evium.de.spec.ts +5 -0
  62. package/tests/iubenda.spec.ts +6 -0
  63. package/tests/pandectes.spec.ts +20 -1
  64. package/tests/passle.spec.ts +8 -0
  65. package/tests/pmc-privacy-banner.spec.ts +8 -0
  66. package/tests/primeconsent.spec.ts +11 -0
  67. package/tests/shinden.pl.spec.ts +5 -0
  68. package/tests/tealium.spec.ts +8 -6
  69. package/tests/tri-table.spec.ts +5 -0
  70. package/tests/truevault-polaris.spec.ts +9 -0
  71. package/tests/webflow.spec.ts +7 -1
  72. package/tests/wix.spec.ts +8 -1
  73. package/tests-wtr/heuristics/button-classification-accuracy.test.ts +41 -0
  74. package/tests-wtr/heuristics/heuristics-utils.test.ts +9 -0
@@ -347,6 +347,8 @@ var snippets = {
347
347
  ).consents.statistics,
348
348
  EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
349
349
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
350
+ // the close icon is an SVG, which has no click() method
351
+ EVAL_COOKIE_POPUP_CLOSE: () => document.querySelector("#cookie-popup #close-cookies").dispatchEvent(new MouseEvent("click", { bubbles: true })) || true,
350
352
  EVAL_COOKIE_LAW_INFO_0: () => {
351
353
  if (CLI.disableAllCookies) CLI.disableAllCookies();
352
354
  if (CLI.reject_close) CLI.reject_close();
@@ -628,10 +630,10 @@ var REJECT_PATTERNS_ENGLISH = [
628
630
  // e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
629
631
  /^\s*(continue|proceed|continue\s+browsing)\s+without\s+(accepting|agreeing|consent|cookies|tracking)(\s*→)?\s*$/is,
630
632
  // essential/necessary/functional-only, e.g. "essential cookies only", "accept only essential cookies",
631
- // "allow necessary cookies continue", "use essential cookies only", "functional only", "i confirm necessary"
633
+ // "allow necessary cookies continue", "use essential cookies only", "functional only", "essential only cookies", "i confirm necessary"
632
634
  /^\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,
633
635
  /^\s*(i\s+)?(want\s+to\s+)?only\s+(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s*(continue|only)?\s*$/is,
634
- /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s+only\s*$/is,
636
+ /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s+((cookies\s+)?only|only\s+cookies)\s*$/is,
635
637
  // e.g. "do not sell or share my personal information", "opt out of sale ..." (CCPA)
636
638
  /do\s+not\s+sell|opt\s+out\s+of\s+sale/is,
637
639
  // e.g. "opt-out of sale/share or targeted advertising", "opt-out of advertising/social media cookies"
@@ -1008,12 +1010,12 @@ var ACCEPT_PATTERNS = [
1008
1010
  /^(?!.*\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,
1009
1011
  /^continue (and accept|using cookies|with (all|recommended cookies|cookies))$/is,
1010
1012
  // DE accept verbs
1011
- /^(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,
1013
+ /^(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,
1012
1014
  /^((meine\s+)?auswahl|alle)\s+(bestätigen|akzeptieren|auswählen)$/is,
1013
1015
  /^(alle[nm]?\s+)?(zustimmen|einverstanden|einwilligung|zustimmung)$/is,
1014
1016
  /^ich (bin einverstanden|akzeptiere( alle)?|stimme zu)$/is,
1015
1017
  // NL accept verbs
1016
- /^(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,
1018
+ /^(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,
1017
1019
  /^(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,
1018
1020
  // FR accept verbs
1019
1021
  /^(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,
@@ -1152,10 +1154,7 @@ var ACKNOWLEDGE_PATTERNS = [
1152
1154
  /^close (banner|cookie notification)$/is,
1153
1155
  /understood$/is,
1154
1156
  "confirm my choices",
1155
- // French (FR)
1156
- "accepter fermer",
1157
1157
  // German (DE)
1158
- "akzeptieren schlie\xDFen",
1159
1158
  "speichern schlie\xDFen",
1160
1159
  // Spanish (ES)
1161
1160
  /^.?( lo)?(entendido|entiendo).?$/s,
@@ -317,6 +317,8 @@ var snippets = {
317
317
  ).consents.statistics,
318
318
  EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
319
319
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
320
+ // the close icon is an SVG, which has no click() method
321
+ EVAL_COOKIE_POPUP_CLOSE: () => document.querySelector("#cookie-popup #close-cookies").dispatchEvent(new MouseEvent("click", { bubbles: true })) || true,
320
322
  EVAL_COOKIE_LAW_INFO_0: () => {
321
323
  if (CLI.disableAllCookies) CLI.disableAllCookies();
322
324
  if (CLI.reject_close) CLI.reject_close();
@@ -598,10 +600,10 @@ var REJECT_PATTERNS_ENGLISH = [
598
600
  // e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
599
601
  /^\s*(continue|proceed|continue\s+browsing)\s+without\s+(accepting|agreeing|consent|cookies|tracking)(\s*→)?\s*$/is,
600
602
  // essential/necessary/functional-only, e.g. "essential cookies only", "accept only essential cookies",
601
- // "allow necessary cookies continue", "use essential cookies only", "functional only", "i confirm necessary"
603
+ // "allow necessary cookies continue", "use essential cookies only", "functional only", "essential only cookies", "i confirm necessary"
602
604
  /^\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,
603
605
  /^\s*(i\s+)?(want\s+to\s+)?only\s+(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s*(continue|only)?\s*$/is,
604
- /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s+only\s*$/is,
606
+ /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s+((cookies\s+)?only|only\s+cookies)\s*$/is,
605
607
  // e.g. "do not sell or share my personal information", "opt out of sale ..." (CCPA)
606
608
  /do\s+not\s+sell|opt\s+out\s+of\s+sale/is,
607
609
  // e.g. "opt-out of sale/share or targeted advertising", "opt-out of advertising/social media cookies"
@@ -978,12 +980,12 @@ var ACCEPT_PATTERNS = [
978
980
  /^(?!.*\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,
979
981
  /^continue (and accept|using cookies|with (all|recommended cookies|cookies))$/is,
980
982
  // DE accept verbs
981
- /^(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,
983
+ /^(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,
982
984
  /^((meine\s+)?auswahl|alle)\s+(bestätigen|akzeptieren|auswählen)$/is,
983
985
  /^(alle[nm]?\s+)?(zustimmen|einverstanden|einwilligung|zustimmung)$/is,
984
986
  /^ich (bin einverstanden|akzeptiere( alle)?|stimme zu)$/is,
985
987
  // NL accept verbs
986
- /^(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,
988
+ /^(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,
987
989
  /^(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,
988
990
  // FR accept verbs
989
991
  /^(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,
@@ -1122,10 +1124,7 @@ var ACKNOWLEDGE_PATTERNS = [
1122
1124
  /^close (banner|cookie notification)$/is,
1123
1125
  /understood$/is,
1124
1126
  "confirm my choices",
1125
- // French (FR)
1126
- "accepter fermer",
1127
1127
  // German (DE)
1128
- "akzeptieren schlie\xDFen",
1129
1128
  "speichern schlie\xDFen",
1130
1129
  // Spanish (ES)
1131
1130
  /^.?( lo)?(entendido|entiendo).?$/s,
@@ -319,6 +319,8 @@
319
319
  ).consents.statistics,
320
320
  EVAL_CC_BANNER2_0: () => !!document.cookie.match(/sncc=[^;]+D%3Dtrue/),
321
321
  EVAL_COINBASE_0: () => JSON.parse(decodeURIComponent(document.cookie.match(/cm_(eu|default)_preferences=([0-9a-zA-Z\\{\\}\\[\\]%:]*);?/)[2])).consent.length <= 1,
322
+ // the close icon is an SVG, which has no click() method
323
+ EVAL_COOKIE_POPUP_CLOSE: () => document.querySelector("#cookie-popup #close-cookies").dispatchEvent(new MouseEvent("click", { bubbles: true })) || true,
322
324
  EVAL_COOKIE_LAW_INFO_0: () => {
323
325
  if (CLI.disableAllCookies) CLI.disableAllCookies();
324
326
  if (CLI.reject_close) CLI.reject_close();
@@ -600,10 +602,10 @@
600
602
  // e.g. "continue without accepting", "continue without agreeing", "continue without agreeing →"
601
603
  /^\s*(continue|proceed|continue\s+browsing)\s+without\s+(accepting|agreeing|consent|cookies|tracking)(\s*→)?\s*$/is,
602
604
  // essential/necessary/functional-only, e.g. "essential cookies only", "accept only essential cookies",
603
- // "allow necessary cookies continue", "use essential cookies only", "functional only", "i confirm necessary"
605
+ // "allow necessary cookies continue", "use essential cookies only", "functional only", "essential only cookies", "i confirm necessary"
604
606
  /^\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,
605
607
  /^\s*(i\s+)?(want\s+to\s+)?only\s+(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s*(continue|only)?\s*$/is,
606
- /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s+only\s*$/is,
608
+ /^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s+((cookies\s+)?only|only\s+cookies)\s*$/is,
607
609
  // e.g. "do not sell or share my personal information", "opt out of sale ..." (CCPA)
608
610
  /do\s+not\s+sell|opt\s+out\s+of\s+sale/is,
609
611
  // e.g. "opt-out of sale/share or targeted advertising", "opt-out of advertising/social media cookies"
@@ -980,12 +982,12 @@
980
982
  /^(?!.*\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,
981
983
  /^continue (and accept|using cookies|with (all|recommended cookies|cookies))$/is,
982
984
  // DE accept verbs
983
- /^(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,
985
+ /^(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,
984
986
  /^((meine\s+)?auswahl|alle)\s+(bestätigen|akzeptieren|auswählen)$/is,
985
987
  /^(alle[nm]?\s+)?(zustimmen|einverstanden|einwilligung|zustimmung)$/is,
986
988
  /^ich (bin einverstanden|akzeptiere( alle)?|stimme zu)$/is,
987
989
  // NL accept verbs
988
- /^(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,
990
+ /^(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,
989
991
  /^(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,
990
992
  // FR accept verbs
991
993
  /^(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,
@@ -1124,10 +1126,7 @@
1124
1126
  /^close (banner|cookie notification)$/is,
1125
1127
  /understood$/is,
1126
1128
  "confirm my choices",
1127
- // French (FR)
1128
- "accepter fermer",
1129
1129
  // German (DE)
1130
- "akzeptieren schlie\xDFen",
1131
1130
  "speichern schlie\xDFen",
1132
1131
  // Spanish (ES)
1133
1132
  /^.?( lo)?(entendido|entiendo).?$/s,