@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.
- package/.github/dependabot.yml +0 -3
- package/.github/workflows/release.yml +0 -4
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +20 -0
- package/build.sh +0 -2
- package/dist/addon-firefox/background.bundle.js +8 -24
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +176 -686
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/popup.bundle.js +31 -27
- package/dist/addon-firefox/popup.html +21 -13
- package/dist/addon-firefox/rule-index.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +8 -24
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +176 -686
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/popup.bundle.js +31 -27
- package/dist/addon-mv3/popup.html +21 -13
- package/dist/addon-mv3/rule-index.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +176 -685
- package/dist/autoconsent.esm.js +176 -685
- package/dist/autoconsent.playwright.js +177 -689
- package/dist/autoconsent.standalone.js +177 -690
- package/dist/types/cmps/base.d.ts +3 -3
- package/dist/types/heuristics.d.ts +2 -2
- package/dist/types/types.d.ts +10 -23
- package/dist/types/web.d.ts +0 -9
- package/docs/api.md +1 -8
- package/docs/puppeteer.md +1 -3
- package/docs/rule-syntax.md +0 -17
- package/eslint.config.mjs +1 -1
- package/lib/cmps/base.ts +5 -6
- package/lib/heuristics.ts +15 -15
- package/lib/types.ts +9 -21
- package/lib/utils.ts +2 -4
- package/lib/web.ts +3 -53
- package/package.json +4 -17
- package/playwright/content.ts +1 -2
- package/readme.md +3 -6
- package/rules/autoconsent/dreamlab-cmp.json +13 -0
- package/rules/build.ts +1 -24
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index-builder.ts +2 -7
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/standalone/content.ts +0 -2
- package/tests/dreamlab-cmp.spec.ts +3 -0
- package/tests/quantcast.spec.ts +0 -6
- package/tests-wtr/heuristics/get-actionable-popups.ts +13 -13
- package/tests-wtr/heuristics/heuristic-cmp.ts +32 -33
- package/tests-wtr/lifecycle/find-cmp.ts +5 -8
- package/tests-wtr/web/do-opt-in.test.ts +0 -1
- package/tests-wtr/web/do-opt-out.test.ts +0 -1
- package/tests-wtr/web/do-self-test.test.ts +0 -1
- package/tests-wtr/web/filter-cmps.test.ts +0 -1
- package/tests-wtr/web/receive-message-callback.test.ts +1 -2
- package/tests-wtr/web/update-state.test.ts +1 -3
- package/tsconfig.build.json +1 -1
- package/.github/workflows/update-filterlist.yml +0 -42
- package/dist/autoconsent.extra.cjs.js +0 -15717
- package/dist/autoconsent.extra.esm.js +0 -15649
- package/dist/types/cmps/consentomatic.d.ts +0 -34
- package/dist/types/consentomatic/index.d.ts +0 -2
- package/dist/types/consentomatic/tools.d.ts +0 -10
- package/dist/types/filterlist-engine.d.ts +0 -2
- package/dist/types/filterlist-utils.d.ts +0 -4
- package/dist/types/web-extra.d.ts +0 -11
- package/lib/cmps/consentomatic.ts +0 -97
- package/lib/consentomatic/index.ts +0 -252
- package/lib/consentomatic/tools.ts +0 -199
- package/lib/filterlist-engine.ts +0 -5
- package/lib/filterlist-utils.ts +0 -45
- package/lib/web-extra.ts +0 -116
- package/rules/consentomatic.json +0 -1
- package/rules/filterlist.txt +0 -18440
- package/rules/filterlists/overrides.txt +0 -4
- package/scripts/compile-filterlist.mjs +0 -63
- package/scripts/fetch-easylist.sh +0 -25
- package/scripts/rebuild-filterlist.mjs +0 -216
- package/tests/oil.spec.ts +0 -7
- package/tests/springer.spec.ts +0 -7
- package/tests/wordpressgdpr.spec.ts +0 -6
|
@@ -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:
|
|
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.
|
|
827
|
-
storedConfig.
|
|
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
|
|
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
|
-
|
|
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
|
|
1101
|
-
|
|
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
|
-
|
|
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
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
|
192
|
-
<input type="
|
|
193
|
-
<label for="heuristic-
|
|
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
|
|