@duckduckgo/autoconsent 16.49.0 → 16.50.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/workflows/release-labels.yml +2 -6
- package/CHANGELOG.md +41 -0
- package/dist/addon-firefox/background.bundle.js +4 -1
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +20 -6
- 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/background.bundle.js +4 -1
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +20 -6
- 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 +20 -6
- package/dist/autoconsent.esm.js +20 -6
- package/dist/autoconsent.playwright.js +20 -6
- package/dist/autoconsent.standalone.js +21 -7
- package/dist/types/eval-snippets.d.ts +2 -0
- package/lib/eval-snippets.ts +4 -0
- package/lib/heuristic-patterns.ts +16 -3
- package/package.json +1 -1
- package/rules/autoconsent/amazon-hiring.json +16 -0
- package/rules/autoconsent/avada-cookie-consent.json +43 -0
- package/rules/autoconsent/axeptio.json +17 -4
- package/rules/autoconsent/bigcrunch.json +39 -0
- package/rules/autoconsent/bricklink.json +33 -0
- package/rules/autoconsent/ceneo.json +9 -0
- package/rules/autoconsent/conjointly.json +43 -0
- package/rules/autoconsent/dhbbank.json +13 -0
- package/rules/autoconsent/ee-consent-notice.json +40 -0
- package/rules/autoconsent/fera-cookies.json +67 -0
- package/rules/autoconsent/la7-cmp.json +30 -0
- package/rules/autoconsent/laravel-cookie-consent.json +45 -0
- package/rules/autoconsent/legislation-gov-uk.json +43 -0
- package/rules/autoconsent/mackeeper.json +34 -0
- package/rules/autoconsent/ndl-go-jp.json +35 -0
- package/rules/autoconsent/paypal-us.json +3 -3
- package/rules/autoconsent/paypal.json +5 -2
- package/rules/autoconsent/texas-instruments.json +17 -0
- package/rules/autoconsent/thegrandyork.json +46 -0
- package/rules/autoconsent/thenounproject.json +61 -0
- package/rules/autoconsent/toyota.json +16 -5
- package/rules/autoconsent/uft-cookie-notice.json +15 -0
- package/rules/autoconsent/wbd-legal-terms.json +32 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/amazon-hiring.spec.ts +3 -0
- package/tests/avada-cookie-consent.spec.ts +9 -0
- package/tests/axeptio.spec.ts +8 -4
- package/tests/bigcrunch.spec.ts +16 -0
- package/tests/bricklink.spec.ts +3 -0
- package/tests/ceneo.spec.ts +3 -0
- package/tests/conjointly.spec.ts +3 -0
- package/tests/dhbbank.spec.ts +6 -0
- package/tests/ee-consent-notice.spec.ts +9 -0
- package/tests/fera-cookies.spec.ts +6 -0
- package/tests/la7-cmp.spec.ts +6 -0
- package/tests/laravel-cookie-consent.spec.ts +10 -0
- package/tests/legislation-gov-uk.spec.ts +3 -0
- package/tests/mackeeper.spec.ts +3 -0
- package/tests/ndl-go-jp.spec.ts +8 -0
- package/tests/paypal-us.spec.ts +2 -3
- package/tests/texas-instruments.spec.ts +3 -0
- package/tests/thegrandyork.spec.ts +3 -0
- package/tests/thenounproject.spec.ts +3 -0
- package/tests/uft-cookie-notice.spec.ts +3 -0
- package/tests/wbd-legal-terms.spec.ts +18 -0
- package/tests-wtr/heuristics/heuristics-utils.test.ts +55 -0
- package/rules/autoconsent/paypal-cookieprefs.json +0 -29
- package/tests/paypal-cookieprefs.spec.ts +0 -7
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests('avada-cookie-consent', [
|
|
4
|
+
'https://www.nativeunion.com/products/belt-cable-usb-c-to-usb-c',
|
|
5
|
+
'https://www.marinbikes.com/',
|
|
6
|
+
'https://www.simplemodern.com/',
|
|
7
|
+
// Deny button opens the preferences popup
|
|
8
|
+
'https://www.outdoortechnology.com/',
|
|
9
|
+
]);
|
package/tests/axeptio.spec.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import generateCMPTests from '../playwright/runner';
|
|
2
2
|
|
|
3
3
|
generateCMPTests('axeptio', [
|
|
4
|
-
'https://
|
|
5
|
-
'https://www.
|
|
6
|
-
'https://
|
|
7
|
-
'https://lahalledesgourmets.com/pages/angelina',
|
|
4
|
+
'https://docs.mistral.ai/',
|
|
5
|
+
'https://www.prestashop-project.org/',
|
|
6
|
+
'https://www.spareka.fr/',
|
|
8
7
|
'https://www.narbonneaccessoires.fr/fr-fr/',
|
|
9
8
|
]);
|
|
9
|
+
|
|
10
|
+
// Step-based widget: "Close" rejects, "Accept all" only advances to the next step
|
|
11
|
+
generateCMPTests('axeptio', ['https://mistral.ai/pricing', 'https://mistral.ai/news/le-chat-dives-deep'], {
|
|
12
|
+
testOptIn: false,
|
|
13
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests(
|
|
4
|
+
'bigcrunch',
|
|
5
|
+
[
|
|
6
|
+
'https://tvtropes.org/',
|
|
7
|
+
'https://www.mlbtraderumors.com/',
|
|
8
|
+
'https://www.alternet.org/',
|
|
9
|
+
'https://attackofthefanboy.com/',
|
|
10
|
+
'https://www.hoopsrumors.com/',
|
|
11
|
+
'https://crooksandliars.com/',
|
|
12
|
+
],
|
|
13
|
+
{
|
|
14
|
+
skipRegions: ['US'],
|
|
15
|
+
},
|
|
16
|
+
);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
// rejecting reloads the page, which interrupts the self-test
|
|
4
|
+
generateCMPTests('dhbbank', ['https://www.dhbbank.de/', 'https://www.dhbbank.nl/', 'https://www.dhbbank.com/', 'https://www.dhbbank.be/'], {
|
|
5
|
+
testSelfTest: false,
|
|
6
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests('ee-consent-notice', [
|
|
4
|
+
'https://bryantpark.org/activities/category/winter-village',
|
|
5
|
+
'https://assuredguaranty.com/',
|
|
6
|
+
'https://www.janorth.org/',
|
|
7
|
+
'https://bellegrove.org/',
|
|
8
|
+
'https://artsmn.org/',
|
|
9
|
+
]);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests('fera-cookies', [
|
|
4
|
+
'https://planthealthportal.defra.gov.uk/trade/imports/imports-from-the-eu/bcpscps/faqs-for-animal-and-plant-health-agencies-apha-operational-hours/',
|
|
5
|
+
'https://www.cropmonitor.co.uk/',
|
|
6
|
+
]);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
// the site reloads the page after opt-out, so the self-test cannot run in the original context
|
|
4
|
+
generateCMPTests('la7-cmp', ['https://www.la7.it/', 'https://tg.la7.it/', 'https://www.sedanoallegro.it/', 'https://tv.torinofc.it/'], {
|
|
5
|
+
testSelfTest: false,
|
|
6
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests('laravel-cookie-consent', [
|
|
4
|
+
'https://podstatus.com/',
|
|
5
|
+
'https://www.arzneimittel-datenbank.de/',
|
|
6
|
+
'https://www.opendag.no/',
|
|
7
|
+
'https://teatenerife.es/',
|
|
8
|
+
'https://radacini.ro/',
|
|
9
|
+
'https://30cc.be/',
|
|
10
|
+
]);
|
package/tests/paypal-us.spec.ts
CHANGED
|
@@ -2,6 +2,5 @@ import generateCMPTests from '../playwright/runner';
|
|
|
2
2
|
|
|
3
3
|
generateCMPTests('paypal-us', ['https://www.paypal.com/us/home'], {});
|
|
4
4
|
|
|
5
|
-
// This banner variant has no "Decline" button, so
|
|
6
|
-
|
|
7
|
-
generateCMPTests('paypal-us', ['https://www.paypal.com/ca/home'], { expectedRuns: 3 });
|
|
5
|
+
// This banner variant has no "Decline" button, so the rule hides it and no choice is stored.
|
|
6
|
+
generateCMPTests('paypal-us', ['https://www.paypal.com/ca/home'], { testSelfTest: false });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
generateCMPTests(
|
|
4
|
+
'wbd-legal-terms',
|
|
5
|
+
[
|
|
6
|
+
'https://www.foodnetwork.com/how-to/packages/shopping/product-reviews/best-food-processors',
|
|
7
|
+
'https://www.hgtv.com/',
|
|
8
|
+
'https://www.golfdigest.com/',
|
|
9
|
+
'https://www.tlc.com/',
|
|
10
|
+
'https://www.discovery.com/',
|
|
11
|
+
],
|
|
12
|
+
{
|
|
13
|
+
// shown only in some US states
|
|
14
|
+
onlyRegions: ['US'],
|
|
15
|
+
testOptIn: false,
|
|
16
|
+
testSelfTest: false,
|
|
17
|
+
},
|
|
18
|
+
);
|
|
@@ -78,6 +78,27 @@ describe('checkHeuristicPatterns', () => {
|
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
+
describe('checkHeuristicPatterns with a qualifier before "cookies"', () => {
|
|
82
|
+
it('detects "we use <qualifier> cookies" notices', () => {
|
|
83
|
+
const texts = [
|
|
84
|
+
// openrouter.ai
|
|
85
|
+
'Cookie Preferences We use essential cookies for site functionality and optional cookies for analytics.',
|
|
86
|
+
'We use optional cookies to measure traffic',
|
|
87
|
+
'We use analytics cookies and similar technologies',
|
|
88
|
+
'We serve necessary cookies only',
|
|
89
|
+
];
|
|
90
|
+
for (const text of texts) {
|
|
91
|
+
expect(checkHeuristicPatterns(text).patterns.length, text).to.be.greaterThan(0);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('does not match when "cookies" is further away', () => {
|
|
96
|
+
expect(checkHeuristicPatterns('We use the best chocolate in our cookies', [/we use(?: \w+)? cookies/gi]).patterns).to.have.length(
|
|
97
|
+
0,
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
81
102
|
describe('checkHeuristicPatterns with Russian popups', () => {
|
|
82
103
|
it('detects Russian cookie notices', () => {
|
|
83
104
|
const texts = [
|
|
@@ -103,6 +124,23 @@ describe('checkHeuristicPatterns with Russian popups', () => {
|
|
|
103
124
|
});
|
|
104
125
|
});
|
|
105
126
|
|
|
127
|
+
describe('checkHeuristicPatterns with Japanese popups', () => {
|
|
128
|
+
it('detects Japanese cookie notices', () => {
|
|
129
|
+
const texts = [
|
|
130
|
+
'当サイトはサービス改善のためCookieを使用しています。',
|
|
131
|
+
'当ウェブサイトではクッキーを利用しています',
|
|
132
|
+
'このサイトはクッキー(Cookie)を使用しています',
|
|
133
|
+
];
|
|
134
|
+
for (const text of texts) {
|
|
135
|
+
expect(checkHeuristicPatterns(text).patterns.length, text).to.be.greaterThan(0);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it('does not detect unrelated Japanese text', () => {
|
|
140
|
+
expect(checkHeuristicPatterns('全国の旧車イベント情報を集約しています').patterns).to.have.length(0);
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
|
|
106
144
|
describe('isExcludedPopup', () => {
|
|
107
145
|
it('flags doublelist-style age verification popups', () => {
|
|
108
146
|
// Real-world text from the doublelist.com age gate (listings page)
|
|
@@ -188,6 +226,12 @@ describe('classifyButtonTextRegex', () => {
|
|
|
188
226
|
expect(classifyButtonTextRegex('I do not accept the use of cookies')).to.equal('reject');
|
|
189
227
|
});
|
|
190
228
|
|
|
229
|
+
it('matches CCPA "do not sell/share" variants', () => {
|
|
230
|
+
expect(classifyButtonTextRegex('Do Not Sell or Share My Personal Information')).to.equal('reject');
|
|
231
|
+
expect(classifyButtonTextRegex('Do Not Share My Personal Information')).to.equal('reject');
|
|
232
|
+
expect(classifyButtonTextRegex('Do not share my data')).to.equal('reject');
|
|
233
|
+
});
|
|
234
|
+
|
|
191
235
|
it('matches German continue-without-accepting variants', () => {
|
|
192
236
|
expect(classifyButtonTextRegex('Ohne Akzeptieren fortfahren')).to.equal('reject');
|
|
193
237
|
expect(classifyButtonTextRegex('Ohne zu akzeptieren fortfahren')).to.equal('reject');
|
|
@@ -229,6 +273,17 @@ describe('classifyButtonTextRegex', () => {
|
|
|
229
273
|
expect(classifyButtonTextRegex('Не принимаю')).to.equal('reject');
|
|
230
274
|
});
|
|
231
275
|
|
|
276
|
+
it('matches Japanese reject buttons', () => {
|
|
277
|
+
expect(classifyButtonTextRegex('拒否')).to.equal('reject');
|
|
278
|
+
expect(classifyButtonTextRegex('すべて拒否')).to.equal('reject');
|
|
279
|
+
expect(classifyButtonTextRegex('全て拒否する')).to.equal('reject');
|
|
280
|
+
expect(classifyButtonTextRegex('Cookieを拒否')).to.equal('reject');
|
|
281
|
+
expect(classifyButtonTextRegex('同意しない')).to.equal('reject');
|
|
282
|
+
expect(classifyButtonTextRegex('すべて 拒否')).to.equal('reject');
|
|
283
|
+
expect(classifyButtonTextRegex('同意しません')).to.equal('reject');
|
|
284
|
+
expect(classifyButtonTextRegex('同意して続ける')).not.to.equal('reject');
|
|
285
|
+
});
|
|
286
|
+
|
|
232
287
|
it('matches Russian settings buttons', () => {
|
|
233
288
|
expect(classifyButtonTextRegex('Настроить')).to.equal('settings');
|
|
234
289
|
expect(classifyButtonTextRegex('Настройки')).to.equal('settings');
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "paypal-cookieprefs",
|
|
3
|
-
"comment": "Cookie preferences page (.privacy-sheet-content on desktop, #cookiePrefsModal on mobile). Only automate it when we got here from the banner's \"Manage your cookies\" link, which appends a query string; a user who opens the page themselves lands on it without one and must be left free to edit their own preferences.",
|
|
4
|
-
"runContext": { "urlPattern": "^https://www\\.paypal\\.com/myaccount/privacy/cookiePrefs\\?" },
|
|
5
|
-
"prehideSelectors": ["#cookiePrefsModal, .privacy-sheet-content"],
|
|
6
|
-
"detectCmp": [{ "exists": "#cookiePrefsModal #formContent, .privacy-sheet-content #formContent" }],
|
|
7
|
-
"detectPopup": [{ "visible": "#cookiePrefsModal #formContent, .privacy-sheet-content #formContent" }],
|
|
8
|
-
"optIn": [
|
|
9
|
-
{
|
|
10
|
-
"click": "#formContent input[type='checkbox']:not(:checked)",
|
|
11
|
-
"all": true,
|
|
12
|
-
"optional": true
|
|
13
|
-
},
|
|
14
|
-
{ "waitForThenClick": ".cookieAction #submitCookiesBtn", "timeout": 15000 }
|
|
15
|
-
],
|
|
16
|
-
"optOut": [
|
|
17
|
-
{
|
|
18
|
-
"click": "#formContent input[type='checkbox']:checked",
|
|
19
|
-
"all": true,
|
|
20
|
-
"optional": true
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"comment": "In \"manage\" mode the submit button is present but its sticky bar stays hidden, so wait for existence rather than visibility.",
|
|
24
|
-
"waitForThenClick": ".cookieAction #submitCookiesBtn",
|
|
25
|
-
"timeout": 15000
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"test": [{ "wait": 1000 }, { "cookieContains": "type%3Dexplicit" }]
|
|
29
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import generateCMPTests from '../playwright/runner';
|
|
2
|
-
|
|
3
|
-
// Only the banner's "Manage your cookies" link (which appends a locale query string) should be
|
|
4
|
-
// automated. Opening the same page without a query string is a deliberate user visit and is left
|
|
5
|
-
// untouched, so it is not covered here.
|
|
6
|
-
generateCMPTests('paypal-cookieprefs', ['https://www.paypal.com/myaccount/privacy/cookiePrefs?locale=en_US'], {});
|
|
7
|
-
generateCMPTests('paypal-cookieprefs', ['https://www.paypal.com/myaccount/privacy/cookiePrefs?locale=en_US'], { mobile: true });
|