@duckduckgo/autoconsent 16.45.0 → 16.47.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 +6 -0
- package/.github/labeler.yml +1 -1
- package/.github/workflows/release-labels.yml +19 -11
- package/CHANGELOG.md +51 -0
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +5 -3
- 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 +5 -3
- 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 +5 -3
- package/dist/autoconsent.esm.js +5 -3
- package/dist/autoconsent.playwright.js +5 -3
- package/dist/autoconsent.standalone.js +6 -4
- package/lib/encoding.ts +1 -8
- package/lib/heuristic-patterns.ts +1 -1
- package/lib/messages.ts +1 -6
- package/lib/web.ts +5 -4
- package/package.json +6 -6
- package/playwright/runner.ts +13 -0
- package/rules/autoconsent/controlgame.json +12 -0
- package/rules/autoconsent/cookieyes.json +3 -1
- package/rules/autoconsent/cookiez.json +9 -0
- package/rules/autoconsent/cuvva.com.json +55 -0
- package/rules/autoconsent/dalecarnegie.json +44 -0
- package/rules/autoconsent/fanatics.json +9 -0
- package/rules/autoconsent/jpmorgan-chase.json +10 -0
- package/rules/autoconsent/lego.json +26 -0
- package/rules/autoconsent/privacy-area.json +56 -0
- package/rules/autoconsent/securiti-gpc-flyout.json +22 -0
- package/rules/autoconsent/speciesplus.json +10 -0
- package/rules/autoconsent/squarespace-cookie-banner.json +24 -1
- package/rules/autoconsent/ziptozipmoving.json +44 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/controlgame.spec.ts +3 -0
- package/tests/cookieyes.spec.ts +2 -0
- package/tests/cookiez.spec.ts +12 -0
- package/tests/cuvva.com.spec.ts +4 -0
- package/tests/dalecarnegie.spec.ts +3 -0
- package/tests/fanatics.spec.ts +9 -0
- package/tests/jpmorgan-chase.spec.ts +8 -0
- package/tests/lego.spec.ts +8 -0
- package/tests/privacy-area.spec.ts +9 -0
- package/tests/securiti-gpc-flyout.spec.ts +21 -0
- package/tests/speciesplus.spec.ts +3 -0
- package/tests/squarespace-cookie-banner.spec.ts +8 -1
- package/tests/ziptozipmoving.spec.ts +5 -0
- package/tests-wtr/heuristics/heuristics-utils.test.ts +6 -0
- package/tests-wtr/lifecycle/find-cmp.ts +13 -0
- package/tsconfig.build.json +1 -0
- package/tsconfig.json +2 -1
package/tests/cookieyes.spec.ts
CHANGED
|
@@ -10,4 +10,6 @@ generateCMPTests('cookieyes', [
|
|
|
10
10
|
// CCPA "Do Not Share My Personal Information" variant (US visitors only)
|
|
11
11
|
'https://www.quantamagazine.org/at-17-hannah-cairo-solved-a-major-math-mystery-20250801/',
|
|
12
12
|
'https://taxfoundation.org/',
|
|
13
|
+
// classic bar variant with preference center that renders no category toggles
|
|
14
|
+
'https://www.langoly.com/french-learning-apps/',
|
|
13
15
|
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests(
|
|
4
|
+
'cookiez',
|
|
5
|
+
[
|
|
6
|
+
'https://mandys.ca/en/locations/old-port/',
|
|
7
|
+
'https://parama.ca/',
|
|
8
|
+
'https://lateinamerikanische-tage.de/',
|
|
9
|
+
'https://www.prismmarketing.com/',
|
|
10
|
+
],
|
|
11
|
+
{},
|
|
12
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
// the homepage puts an age gate in front of the modal, so test pages that skip the gate
|
|
4
|
+
generateCMPTests('lego', [
|
|
5
|
+
'https://www.lego.com/en-us/legal/notices-and-policies/privacy-policy',
|
|
6
|
+
'https://www.lego.com/en-gb/legal/notices-and-policies/privacy-policy',
|
|
7
|
+
'https://www.lego.com/de-de/legal/notices-and-policies/privacy-policy',
|
|
8
|
+
]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests('privacy-area', [
|
|
4
|
+
'https://www.yccable.com/products/oem-cables/usb-c-cable-assemblies/',
|
|
5
|
+
'https://www.teamgroupinc.com/en/',
|
|
6
|
+
'https://www.posiflex.com/',
|
|
7
|
+
'https://www.energyfocus.com/',
|
|
8
|
+
'https://www.caesarpark.com.tw/',
|
|
9
|
+
]);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
// Securiti shows the GPC flyout only to browsers that send the GPC signal.
|
|
4
|
+
generateCMPTests(
|
|
5
|
+
'securiti-gpc-flyout',
|
|
6
|
+
[
|
|
7
|
+
'https://www.newportbrass.com/products/kitchen/pull-down-faucets/',
|
|
8
|
+
'https://www.masco.com/',
|
|
9
|
+
'https://www.rollins.com/',
|
|
10
|
+
'https://www.hotspring.com/',
|
|
11
|
+
// flyout variant with a "Hide the banner" button
|
|
12
|
+
'https://www.tollbrothers.com/',
|
|
13
|
+
],
|
|
14
|
+
{ gpc: true },
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
// blocks visitors from Japan
|
|
18
|
+
generateCMPTests('securiti-gpc-flyout', ['https://www.campingworld.com/'], {
|
|
19
|
+
gpc: true,
|
|
20
|
+
skipRegions: ['JP'],
|
|
21
|
+
});
|
|
@@ -2,7 +2,14 @@ import generateCMPTests from '../playwright/runner';
|
|
|
2
2
|
|
|
3
3
|
generateCMPTests(
|
|
4
4
|
'squarespace-cookie-banner',
|
|
5
|
-
[
|
|
5
|
+
[
|
|
6
|
+
'https://insidethesquare.co/',
|
|
7
|
+
'https://www.urallawoolroom.com.au/',
|
|
8
|
+
'https://www.davidbowie.com/',
|
|
9
|
+
'https://www.thecorneroffice.uk/',
|
|
10
|
+
'https://www.theawkwardyeti.com/',
|
|
11
|
+
'https://www.radiotopia.fm/',
|
|
12
|
+
],
|
|
6
13
|
{
|
|
7
14
|
skipRegions: ['US'],
|
|
8
15
|
},
|
|
@@ -62,6 +62,12 @@ describe('checkHeuristicPatterns', () => {
|
|
|
62
62
|
expect(snippets.every((s) => typeof s === 'string')).to.be.true;
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
+
it('detects essential cookie notices', () => {
|
|
66
|
+
const { patterns } = checkHeuristicPatterns('We use essential cookies for site functionality and optional cookies for analytics.');
|
|
67
|
+
|
|
68
|
+
expect(patterns.length).to.be.greaterThan(0);
|
|
69
|
+
});
|
|
70
|
+
|
|
65
71
|
it('detects website cookie experience notices', () => {
|
|
66
72
|
const { patterns, snippets } = checkHeuristicPatterns(
|
|
67
73
|
'The Algonquin College website uses cookies to enhance your browsing experience.',
|
|
@@ -217,5 +217,18 @@ describe('Autoconsent.findCmp', () => {
|
|
|
217
217
|
expect(found).to.have.length(1);
|
|
218
218
|
expect(found[0].name).to.equal('HEURISTIC-TIER2');
|
|
219
219
|
});
|
|
220
|
+
|
|
221
|
+
it('does not wait for a DOM mutation after an attempt that skipped the heuristic', async function () {
|
|
222
|
+
this.timeout(10000);
|
|
223
|
+
// the next attempt is odd, so it skips the heuristic; the popup is already shown and the page stays quiet
|
|
224
|
+
autoconsent.state.findCmpAttempts = 2;
|
|
225
|
+
|
|
226
|
+
const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), 5000));
|
|
227
|
+
const found = await Promise.race([autoconsent.findCmp(1), timeout]);
|
|
228
|
+
|
|
229
|
+
expect(found, 'detection is stuck waiting for a DOM mutation').to.not.equal(null);
|
|
230
|
+
expect(found).to.have.length(1);
|
|
231
|
+
expect(found![0].name).to.equal('HEURISTIC-REJECT');
|
|
232
|
+
});
|
|
220
233
|
});
|
|
221
234
|
});
|
package/tsconfig.build.json
CHANGED