@duckduckgo/autoconsent 15.0.0 → 15.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.
- package/CHANGELOG.md +12 -0
- package/build.sh +3 -0
- package/dist/addon-firefox/content.bundle.js +15 -7
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/popup.bundle.js +180 -13
- package/dist/addon-firefox/popup.html +93 -8
- package/dist/addon-firefox/rule-index.json +1 -0
- package/dist/addon-mv3/content.bundle.js +15 -7
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/popup.bundle.js +180 -13
- package/dist/addon-mv3/popup.html +93 -8
- package/dist/addon-mv3/rule-index.json +1 -0
- package/dist/autoconsent.cjs.js +15 -7
- package/dist/autoconsent.esm.js +15 -7
- package/dist/autoconsent.extra.cjs.js +15 -7
- package/dist/autoconsent.extra.esm.js +15 -7
- package/dist/autoconsent.playwright.js +15 -7
- package/dist/autoconsent.standalone.js +4138 -0
- package/dist/types/cmps/trustarc-top.d.ts +1 -1
- package/dist/types/eval-handler.d.ts +3 -3
- package/lib/cmps/conversant.ts +7 -4
- package/lib/cmps/trustarc-top.ts +1 -1
- package/lib/cmps/uniconsent.ts +4 -4
- package/lib/eval-handler.ts +6 -3
- package/lib/utils.ts +11 -5
- package/package.json +1 -1
- package/rules/build.ts +4 -0
- package/rules/rule-index-builder.ts +63 -0
- package/rules/rule-index.json +1 -0
- package/standalone/content.ts +103 -0
|
@@ -441,6 +441,9 @@
|
|
|
441
441
|
sendContentMessage: null
|
|
442
442
|
};
|
|
443
443
|
function requestEval(code, snippetId) {
|
|
444
|
+
if (!evalState.sendContentMessage) {
|
|
445
|
+
return Promise.reject(new Error("AutoConsent is not initialized yet"));
|
|
446
|
+
}
|
|
444
447
|
const id = getRandomID();
|
|
445
448
|
evalState.sendContentMessage({
|
|
446
449
|
type: "eval",
|
|
@@ -743,12 +746,13 @@
|
|
|
743
746
|
}
|
|
744
747
|
}
|
|
745
748
|
function highlightNode(node) {
|
|
749
|
+
const highlightedNode = node;
|
|
746
750
|
if (!node.style) return;
|
|
747
|
-
if (
|
|
751
|
+
if (highlightedNode.__oldStyles !== void 0) {
|
|
748
752
|
return;
|
|
749
753
|
}
|
|
750
754
|
if (node.hasAttribute("style")) {
|
|
751
|
-
|
|
755
|
+
highlightedNode.__oldStyles = node.style.cssText;
|
|
752
756
|
}
|
|
753
757
|
node.style.animation = "pulsate .5s infinite";
|
|
754
758
|
node.style.outline = "solid red";
|
|
@@ -776,10 +780,11 @@
|
|
|
776
780
|
document.head.appendChild(styleTag);
|
|
777
781
|
}
|
|
778
782
|
function unhighlightNode(node) {
|
|
783
|
+
const highlightedNode = node;
|
|
779
784
|
if (!node.style || !node.hasAttribute("style")) return;
|
|
780
|
-
if (
|
|
781
|
-
node.style.cssText =
|
|
782
|
-
delete
|
|
785
|
+
if (highlightedNode.__oldStyles !== void 0) {
|
|
786
|
+
node.style.cssText = highlightedNode.__oldStyles;
|
|
787
|
+
delete highlightedNode.__oldStyles;
|
|
783
788
|
} else {
|
|
784
789
|
node.removeAttribute("style");
|
|
785
790
|
}
|
|
@@ -2825,7 +2830,7 @@
|
|
|
2825
2830
|
async optOut() {
|
|
2826
2831
|
await this.waitForElement(".unic button", 1e3);
|
|
2827
2832
|
document.querySelectorAll(".unic button").forEach((button) => {
|
|
2828
|
-
const text = button.textContent;
|
|
2833
|
+
const text = button.textContent || "";
|
|
2829
2834
|
if (text.includes("Manage Options") || text.includes("Optionen verwalten")) {
|
|
2830
2835
|
button.click();
|
|
2831
2836
|
}
|
|
@@ -2838,7 +2843,7 @@
|
|
|
2838
2843
|
}
|
|
2839
2844
|
});
|
|
2840
2845
|
for (const b of document.querySelectorAll(".unic button")) {
|
|
2841
|
-
const text = b.textContent;
|
|
2846
|
+
const text = b.textContent || "";
|
|
2842
2847
|
for (const pattern of ["Confirm Choices", "Save Choices", "Auswahl speichern"]) {
|
|
2843
2848
|
if (text.includes(pattern)) {
|
|
2844
2849
|
b.click();
|
|
@@ -2895,6 +2900,9 @@
|
|
|
2895
2900
|
item.querySelector(".cmp-accordion-item-title").click();
|
|
2896
2901
|
await waitFor(() => !!item.querySelector(".cmp-accordion-item-content.cmp-active"), 10, 50);
|
|
2897
2902
|
const content = item.querySelector(".cmp-accordion-item-content.cmp-active");
|
|
2903
|
+
if (!content) {
|
|
2904
|
+
return false;
|
|
2905
|
+
}
|
|
2898
2906
|
content.querySelectorAll(".cmp-toggle-actions .cmp-toggle-deny:not(.cmp-toggle-deny--active)").forEach((e) => e.click());
|
|
2899
2907
|
content.querySelectorAll(".cmp-toggle-actions .cmp-toggle-checkbox:not(.cmp-toggle-checkbox--active)").forEach((e) => e.click());
|
|
2900
2908
|
}
|