@duckduckgo/autoconsent 15.1.0 → 16.0.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 (84) hide show
  1. package/.github/dependabot.yml +0 -3
  2. package/.github/workflows/release.yml +0 -4
  3. package/AGENTS.md +3 -3
  4. package/CHANGELOG.md +20 -0
  5. package/build.sh +0 -2
  6. package/dist/addon-firefox/background.bundle.js +8 -24
  7. package/dist/addon-firefox/compact-rules.json +1 -1
  8. package/dist/addon-firefox/content.bundle.js +176 -686
  9. package/dist/addon-firefox/manifest.json +1 -1
  10. package/dist/addon-firefox/popup.bundle.js +31 -27
  11. package/dist/addon-firefox/popup.html +21 -13
  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 +8 -24
  15. package/dist/addon-mv3/compact-rules.json +1 -1
  16. package/dist/addon-mv3/content.bundle.js +176 -686
  17. package/dist/addon-mv3/manifest.json +1 -1
  18. package/dist/addon-mv3/popup.bundle.js +31 -27
  19. package/dist/addon-mv3/popup.html +21 -13
  20. package/dist/addon-mv3/rule-index.json +1 -1
  21. package/dist/addon-mv3/rules.json +1 -1
  22. package/dist/autoconsent.cjs.js +176 -685
  23. package/dist/autoconsent.esm.js +176 -685
  24. package/dist/autoconsent.playwright.js +177 -689
  25. package/dist/autoconsent.standalone.js +177 -690
  26. package/dist/types/cmps/base.d.ts +3 -3
  27. package/dist/types/heuristics.d.ts +2 -2
  28. package/dist/types/types.d.ts +10 -23
  29. package/dist/types/web.d.ts +0 -9
  30. package/docs/api.md +1 -8
  31. package/docs/puppeteer.md +1 -3
  32. package/docs/rule-syntax.md +0 -17
  33. package/eslint.config.mjs +1 -1
  34. package/lib/cmps/base.ts +5 -6
  35. package/lib/heuristics.ts +15 -15
  36. package/lib/types.ts +9 -21
  37. package/lib/utils.ts +2 -4
  38. package/lib/web.ts +3 -53
  39. package/package.json +4 -17
  40. package/playwright/content.ts +1 -2
  41. package/readme.md +3 -6
  42. package/rules/autoconsent/dreamlab-cmp.json +13 -0
  43. package/rules/build.ts +1 -24
  44. package/rules/compact-rules.json +1 -1
  45. package/rules/rule-index-builder.ts +2 -7
  46. package/rules/rule-index.json +1 -1
  47. package/rules/rules.json +1 -1
  48. package/standalone/content.ts +0 -2
  49. package/tests/dreamlab-cmp.spec.ts +3 -0
  50. package/tests/quantcast.spec.ts +0 -6
  51. package/tests-wtr/heuristics/get-actionable-popups.ts +13 -13
  52. package/tests-wtr/heuristics/heuristic-cmp.ts +32 -33
  53. package/tests-wtr/lifecycle/find-cmp.ts +5 -8
  54. package/tests-wtr/web/do-opt-in.test.ts +0 -1
  55. package/tests-wtr/web/do-opt-out.test.ts +0 -1
  56. package/tests-wtr/web/do-self-test.test.ts +0 -1
  57. package/tests-wtr/web/filter-cmps.test.ts +0 -1
  58. package/tests-wtr/web/receive-message-callback.test.ts +1 -2
  59. package/tests-wtr/web/update-state.test.ts +1 -3
  60. package/tsconfig.build.json +1 -1
  61. package/.github/workflows/update-filterlist.yml +0 -42
  62. package/dist/autoconsent.extra.cjs.js +0 -15717
  63. package/dist/autoconsent.extra.esm.js +0 -15649
  64. package/dist/types/cmps/consentomatic.d.ts +0 -34
  65. package/dist/types/consentomatic/index.d.ts +0 -2
  66. package/dist/types/consentomatic/tools.d.ts +0 -10
  67. package/dist/types/filterlist-engine.d.ts +0 -2
  68. package/dist/types/filterlist-utils.d.ts +0 -4
  69. package/dist/types/web-extra.d.ts +0 -11
  70. package/lib/cmps/consentomatic.ts +0 -97
  71. package/lib/consentomatic/index.ts +0 -252
  72. package/lib/consentomatic/tools.ts +0 -199
  73. package/lib/filterlist-engine.ts +0 -5
  74. package/lib/filterlist-utils.ts +0 -45
  75. package/lib/web-extra.ts +0 -116
  76. package/rules/consentomatic.json +0 -1
  77. package/rules/filterlist.txt +0 -18440
  78. package/rules/filterlists/overrides.txt +0 -4
  79. package/scripts/compile-filterlist.mjs +0 -63
  80. package/scripts/fetch-easylist.sh +0 -25
  81. package/scripts/rebuild-filterlist.mjs +0 -216
  82. package/tests/oil.spec.ts +0 -7
  83. package/tests/springer.spec.ts +0 -7
  84. package/tests/wordpressgdpr.spec.ts +0 -6
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2026.6.20",
4
+ "version": "2026.6.23",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -761,14 +761,6 @@
761
761
  return parseImpl(url, 5, suffixLookup, options, getEmptyResult());
