@duckduckgo/autoconsent 16.8.0 → 16.9.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 +26 -0
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +45 -41
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rule-index.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +45 -41
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rule-index.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +45 -41
- package/dist/autoconsent.esm.js +45 -41
- package/dist/autoconsent.playwright.js +45 -41
- package/dist/autoconsent.standalone.js +46 -42
- package/lib/heuristic-patterns.ts +40 -40
- package/lib/heuristics.ts +7 -1
- package/package.json +1 -1
- package/rules/autoconsent/aliexpress.json +21 -14
- package/rules/autoconsent/datagrail.json +90 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/datagrail.spec.ts +13 -0
- package/tests-wtr/heuristics/heuristics-utils.test.ts +12 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests('datagrail', [
|
|
4
|
+
// dg-left, only accept_all + open_layer visible (exercises the customize + reject fallback)
|
|
5
|
+
'https://konghq.com/',
|
|
6
|
+
// dg-left, direct reject_all button ("Accept Essentials Only" label)
|
|
7
|
+
'https://www.earnin.com/',
|
|
8
|
+
// dg-left, direct reject_all with "Reject All Cookies" text
|
|
9
|
+
'https://www.getmyperks.com/',
|
|
10
|
+
// dg-bottom position variant
|
|
11
|
+
'https://kindthread.com/',
|
|
12
|
+
// 'https://www.topps.com/', // cloudflare botwall
|
|
13
|
+
]);
|
|
@@ -47,6 +47,18 @@ describe('checkHeuristicPatterns', () => {
|
|
|
47
47
|
expect(patterns).to.have.length(0);
|
|
48
48
|
expect(snippets).to.have.length(0);
|
|
49
49
|
});
|
|
50
|
+
|
|
51
|
+
it('handles non-global regex with optional capture groups without throwing', () => {
|
|
52
|
+
// Regex from heuristic-patterns.ts (Polish) that has optional capture groups and
|
|
53
|
+
// no `g` flag. `String.prototype.match` returns `undefined` entries for optional
|
|
54
|
+
// groups that did not match, which used to crash the caller with a TypeError.
|
|
55
|
+
const pattern = /(używamy|stosujemy)( są)?.{0,20} plik(i|ów|ach) cookie/i;
|
|
56
|
+
const { patterns, snippets } = checkHeuristicPatterns('Używamy plików cookie i innych technologii', [pattern]);
|
|
57
|
+
|
|
58
|
+
expect(patterns.length).to.be.greaterThan(0);
|
|
59
|
+
expect(snippets.length).to.be.greaterThan(0);
|
|
60
|
+
expect(snippets.every((s) => typeof s === 'string')).to.be.true;
|
|
61
|
+
});
|
|
50
62
|
});
|
|
51
63
|
|
|
52
64
|
describe('cleanButtonText', () => {
|