@duckduckgo/autoconsent 16.7.0 → 16.8.1
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 +32 -0
- package/dist/addon-firefox/background.bundle.js +1 -1
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +242 -810
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/popup.bundle.js +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +1 -1
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +242 -810
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/popup.bundle.js +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +242 -810
- package/dist/autoconsent.esm.js +242 -810
- package/dist/autoconsent.playwright.js +242 -810
- package/dist/autoconsent.standalone.js +243 -811
- package/lib/heuristic-patterns.ts +277 -805
- package/lib/heuristics.ts +7 -1
- package/package.json +1 -1
- package/rules/autoconsent/aliexpress.json +21 -14
- package/rules/compact-rules.json +1 -1
- package/rules/rules.json +1 -1
- package/tests-wtr/heuristics/heuristics-utils.test.ts +12 -2
package/lib/heuristics.ts
CHANGED
|
@@ -22,7 +22,13 @@ export function checkHeuristicPatterns(allText: string, detectPatterns = DETECT_
|
|
|
22
22
|
const matches = allText?.match(p);
|
|
23
23
|
if (matches) {
|
|
24
24
|
patterns.push(p.toString());
|
|
25
|
-
|
|
25
|
+
// When a non-global regex has capture groups, `String.prototype.match`
|
|
26
|
+
// returns undefined entries for optional groups that did not match.
|
|
27
|
+
for (const m of matches) {
|
|
28
|
+
if (typeof m === 'string') {
|
|
29
|
+
snippets.push(m.substring(0, 200));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
26
32
|
}
|
|
27
33
|
}
|
|
28
34
|
return { patterns, snippets };
|
package/package.json
CHANGED
|
@@ -12,12 +12,13 @@
|
|
|
12
12
|
],
|
|
13
13
|
"detectPopup": [
|
|
14
14
|
{
|
|
15
|
-
"visible": "#gdpr-new-container,#voyager-gdpr > div"
|
|
15
|
+
"visible": "#gdpr-new-container,#voyager-gdpr > div",
|
|
16
|
+
"check": "any"
|
|
16
17
|
}
|
|
17
18
|
],
|
|
18
19
|
"optIn": [
|
|
19
20
|
{
|
|
20
|
-
"waitForThenClick": "#gdpr-new-container
|
|
21
|
+
"waitForThenClick": "#gdpr-new-container button:last-of-type,#voyager-gdpr > div > div > button:nth-child(1)"
|
|
21
22
|
}
|
|
22
23
|
],
|
|
23
24
|
"optOut": [
|
|
@@ -30,18 +31,24 @@
|
|
|
30
31
|
],
|
|
31
32
|
"else": [
|
|
32
33
|
{
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
"if": { "exists": "#gdpr-new-container button:nth-of-type(3)" },
|
|
35
|
+
"then": [
|
|
36
|
+
{
|
|
37
|
+
"waitForThenClick": "#gdpr-new-container button:nth-of-type(2)"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"else": [
|
|
41
|
+
{
|
|
42
|
+
"waitForThenClick": "#gdpr-new-container button:first-of-type"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"waitForVisible": "#voyager-gdpr-2025",
|
|
46
|
+
"timeout": 5000
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"waitForThenClick": "#voyager-gdpr-2025 button:last-of-type"
|
|
50
|
+
}
|
|
51
|
+
]
|
|
45
52
|
}
|
|
46
53
|
]
|
|
47
54
|
}
|