762
762
  }
763
763
 
764
- // lib/types.ts
765
- var PopupHandlingModes = {
766
- None: -1,
767
- Reject: 0,
768
- Tier1: 1,
769
- Tier2: 2
770
- };
771
-
772
764
  // lib/utils.ts
773
765
  function copyObject(data) {
774
766
  if (globalThis.structuredClone) {
@@ -786,12 +778,10 @@
786
778
  enableCosmeticRules: true,
787
779
  enableGeneratedRules: true,
788
780
  enableHeuristicDetection: false,
789
- enableHeuristicAction: false,
790
781
  enablePopupMutationObserver: false,
791
782
  detectRetries: 20,
792
783
  isMainWorld: false,
793
784
  prehideTimeout: 2e3,
794
- enableFilterList: false,
795
785
  visualTest: false,
796
786
  logs: {
797
787
  lifecycle: false,
@@ -804,7 +794,8 @@
804
794
  },
805
795
  performanceLoggingEnabled: false,
806
796
  heuristicPopupSearchTimeout: 100,
807
- heuristicMode: PopupHandlingModes.Reject
797
+ heuristicMode: "off"
798
+ // heuristic disabled by default
808
799
  };
809
800
  const updatedConfig = copyObject(defaultConfig);
810
801
  for (const key of Object.keys(defaultConfig)) {
@@ -823,8 +814,8 @@
823
814
  if (storedConfig.enablePopupMutationObserver === void 0) {
824
815
  storedConfig.enablePopupMutationObserver = true;
825
816
  }
826
- if (storedConfig.enableHeuristicAction === void 0) {
827
- storedConfig.enableHeuristicAction = true;
817
+ if (storedConfig.heuristicMode === void 0) {
818
+ storedConfig.heuristicMode = "tier1";
828
819
  }
829
820
  if (!storedConfig.logs) {
830
821
  storedConfig.logs = {
@@ -927,7 +918,10 @@
927
918
  const cosmeticOffRadio = document.querySelector("input#cosmetic-off");
928
919
  const generatedOnRadio = document.querySelector("input#generated-on");
929
920
  const generatedOffRadio = document.querySelector("input#generated-off");
930
- const heuristicActionCheckbox = document.querySelector("input#heuristic-action");
921
+ const heuristicOffRadio = document.querySelector("input#heuristic-off");
922
+ const heuristicRejectRadio = document.querySelector("input#heuristic-reject");
923
+ const heuristicTier1Radio = document.querySelector("input#heuristic-tier1");
924
+ const heuristicTier2Radio = document.querySelector("input#heuristic-tier2");
931
925
  const visualTestOnRadio = document.querySelector("input#visual-test-on");
932
926
  const visualTestOffRadio = document.querySelector("input#visual-test-off");
933
927
  const popupMutationOnRadio = document.querySelector("input#popup-mutation-on");
@@ -969,15 +963,6 @@
969
963
  disableAll: document.querySelector("#code-rules-disable-all"),
970
964
  status: document.querySelector("#code-rules-status"),
971
965
  list: document.querySelector("#code-rules-list")
972
- },
973
- consentomatic: {
974
- details: document.querySelector("#consentomatic-rules-section"),
975
- count: document.querySelector("#consentomatic-rules-count"),
976
- search: document.querySelector("#consentomatic-rules-search"),
977
- enableAll: document.querySelector("#consentomatic-rules-enable-all"),
978
- disableAll: document.querySelector("#consentomatic-rules-disable-all"),
979
- status: document.querySelector("#consentomatic-rules-status"),
980
- list: document.querySelector("#consentomatic-rules-list")
981
966
  }
982
967
  };
983
968
  let ruleIndexPromise = null;
@@ -1048,7 +1033,15 @@
1048
1033
  } else {
1049
1034
  generatedOffRadio.checked = true;
1050
1035
  }
1051
- heuristicActionCheckbox.checked = autoconsentConfig.enableHeuristicAction;
1036
+ if (autoconsentConfig.heuristicMode === "reject") {
1037
+ heuristicRejectRadio.checked = true;
1038
+ } else if (autoconsentConfig.heuristicMode === "tier1") {
1039
+ heuristicTier1Radio.checked = true;
1040
+ } else if (autoconsentConfig.heuristicMode === "tier2") {
1041
+ heuristicTier2Radio.checked = true;
1042
+ } else {
1043
+ heuristicOffRadio.checked = true;
1044
+ }
1052
1045
  if (autoconsentConfig.visualTest) {
1053
1046
  visualTestOnRadio.checked = true;
1054
1047
  } else {
@@ -1097,11 +1090,22 @@
1097
1090
  }
1098
1091
  generatedOnRadio.addEventListener("change", generatedChange);
1099
1092
  generatedOffRadio.addEventListener("change", generatedChange);
1100
- function heuristicActionChange() {
1101
- autoconsentConfig.enableHeuristicAction = heuristicActionCheckbox.checked;
1093
+ function heuristicModeChange() {
1094
+ if (heuristicRejectRadio.checked) {
1095
+ autoconsentConfig.heuristicMode = "reject";
1096
+ } else if (heuristicTier1Radio.checked) {
1097
+ autoconsentConfig.heuristicMode = "tier1";
1098
+ } else if (heuristicTier2Radio.checked) {
1099
+ autoconsentConfig.heuristicMode = "tier2";
1100
+ } else {
1101
+ autoconsentConfig.heuristicMode = "off";
1102
+ }
1102
1103
  storageSet({ config: autoconsentConfig });
1103
1104
  }
1104
- heuristicActionCheckbox.addEventListener("change", heuristicActionChange);
1105
+ heuristicOffRadio.addEventListener("change", heuristicModeChange);
1106
+ heuristicRejectRadio.addEventListener("change", heuristicModeChange);
1107
+ heuristicTier1Radio.addEventListener("change", heuristicModeChange);
1108
+ heuristicTier2Radio.addEventListener("change", heuristicModeChange);
1105
1109
  function visualTestChange() {
1106
1110
  autoconsentConfig.visualTest = visualTestOnRadio.checked;
1107
1111
  storageSet({ config: autoconsentConfig });
@@ -176,21 +176,29 @@
176
176
  <div class="rule-list-status" id="code-rules-status"></div>
177
177
  <div class="rule-list" id="code-rules-list"></div>
178
178
  </details>
179
+ </fieldset>
179
180
 
180
- <details class="rule-section" id="consentomatic-rules-section">
181
- <summary>Consent-O-Matic rules <span id="consentomatic-rules-count"></span></summary>
182
- <input class="rule-search" type="search" id="consentomatic-rules-search" placeholder="Search Consent-O-Matic rules" />
183
- <div class="rule-actions">
184
- <button id="consentomatic-rules-enable-all">Enable all</button>
185
- <button id="consentomatic-rules-disable-all">Disable all</button>
186
- </div>
187
- <div class="rule-list-status" id="consentomatic-rules-status"></div>
188
- <div class="rule-list" id="consentomatic-rules-list"></div>
189
- </details>
181
+ <fieldset>
182
+ <legend>Handle unknown popups (heuristic rule)</legend>
183
+
184
+ <div>
185
+ <input type="radio" id="heuristic-off" name="heuristic-mode" value="off" checked />
186
+ <label for="heuristic-off">Off</label>
187
+ </div>
190
188
 
191
- <div class="rule-section">
192
- <input type="checkbox" id="heuristic-action" name="heuristic-action" />
193
- <label for="heuristic-action">Handle unknown popups (heuristic rule)</label>
189
+ <div>
190
+ <input type="radio" id="heuristic-reject" name="heuristic-mode" value="reject" />
191
+ <label for="heuristic-reject">Reject when possible</label>
192
+ </div>
193
+
194
+ <div>
195
+ <input type="radio" id="heuristic-tier1" name="heuristic-mode" value="tier1" />
196
+ <label for="heuristic-tier1">Acknowledge if no reject (tier 1)</label>
197
+ </div>
198
+
199
+ <div>
200
+ <input type="radio" id="heuristic-tier2" name="heuristic-mode" value="tier2" />
201
+ <label for="heuristic-tier2">Accept if no reject or acknowledge (tier 2)</label>
194
202
  </div>
195
203
  </fieldset>
196
204