@duckduckgo/autoconsent 18.1.0 → 18.3.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 +131 -0
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +256 -65
- 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 +256 -65
- 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 +256 -65
- package/dist/autoconsent.esm.js +256 -65
- package/dist/autoconsent.playwright.js +256 -65
- package/dist/autoconsent.standalone.js +257 -66
- package/dist/heuristics.cjs.js +264 -67
- package/dist/heuristics.mjs +260 -66
- package/dist/types/heuristic-patterns.d.ts +4 -1
- package/docs/heuristic-detection.md +1 -0
- package/lib/heuristic-literals.ts +90 -16
- package/lib/heuristic-negatives.ts +15 -10
- package/lib/heuristic-patterns.ts +153 -35
- package/package.json +1 -1
- package/rules/autoconsent/aa-cookie-banner.json +2 -2
- package/rules/autoconsent/acconsento.json +45 -0
- package/rules/autoconsent/adaptivemedia.json +30 -0
- package/rules/autoconsent/adeac-jp.json +29 -0
- package/rules/autoconsent/agenziaentrate-geoportale.json +35 -0
- package/rules/autoconsent/alertnotification-alert-bar.json +27 -0
- package/rules/autoconsent/amasty-gdpr-hyva.json +6 -6
- package/rules/autoconsent/appconsent.json +8 -8
- package/rules/autoconsent/askas.json +39 -0
- package/rules/autoconsent/atomstore.json +44 -0
- package/rules/autoconsent/b1ng-cc.json +23 -0
- package/rules/autoconsent/betheme.json +10 -0
- package/rules/autoconsent/bgk-pl.json +18 -0
- package/rules/autoconsent/biblia-online.pl.json +40 -0
- package/rules/autoconsent/bitauto.json +57 -0
- package/rules/autoconsent/blogger-cookie-notice.json +10 -0
- package/rules/autoconsent/brainshare.json +12 -0
- package/rules/autoconsent/brandsforstudents.ch.json +19 -0
- package/rules/autoconsent/bt-com-au.json +13 -0
- package/rules/autoconsent/c-cookie-message.json +9 -0
- package/rules/autoconsent/calclife.net.json +43 -0
- package/rules/autoconsent/casino-guru.json +28 -0
- package/rules/autoconsent/code3-cookies-consent.json +48 -0
- package/rules/autoconsent/complianz-opt-out.json +7 -2
- package/rules/autoconsent/cookie-agree-banner.json +9 -0
- package/rules/autoconsent/cookie-box-notice.json +41 -0
- package/rules/autoconsent/cookie-use-notice.json +12 -0
- package/rules/autoconsent/cookieinfo-zamknij.json +30 -0
- package/rules/autoconsent/cookieinfo.json +1 -1
- package/rules/autoconsent/cookies-and-content-security-policy.json +45 -0
- package/rules/autoconsent/cookiesbanner-preference.json +14 -0
- package/rules/autoconsent/cookiesmodal-pl.json +18 -0
- package/rules/autoconsent/creditunionsa.json +12 -0
- package/rules/autoconsent/cstudios.json +35 -0
- package/rules/autoconsent/dandomain.json +41 -0
- package/rules/autoconsent/datezone.json +22 -0
- package/rules/autoconsent/dfactory-cookie-notice.json +13 -1
- package/rules/autoconsent/didomi.json +7 -1
- package/rules/autoconsent/dlibra.json +32 -0
- package/rules/autoconsent/dnb.json +30 -0
- package/rules/autoconsent/e-file.json +44 -0
- package/rules/autoconsent/erli-pl.json +36 -0
- package/rules/autoconsent/facebook.json +16 -6
- package/rules/autoconsent/fellow-pl.json +16 -0
- package/rules/autoconsent/fn-se.json +17 -0
- package/rules/autoconsent/gdpr-jp-notice.json +25 -0
- package/rules/autoconsent/gdpsystem.json +21 -0
- package/rules/autoconsent/help-ch.json +25 -0
- package/rules/autoconsent/icom-co-jp.json +34 -0
- package/rules/autoconsent/imyfone.json +25 -0
- package/rules/autoconsent/interface-medien-gebaeck.json +33 -0
- package/rules/autoconsent/intermedia-cms-fsi.json +30 -0
- package/rules/autoconsent/invision-guest-terms.json +14 -0
- package/rules/autoconsent/ipkobiznes.pl.json +12 -0
- package/rules/autoconsent/jquery-cookiepolicy.json +30 -0
- package/rules/autoconsent/lieder.net.json +13 -0
- package/rules/autoconsent/loescher.json +44 -0
- package/rules/autoconsent/menti-com.json +37 -0
- package/rules/autoconsent/meowdb.json +65 -0
- package/rules/autoconsent/monex-co-jp.json +34 -0
- package/rules/autoconsent/mos-cudzoziemcy-gov-pl.json +29 -0
- package/rules/autoconsent/nnk-theme-cookie-bar.json +29 -0
- package/rules/autoconsent/no-transit-consent.json +32 -0
- package/rules/autoconsent/nperf.json +33 -0
- package/rules/autoconsent/octoparse.json +33 -0
- package/rules/autoconsent/okayama-kanko-jp.json +31 -0
- package/rules/autoconsent/oko-press.json +23 -0
- package/rules/autoconsent/ometv-pl.json +33 -0
- package/rules/autoconsent/oresundstag.json +40 -0
- package/rules/autoconsent/pfron-gov-pl.json +37 -0
- package/rules/autoconsent/pl-bip-cookies.json +25 -0
- package/rules/autoconsent/prestashop-advanced-cookie-banner.json +49 -0
- package/rules/autoconsent/qudosbank-com-au.json +14 -0
- package/rules/autoconsent/renaud-bray.json +44 -0
- package/rules/autoconsent/roblox-creator-hub.json +48 -0
- package/rules/autoconsent/rws-app.json +13 -0
- package/rules/autoconsent/san-tatsu.json +32 -0
- package/rules/autoconsent/saos-org-pl.json +35 -0
- package/rules/autoconsent/sda-it.json +37 -0
- package/rules/autoconsent/seria-group.json +35 -0
- package/rules/autoconsent/shoper.json +10 -0
- package/rules/autoconsent/shopgold.json +83 -0
- package/rules/autoconsent/shueisha-hpplus.json +27 -0
- package/rules/autoconsent/silver-nu.json +31 -0
- package/rules/autoconsent/soleil-sitevision-cookie-message.json +32 -0
- package/rules/autoconsent/stellantis-psa.json +18 -1
- package/rules/autoconsent/surfshark.json +21 -0
- package/rules/autoconsent/synergy-net-au.json +33 -0
- package/rules/autoconsent/tcl.json +50 -0
- package/rules/autoconsent/teeshoppen.json +42 -0
- package/rules/autoconsent/tuki-cookieterms.json +20 -0
- package/rules/autoconsent/tullys-jp.json +11 -0
- package/rules/autoconsent/weblegal.json +10 -0
- package/rules/autoconsent/weblication.json +38 -0
- package/rules/autoconsent/worldbank.json +5 -5
- package/rules/autoconsent/wuerth.json +57 -0
- package/rules/autoconsent/x28-privacy-settings.json +18 -0
- package/rules/autoconsent/ynjn.json +34 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/aa-cookie-banner.spec.ts +1 -1
- package/tests/acconsento.spec.ts +8 -0
- package/tests/adaptivemedia.spec.ts +3 -0
- package/tests/adeac-jp.spec.ts +3 -0
- package/tests/agenziaentrate-geoportale.spec.ts +5 -0
- package/tests/alertnotification-alert-bar.spec.ts +11 -0
- package/tests/amasty-gdpr-hyva.spec.ts +1 -0
- package/tests/appconsent.spec.ts +1 -1
- package/tests/askas.spec.ts +9 -0
- package/tests/atomstore.spec.ts +9 -0
- package/tests/b1ng-cc.spec.ts +3 -0
- package/tests/betheme.spec.ts +9 -0
- package/tests/bgk-pl.spec.ts +5 -0
- package/tests/biblia-online.pl.spec.ts +3 -0
- package/tests/bitauto.spec.ts +3 -0
- package/tests/blogger-cookie-notice.spec.ts +9 -0
- package/tests/brainshare.spec.ts +3 -0
- package/tests/brandsforstudents.ch.spec.ts +6 -0
- package/tests/bt-com-au.spec.ts +3 -0
- package/tests/c-cookie-message.spec.ts +9 -0
- package/tests/calclife.net.spec.ts +3 -0
- package/tests/casino-guru.spec.ts +15 -0
- package/tests/code3-cookies-consent.spec.ts +8 -0
- package/tests/complianz-opt-out.spec.ts +13 -3
- package/tests/cookie-agree-banner.spec.ts +3 -0
- package/tests/cookie-box-notice.spec.ts +10 -0
- package/tests/cookie-use-notice.spec.ts +6 -0
- package/tests/cookieinfo-zamknij.spec.ts +3 -0
- package/tests/cookies-and-content-security-policy.spec.ts +16 -0
- package/tests/cookiesbanner-preference.spec.ts +8 -0
- package/tests/cookiesmodal-pl.spec.ts +3 -0
- package/tests/creditunionsa.spec.ts +3 -0
- package/tests/cstudios.spec.ts +3 -0
- package/tests/dandomain.spec.ts +18 -0
- package/tests/datezone.spec.ts +3 -0
- package/tests/didomi.spec.ts +8 -0
- package/tests/dlibra.spec.ts +8 -0
- package/tests/dnb.spec.ts +5 -0
- package/tests/e-file.spec.ts +9 -0
- package/tests/erli-pl.spec.ts +4 -0
- package/tests/facebook.spec.ts +1 -1
- package/tests/fellow-pl.spec.ts +5 -0
- package/tests/fn-se.spec.ts +3 -0
- package/tests/gdpr-jp-notice.spec.ts +3 -0
- package/tests/gdpsystem.spec.ts +3 -0
- package/tests/gravito.spec.ts +6 -0
- package/tests/help-ch.spec.ts +14 -0
- package/tests/icom-co-jp.spec.ts +3 -0
- package/tests/imyfone.spec.ts +9 -0
- package/tests/interface-medien-gebaeck.spec.ts +13 -0
- package/tests/intermedia-cms-fsi.spec.ts +8 -0
- package/tests/invision-guest-terms.spec.ts +10 -0
- package/tests/ipkobiznes.pl.spec.ts +3 -0
- package/tests/jquery-cookiepolicy.spec.ts +10 -0
- package/tests/lieder.net.spec.ts +3 -0
- package/tests/loescher.spec.ts +5 -0
- package/tests/menti-com.spec.ts +3 -0
- package/tests/meowdb.spec.ts +3 -0
- package/tests/monex-co-jp.spec.ts +3 -0
- package/tests/mos-cudzoziemcy-gov-pl.spec.ts +3 -0
- package/tests/nnk-theme-cookie-bar.spec.ts +3 -0
- package/tests/no-transit-consent.spec.ts +3 -0
- package/tests/nperf.spec.ts +3 -0
- package/tests/octoparse.spec.ts +6 -0
- package/tests/okayama-kanko-jp.spec.ts +3 -0
- package/tests/oko-press.spec.ts +3 -0
- package/tests/ometv-pl.spec.ts +4 -0
- package/tests/oresundstag.spec.ts +3 -0
- package/tests/pfron-gov-pl.spec.ts +3 -0
- package/tests/pl-bip-cookies.spec.ts +3 -0
- package/tests/prestashop-advanced-cookie-banner.spec.ts +9 -0
- package/tests/qudosbank-com-au.spec.ts +3 -0
- package/tests/renaud-bray.spec.ts +5 -0
- package/tests/roblox-creator-hub.spec.ts +5 -0
- package/tests/rws-app.spec.ts +15 -0
- package/tests/san-tatsu.spec.ts +3 -0
- package/tests/saos-org-pl.spec.ts +3 -0
- package/tests/sda-it.spec.ts +7 -0
- package/tests/seria-group.spec.ts +3 -0
- package/tests/shoper.spec.ts +3 -0
- package/tests/shopgold.spec.ts +3 -0
- package/tests/shueisha-hpplus.spec.ts +3 -0
- package/tests/silver-nu.spec.ts +3 -0
- package/tests/soleil-sitevision-cookie-message.spec.ts +8 -0
- package/tests/stellantis-psa.spec.ts +2 -0
- package/tests/surfshark.spec.ts +3 -0
- package/tests/synergy-net-au.spec.ts +8 -0
- package/tests/tcl.spec.ts +9 -0
- package/tests/teeshoppen.spec.ts +7 -0
- package/tests/tuki-cookieterms.spec.ts +8 -0
- package/tests/tullys-jp.spec.ts +3 -0
- package/tests/weblegal.spec.ts +8 -0
- package/tests/weblication.spec.ts +9 -0
- package/tests/worldbank.spec.ts +1 -0
- package/tests/wuerth.spec.ts +8 -0
- package/tests/x28-privacy-settings.spec.ts +4 -0
- package/tests/ynjn.spec.ts +3 -0
- package/tests-wtr/heuristics/heuristics-utils.test.ts +356 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
// the site reloads the page after a consent choice, so the self-test message is lost
|
|
4
|
+
generateCMPTests(
|
|
5
|
+
'rws-app',
|
|
6
|
+
[
|
|
7
|
+
'https://mollerbil.se/',
|
|
8
|
+
'https://motorhalland.se/',
|
|
9
|
+
'https://nordemansbil.se/',
|
|
10
|
+
'https://jlbilar.se/',
|
|
11
|
+
'https://frontbilar.se/',
|
|
12
|
+
'https://bilteam.com/',
|
|
13
|
+
],
|
|
14
|
+
{ testSelfTest: false },
|
|
15
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import generateCMPTests from '../playwright/runner';
|
|
2
|
+
|
|
3
|
+
const urls = ['https://www.synergy.net.au/'];
|
|
4
|
+
// the site returns an error page to visitors from some regions, e.g. US
|
|
5
|
+
const onlyRegions = ['AU', 'GB', 'DE'];
|
|
6
|
+
|
|
7
|
+
generateCMPTests('synergy-net-au', urls, { mobile: true, onlyRegions });
|
|
8
|
+
generateCMPTests('synergy-net-au', urls, { mobile: false, onlyRegions });
|
package/tests/worldbank.spec.ts
CHANGED
|
@@ -157,6 +157,33 @@ describe('checkHeuristicPatterns with Italian popups', () => {
|
|
|
157
157
|
});
|
|
158
158
|
});
|
|
159
159
|
|
|
160
|
+
describe('checkHeuristicPatterns with French popups', () => {
|
|
161
|
+
it('detects French cookie notices', () => {
|
|
162
|
+
const texts = [
|
|
163
|
+
// change.org
|
|
164
|
+
'Vos paramètres de confidentialité. Nous utilisons nos propres cookies et ceux de tiers. Accepter les cookies Rejeter les cookies non essentiels Gérer les cookies',
|
|
165
|
+
'Nous utilisons nos propres cookies et ceux de tiers',
|
|
166
|
+
];
|
|
167
|
+
for (const text of texts) {
|
|
168
|
+
expect(checkHeuristicPatterns(text).patterns.length, text).to.be.greaterThan(0);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('does not detect unrelated French text', () => {
|
|
173
|
+
const texts = [
|
|
174
|
+
'Rejeter les candidatures incomplètes',
|
|
175
|
+
// "refuser/rejeter les cookies" alone also appears outside consent notices, e.g. browser help
|
|
176
|
+
'Vous pouvez rejeter les cookies dans les paramètres de votre navigateur.',
|
|
177
|
+
'Vous pouvez refuser les cookies dans les paramètres de votre navigateur.',
|
|
178
|
+
// "cookies" more than two words after "nous utilisons"
|
|
179
|
+
'Nous utilisons nos propres recettes pour préparer les cookies.',
|
|
180
|
+
];
|
|
181
|
+
for (const text of texts) {
|
|
182
|
+
expect(checkHeuristicPatterns(text).patterns, text).to.have.length(0);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
160
187
|
describe('checkHeuristicPatterns with Swedish popups', () => {
|
|
161
188
|
it('detects Swedish cookie notices', () => {
|
|
162
189
|
const texts = [
|
|
@@ -223,9 +250,10 @@ describe('checkHeuristicPatterns with inputs and context negatives', () => {
|
|
|
223
250
|
).to.have.length(1);
|
|
224
251
|
});
|
|
225
252
|
|
|
226
|
-
it('does not count "accept all"
|
|
227
|
-
expect(checkHeuristicPatterns('We accept all major credit cards.', 'page').patterns).to.
|
|
228
|
-
expect(checkHeuristicPatterns('
|
|
253
|
+
it('does not count bare "accept all" / "reject all" labels, only labels with the cookie noun', () => {
|
|
254
|
+
expect(checkHeuristicPatterns('We accept all major credit cards.', 'page').patterns).to.have.length(0);
|
|
255
|
+
expect(checkHeuristicPatterns('Accept all\nReject all', 'popup').patterns).to.have.length(0);
|
|
256
|
+
expect(checkHeuristicPatterns('Manage settings\nACCEPT ALL COOKIES', 'popup').patterns).to.include('/accept all cookies/gi');
|
|
229
257
|
});
|
|
230
258
|
|
|
231
259
|
it('drops page matches next to an age gate with a leave button, not next to a consent control', () => {
|
|
@@ -348,10 +376,204 @@ describe('checkHeuristicPatterns with Norwegian popups', () => {
|
|
|
348
376
|
});
|
|
349
377
|
});
|
|
350
378
|
|
|
379
|
+
const detectsPopup = (text: string) => checkHeuristicPatterns(text, 'popup').patterns.length > 0;
|
|
380
|
+
const detectsPage = (text: string) => checkHeuristicPatterns(text, 'page').patterns.length > 0;
|
|
381
|
+
|
|
382
|
+
function expectDetected(texts: string[]) {
|
|
383
|
+
for (const text of texts) {
|
|
384
|
+
expect(detectsPopup(text), text).to.be.true;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
function expectNotDetected(texts: string[]) {
|
|
389
|
+
for (const text of texts) {
|
|
390
|
+
expect(detectsPopup(text), text).to.be.false;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
describe('checkHeuristicPatterns with more English wording', () => {
|
|
395
|
+
it('detects English cookie notices', () => {
|
|
396
|
+
expectDetected([
|
|
397
|
+
'May we also use analytics cookies to help us learn how the site is being used?',
|
|
398
|
+
'We use cookie files to provide users personalized content, additional functions, and to perform the website traffic analysis.',
|
|
399
|
+
'Please can I use cookies to see how the site is used and which of my ads work? Privacy',
|
|
400
|
+
'Welcome! We use third-party tools to collect information about you as you enjoy our site.',
|
|
401
|
+
'We and our advertising partners use cookies for ad measurement, personalised ads and analytics.',
|
|
402
|
+
'By using our site, you acknowledge that you read and understand our Cookie Policy.',
|
|
403
|
+
'By using this website you agree to our use of cookie technology.',
|
|
404
|
+
'Allow analytics cookies? They help us understand how visitors use this website. Your choice does not affect access.',
|
|
405
|
+
'Allow cookies? We use them to measure traffic.',
|
|
406
|
+
'We use a cookie to remember you are 18+ and keep your preferences on this device.',
|
|
407
|
+
]);
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
it('detects consent wording in popups and page text', () => {
|
|
411
|
+
const texts = [
|
|
412
|
+
'We have cookies! Read our privacy policy',
|
|
413
|
+
'No tracking will occur without your consent. You can revoke your consent at any time.',
|
|
414
|
+
'Du kannst deine Einwilligung jederzeit widerrufen.',
|
|
415
|
+
'We use privacy-friendly analytics to see which health guides are most useful. No ads, no profiling.',
|
|
416
|
+
'We use Google Analytics to count page views and monthly active users. It sets a cookie and, when you are signed in, records your account id.',
|
|
417
|
+
'Usiamo Google Analytics per capire come viene usato il sito. Li attiviamo solo con il tuo consenso.',
|
|
418
|
+
];
|
|
419
|
+
for (const text of texts) {
|
|
420
|
+
expect(detectsPopup(text), text).to.be.true;
|
|
421
|
+
expect(detectsPage(text), text).to.be.true;
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
it('needs a consent control near "diese/unsere Webseite ... Cookies" in page text', () => {
|
|
426
|
+
const text =
|
|
427
|
+
'Auf unserer Webseite werden neben den technisch erforderlichen Cookies noch Cookies zur statistischen Auswertung gesetzt.';
|
|
428
|
+
expect(detectsPopup(text)).to.be.true;
|
|
429
|
+
expect(detectsPage(text)).to.be.false;
|
|
430
|
+
expect(detectsPage(`${text}\nAlle akzeptieren\nAblehnen`)).to.be.true;
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
it('does not detect unrelated English text', () => {
|
|
434
|
+
expectNotDetected([
|
|
435
|
+
'We use cookiecutter templates',
|
|
436
|
+
'We use cookie-free analytics',
|
|
437
|
+
'Please allow cookies in your browser settings',
|
|
438
|
+
'We use data analytics tools in our consulting work',
|
|
439
|
+
'We use the best chocolate in our cookies',
|
|
440
|
+
]);
|
|
441
|
+
});
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
describe('checkHeuristicPatterns with more French, German, Dutch, Polish and Russian wording', () => {
|
|
445
|
+
it('detects cookie notices', () => {
|
|
446
|
+
expectDetected([
|
|
447
|
+
"On utilise quelques cookies pour voir ce qui t'aide vraiment à réviser",
|
|
448
|
+
'Nous utilisons certains cookies pour mesurer l’audience',
|
|
449
|
+
'En naviguant sur ce site, vous acceptez les cookies pour améliorer votre expérience.',
|
|
450
|
+
"Des cookies sont utilisés à des fins de mesure, de publicité et d'optimisation. En continuant à utiliser notre site, vous acceptez notre politique de confidentialité.",
|
|
451
|
+
'Cookies werden für Messungen, Werbung und Optimierung verwendet. Durch die weitere Nutzung unserer Website stimmen Sie unserer Datenschutzrichtlinie zu.',
|
|
452
|
+
'Hierfür werden auf Ihrem Gerät Analyse-Cookies mit einer pseudonymen Kennung gespeichert.',
|
|
453
|
+
'Wir setzen Statistik-Cookies und Marketingcookies ein.',
|
|
454
|
+
'Wenn du auf „Einverstanden“ klickst, verarbeiten wir deine Daten und speichern Informationen (z. B. durch Cookies oder andere Identifikatoren) auf deinem Endgerät.',
|
|
455
|
+
'Cookies worden gebruikt voor metingen, advertenties en optimalisatie. Door onze site te blijven gebruiken, gaat u akkoord met ons privacybeleid.',
|
|
456
|
+
'Alles accepteren Keuze opslaan Alleen standaard cookies',
|
|
457
|
+
'Onze cookies geven je de best mogelijke ervaring op onze website. Accepteer ze, of lees onze cookieverklaring.',
|
|
458
|
+
'Informujemy, że niniejsza strona internetowa wykorzystuje pliki „cookies”.',
|
|
459
|
+
'Strona wykorzystuje pliki "cookies" w celach statystycznych.',
|
|
460
|
+
'Обрабатываем cookie, чтобы сделать сайт удобнее. Продолжая использовать сайт, вы соглашаетесь на их обработку.',
|
|
461
|
+
'Сайт обрабатывает пользовательские данные с использованием файлов, сохраняемых в браузере пользователя, в соответствии с Условиями.',
|
|
462
|
+
]);
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
it('does not detect unrelated text', () => {
|
|
466
|
+
expectNotDetected([
|
|
467
|
+
'On utilise du beurre dans nos cookies',
|
|
468
|
+
'Analyse der Marketing-Strategie',
|
|
469
|
+
'Durch die Nutzung unserer Webseite finden Sie schnell die neuesten Tests.',
|
|
470
|
+
]);
|
|
471
|
+
});
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
describe('checkHeuristicPatterns with more Swedish wording', () => {
|
|
475
|
+
it('detects Swedish cookie notices', () => {
|
|
476
|
+
expectDetected([
|
|
477
|
+
'Svenska kraftnät använder kakor (cookies) för att förbättra och anpassa ditt besök på vår webbplats.',
|
|
478
|
+
'Vår hemsida använder cookies och andra spårtekniker.',
|
|
479
|
+
'Vi och våra partners använder nödvändiga och valfria cookies',
|
|
480
|
+
'Dessutom använder vi också cookies för annonsanpassning',
|
|
481
|
+
'Vi på Kjell & Company önskar att ge dig en unik kundupplevelse och för att kunna göra detta använder vi cookies.',
|
|
482
|
+
'Vi sätter inga egna cookies, förutom en sessionskaka om du loggar in.',
|
|
483
|
+
'På den här webbplatsen används kakor.',
|
|
484
|
+
'Kakor används för att webbplatsen ska fungera.',
|
|
485
|
+
'Användning av valfria cookies. Cookies hjälper oss att anpassa din upplevelse.',
|
|
486
|
+
'Genom att surfa vidare godkänner du användningen av kakor',
|
|
487
|
+
'Genom att trycka "Acceptera alla" godkänner du användandet av sådana cookies.',
|
|
488
|
+
'Genom att fortsätta godkänner du att vi sparar kakor',
|
|
489
|
+
'När du accepterar cookies från våra partner kan det innebära att data överförs till länder utanför EU.',
|
|
490
|
+
'Kakor för en bättre upplevelse Med kakor (cookies) kan vi erbjuda dig säker inloggning. Godkänn nödvändiga kakor Godkänn alla kakor',
|
|
491
|
+
'Tillåt alla cookies Endast nödvändiga cookies Cookie-inställningar',
|
|
492
|
+
'Välj nedan vilka cookies du tillåter oss att använda. Acceptera alla Endast nödvändiga',
|
|
493
|
+
'momondo och dess partners vill använda cookies eller liknande teknik för att lagra och/eller komma åt information på och om din enhet',
|
|
494
|
+
'Lagra och/eller få åtkomst till information på en enhet',
|
|
495
|
+
]);
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
it('does not detect unrelated Swedish text', () => {
|
|
499
|
+
expectNotDetected([
|
|
500
|
+
'Vi använder förnybar energi och endast nödvändiga resurser',
|
|
501
|
+
'Vi använder bara ekologiska råvaror i våra bakverk',
|
|
502
|
+
'Recept på kakor och bullar till fikat',
|
|
503
|
+
'Sök och jämför billiga flyg online. Vart vill du resa?',
|
|
504
|
+
'Välkommen till ett roligare sparande i aktier och fonder',
|
|
505
|
+
]);
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
describe('checkHeuristicPatterns with more Danish, Norwegian, Italian and Japanese wording', () => {
|
|
510
|
+
it('detects cookie notices', () => {
|
|
511
|
+
expectDetected([
|
|
512
|
+
'Vi anvender cookies for at forbedre din oplevelse',
|
|
513
|
+
'Denne hjemmeside benytter cookies',
|
|
514
|
+
'Her kan du administrere dine samtykker for bruk av cookies/ informasjonskapsler på nettstedet',
|
|
515
|
+
"Informativa sull'utilizzo dei cookie",
|
|
516
|
+
'広告を配信すること等を目的に、Cookie等の「インフォマティブデータ」を利用しています。',
|
|
517
|
+
]);
|
|
518
|
+
});
|
|
519
|
+
|
|
520
|
+
it('does not detect unrelated text', () => {
|
|
521
|
+
expectNotDetected([
|
|
522
|
+
'Du vil ansøge om at besøge, bo eller arbejde i Danmark',
|
|
523
|
+
'Il sito utilizza materiali riciclati per la costruzione',
|
|
524
|
+
]);
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
describe('checkHeuristicPatterns with more notice phrasings', () => {
|
|
529
|
+
it('detects cookie notices in each language', () => {
|
|
530
|
+
const texts = [
|
|
531
|
+
'May we use cookies to see how the site is used?',
|
|
532
|
+
'Allow analytics cookies? They help us improve the site.',
|
|
533
|
+
'We use privacy-friendly analytics to see which pages are most useful.',
|
|
534
|
+
'You can revoke your consent at any time.',
|
|
535
|
+
'Für die Reichweitenmessung nutzen wir Cookies.',
|
|
536
|
+
'Hierfür werden Analyse-Cookies auf Ihrem Gerät gespeichert.',
|
|
537
|
+
'Onze cookies geven je de best mogelijke ervaring.',
|
|
538
|
+
'Nous utilisons certains cookies pour mesurer l’audience.',
|
|
539
|
+
'Informativa sull’utilizzo dei cookie',
|
|
540
|
+
'Usiamo Google Analytics solo con il tuo consenso.',
|
|
541
|
+
'På den här webbplatsen används kakor.',
|
|
542
|
+
'Genom att fortsätta godkänner du användningen av kakor.',
|
|
543
|
+
'Godkänn alla\nEndast nödvändiga',
|
|
544
|
+
'Vi benytter informasjonskapsler for å forbedre nettsiden.',
|
|
545
|
+
'Vi anvender cookies for at forbedre din oplevelse.',
|
|
546
|
+
'Strona wykorzystuje pliki „cookies” w celach statystycznych.',
|
|
547
|
+
];
|
|
548
|
+
for (const text of texts) {
|
|
549
|
+
expect(checkHeuristicPatterns(text, 'popup').patterns.length, text).to.be.greaterThan(0);
|
|
550
|
+
}
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
it('does not detect unrelated text', () => {
|
|
554
|
+
for (const text of [
|
|
555
|
+
'Vi använder förnybar energi och endast nödvändiga resurser',
|
|
556
|
+
'We use data analytics tools in our consulting work',
|
|
557
|
+
'Le ultime notizie su fisco, tasse e dichiarazione dei redditi',
|
|
558
|
+
]) {
|
|
559
|
+
expect(checkHeuristicPatterns(text, 'popup').patterns, text).to.have.length(0);
|
|
560
|
+
}
|
|
561
|
+
});
|
|
562
|
+
});
|
|
563
|
+
|
|
351
564
|
// excluded as a popup by a whole-text context negative
|
|
352
565
|
const isExcludedPopup = (text: string) => excludedBy(text, 'popup').length > 0;
|
|
353
566
|
|
|
354
567
|
describe('popup exclusions', () => {
|
|
568
|
+
it('flags professional investor gates', () => {
|
|
569
|
+
expect(
|
|
570
|
+
isExcludedPopup(
|
|
571
|
+
'Please confirm that you are a professional investor. This website uses cookies. The information is not intended for retail clients.',
|
|
572
|
+
),
|
|
573
|
+
).to.be.true;
|
|
574
|
+
expect(isExcludedPopup('We use cookies to improve your experience. Accept all Reject all')).to.be.false;
|
|
575
|
+
});
|
|
576
|
+
|
|
355
577
|
it('flags doublelist-style age verification popups', () => {
|
|
356
578
|
// Real-world text from the doublelist.com age gate (listings page)
|
|
357
579
|
const text =
|
|
@@ -437,6 +659,24 @@ describe('popup exclusions', () => {
|
|
|
437
659
|
).to.be.false;
|
|
438
660
|
});
|
|
439
661
|
|
|
662
|
+
it('flags investor eligibility gates', () => {
|
|
663
|
+
const gate =
|
|
664
|
+
'By continuing you are confirming you have read and understood the legal information below and consent to the use of cookies on this site. ' +
|
|
665
|
+
'This website is for persons who qualify as Professional Clients or Eligible Counterparties under the FCA rules only. I agree I disagree';
|
|
666
|
+
expect(checkHeuristicPatterns(gate, 'page').patterns.length).to.be.greaterThan(0);
|
|
667
|
+
expect(isExcludedPopup(gate)).to.be.true;
|
|
668
|
+
expect(checkHeuristicPatterns(gate, 'popup').patterns).to.have.length(0);
|
|
669
|
+
expect(isExcludedPopup('This website uses cookies. It is not suitable for retail clients. I agree I disagree')).to.be.true;
|
|
670
|
+
expect(
|
|
671
|
+
isExcludedPopup(
|
|
672
|
+
'By clicking “Accept”, you confirm that you are an institutional investor in the United Kingdom. Accept I disagree',
|
|
673
|
+
),
|
|
674
|
+
).to.be.true;
|
|
675
|
+
expect(isExcludedPopup('By clicking “Accept”, you confirm that you are a financial intermediary. Accept I disagree')).to.be.true;
|
|
676
|
+
expect(isExcludedPopup('We use cookies to improve your experience. Our clients include institutional investors.\nAccept\nReject'))
|
|
677
|
+
.to.be.false;
|
|
678
|
+
});
|
|
679
|
+
|
|
440
680
|
it('flags "must be 18" and "21+ years" age gates', () => {
|
|
441
681
|
expect(isExcludedPopup('You must be 18 to enter this site. This site uses cookies.\nYes\nNo')).to.be.true;
|
|
442
682
|
expect(isExcludedPopup('Visitors must be at least 21 to continue. We use cookies.\nEnter')).to.be.true;
|
|
@@ -689,6 +929,68 @@ describe('classifyButtonTextRegex', () => {
|
|
|
689
929
|
});
|
|
690
930
|
});
|
|
691
931
|
|
|
932
|
+
describe('classifyButtonTextRegex with more button labels', () => {
|
|
933
|
+
it('matches reject labels', () => {
|
|
934
|
+
for (const text of [
|
|
935
|
+
'Disallow cookies',
|
|
936
|
+
'Do not allow cookies',
|
|
937
|
+
"Don't allow",
|
|
938
|
+
'Do not allow any cookies',
|
|
939
|
+
'Reject cookie',
|
|
940
|
+
'Proceed with necessary cookies only',
|
|
941
|
+
'No cookies',
|
|
942
|
+
'No cookies for me, thanks',
|
|
943
|
+
'Rather not',
|
|
944
|
+
'No, rather not',
|
|
945
|
+
'Ik accepteer geen cookies',
|
|
946
|
+
'Nee, ik wil geen optimale cookies',
|
|
947
|
+
'Ik wil geen cookies',
|
|
948
|
+
'Du kan sige nej tak til statistik',
|
|
949
|
+
'Avslå',
|
|
950
|
+
'Avvis alle cookies',
|
|
951
|
+
]) {
|
|
952
|
+
expect(classifyButtonTextRegex(text), text).to.equal('reject');
|
|
953
|
+
}
|
|
954
|
+
for (const text of ['Ja, ik accepteer optimale cookies', 'Avslått', 'Tak']) {
|
|
955
|
+
expect(classifyButtonTextRegex(text), text).to.not.equal('reject');
|
|
956
|
+
}
|
|
957
|
+
});
|
|
958
|
+
|
|
959
|
+
it('matches acknowledge labels', () => {
|
|
960
|
+
for (const text of [
|
|
961
|
+
'Close disclaimer',
|
|
962
|
+
'Continue browsing',
|
|
963
|
+
'Continue to Browse the Site',
|
|
964
|
+
'Poursuivre',
|
|
965
|
+
'I agree, dismiss this banner',
|
|
966
|
+
'Ukryj',
|
|
967
|
+
'Ausblenden',
|
|
968
|
+
'Ok. Ausblenden.',
|
|
969
|
+
'Hinweis ausblenden',
|
|
970
|
+
'Ок',
|
|
971
|
+
'Окей',
|
|
972
|
+
'閉じる',
|
|
973
|
+
'× 閉じる',
|
|
974
|
+
'確認',
|
|
975
|
+
'確認しました',
|
|
976
|
+
'了解',
|
|
977
|
+
'確認して閉じる',
|
|
978
|
+
]) {
|
|
979
|
+
expect(classifyButtonTextRegex(text), text).to.equal('acknowledge');
|
|
980
|
+
}
|
|
981
|
+
for (const text of ['Details ausblenden', '同意して閉じる', '確認して同意する', '確認する']) {
|
|
982
|
+
expect(classifyButtonTextRegex(text), text).to.not.equal('acknowledge');
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
it('does not treat policy links as settings', () => {
|
|
987
|
+
expect(classifyButtonTextRegex('Learn how to manage your preferences on our Privacy page')).to.equal('other');
|
|
988
|
+
expect(classifyButtonTextRegex('Manage your cookies in our privacy notice')).to.equal('other');
|
|
989
|
+
expect(classifyButtonTextRegex('Manage your preferences')).to.equal('settings');
|
|
990
|
+
expect(classifyButtonTextRegex('Manage cookie settings')).to.equal('settings');
|
|
991
|
+
});
|
|
992
|
+
});
|
|
993
|
+
|
|
692
994
|
describe('classifyPopup', () => {
|
|
693
995
|
function classify(texts: string[]) {
|
|
694
996
|
return classifyPopup(texts.map((text) => ({ text, regexClassification: classifyButtonTextRegex(text) })));
|
|
@@ -1070,3 +1372,54 @@ describe('getButtonData', () => {
|
|
|
1070
1372
|
expect(buttons[0].text).to.equal('Spaced Text');
|
|
1071
1373
|
});
|
|
1072
1374
|
});
|
|
1375
|
+
|
|
1376
|
+
describe('checkHeuristicPatterns without bare accept-all / reject-all labels', () => {
|
|
1377
|
+
it('does not detect bare choice labels in any language', () => {
|
|
1378
|
+
expectNotDetected([
|
|
1379
|
+
'Accept all\nReject all',
|
|
1380
|
+
'Tout accepter\nTout refuser',
|
|
1381
|
+
'Alle akzeptieren\nAlle ablehnen',
|
|
1382
|
+
'Alles accepteren\nWijs alles af',
|
|
1383
|
+
'Aceptar todas\nRechazar todas',
|
|
1384
|
+
'Accetta tutti\nRifiuta tutti',
|
|
1385
|
+
'Godkänn alla Avvisa alla',
|
|
1386
|
+
// a moderation queue row with bulk actions
|
|
1387
|
+
'(diff | preview) . . Main Page 10:03 . . (+42) . . 192.0.2.1 [?] (fix typo) [Approve Approve all . . Reject Reject all] [Mark as spammer]',
|
|
1388
|
+
]);
|
|
1389
|
+
});
|
|
1390
|
+
|
|
1391
|
+
it('detects notices that explain the choice buttons', () => {
|
|
1392
|
+
expectDetected([
|
|
1393
|
+
'By clicking "Accept all", you agree to the storing of cookies on your device to improve your experience.',
|
|
1394
|
+
'By clicking "OK" you allow cookies that help us improve the site.',
|
|
1395
|
+
'Settings\nReject non-essential\nAccept all',
|
|
1396
|
+
'Accept all cookies',
|
|
1397
|
+
'You can choose which cookies you accept.',
|
|
1398
|
+
'Example Corp stores cookies on your device to analyse traffic.',
|
|
1399
|
+
'We would like your consent to collect data on how you use the site.',
|
|
1400
|
+
'Powered by Usercentrics Consent Management',
|
|
1401
|
+
'En cliquant sur « Tout accepter », vous acceptez le dépôt de cookies sur votre appareil.',
|
|
1402
|
+
'Les cookies nous permettent de mesurer l’audience.',
|
|
1403
|
+
'Nous pouvons utiliser des traceurs optionnels pour mesurer l’audience.',
|
|
1404
|
+
'Wenn Sie auf „Alle akzeptieren“ klicken, stimmen Sie der Speicherung von Cookies zu.',
|
|
1405
|
+
'Durch Klicken auf „Alle akzeptieren“ gestatten Sie den Einsatz folgender Dienste.',
|
|
1406
|
+
'Um diese Dienste verwenden zu dürfen, benötigen wir Ihre Einwilligung.',
|
|
1407
|
+
'Hier legen Sie fest, welche Cookies Sie zulassen.',
|
|
1408
|
+
'Dies geschieht meist in Form von Cookies.',
|
|
1409
|
+
'Realisiert mit Klaro!',
|
|
1410
|
+
'Door op "Alle cookies accepteren" te klikken, gaat u akkoord met het opslaan van cookies.',
|
|
1411
|
+
'Wij vragen toestemming voor het plaatsen van cookies.',
|
|
1412
|
+
'Al hacer clic en "Aceptar todas las cookies", usted acepta que las cookies se guarden en su dispositivo.',
|
|
1413
|
+
'Nosotros y nuestros socios deseamos almacenar o acceder a información en su dispositivo.',
|
|
1414
|
+
'Cliccando su "Accetta tutti i cookie", accetti la memorizzazione dei cookie sul dispositivo.',
|
|
1415
|
+
'Noi e i nostri partner archiviamo informazioni su un dispositivo.',
|
|
1416
|
+
]);
|
|
1417
|
+
});
|
|
1418
|
+
|
|
1419
|
+
it('does not detect sign-up terms that start like a consent notice', () => {
|
|
1420
|
+
expectNotDetected([
|
|
1421
|
+
'En cliquant sur "Créer un compte", vous acceptez les conditions d’utilisation et la politique de confidentialité.',
|
|
1422
|
+
'By clicking "Sign up", you agree to our Terms of Service.',
|
|
1423
|
+
]);
|
|
1424
|
+
});
|
|
1425
|
+
});
|