@duckduckgo/autoconsent 16.49.0 → 16.51.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/.agents/skills/optimize-button-patterns/SKILL.md +4 -4
- package/.github/workflows/release-labels.yml +2 -6
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +130 -0
- package/build.sh +2 -0
- package/data/labelled-button-texts.csv +36 -36
- 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 +67 -46
- 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 +67 -46
- 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 +67 -46
- package/dist/autoconsent.esm.js +67 -46
- package/dist/autoconsent.playwright.js +68 -46
- package/dist/autoconsent.standalone.js +68 -47
- package/dist/heuristics.cjs.js +886 -0
- package/dist/heuristics.mjs +847 -0
- package/dist/types/eval-snippets.d.ts +2 -0
- package/dist/types/heuristic-classify.d.ts +16 -0
- package/dist/types/heuristics.d.ts +2 -9
- package/dist/types/types.d.ts +3 -5
- package/lib/eval-snippets.ts +4 -0
- package/lib/heuristic-classify.ts +136 -0
- package/lib/heuristic-patterns.ts +33 -16
- package/lib/heuristics.ts +3 -124
- package/lib/types.ts +3 -5
- package/lib/web.ts +1 -1
- package/package.json +7 -2
- package/playwright/content.ts +5 -0
- package/readme.md +12 -0
- package/rules/autoconsent/abcacupuncture1.json +34 -0
- package/rules/autoconsent/aceodds.json +13 -0
- package/rules/autoconsent/allabout-japan.json +42 -0
- package/rules/autoconsent/amazon-hiring.json +16 -0
- package/rules/autoconsent/avada-cookie-consent.json +43 -0
- package/rules/autoconsent/avvio.json +22 -0
- package/rules/autoconsent/axeptio.json +22 -6
- package/rules/autoconsent/bdirect-booking-engine.json +33 -0
- package/rules/autoconsent/berelax.com.json +33 -0
- package/rules/autoconsent/bigcrunch.json +39 -0
- package/rules/autoconsent/bigid.json +59 -0
- package/rules/autoconsent/bluepark.json +31 -0
- package/rules/autoconsent/bricklink.json +33 -0
- package/rules/autoconsent/burpee-com.json +5 -1
- package/rules/autoconsent/bynder.json +33 -0
- package/rules/autoconsent/ceneo.json +9 -0
- package/rules/autoconsent/cinemaplus.json +9 -0
- package/rules/autoconsent/columbia-privacy-notice.json +32 -0
- package/rules/autoconsent/complianz-notice.json +1 -1
- package/rules/autoconsent/conjointly.json +43 -0
- package/rules/autoconsent/cookieconsent2-legacy.json +44 -0
- package/rules/autoconsent/cookiesjsr.json +27 -0
- package/rules/autoconsent/copaamerica.json +29 -0
- package/rules/autoconsent/cornerstone-brands.json +51 -0
- package/rules/autoconsent/darkounity.com.json +35 -0
- package/rules/autoconsent/dhbbank.json +13 -0
- package/rules/autoconsent/duda-cookie-notification.json +41 -0
- package/rules/autoconsent/ee-consent-notice.json +40 -0
- package/rules/autoconsent/endocrine.org.json +35 -0
- package/rules/autoconsent/ezoic.json +2 -2
- package/rules/autoconsent/fera-cookies.json +67 -0
- package/rules/autoconsent/fis-data-exchange.json +13 -0
- package/rules/autoconsent/getproven.json +33 -0
- package/rules/autoconsent/givedirectly.json +36 -0
- package/rules/autoconsent/godaddy-website-builder-cosmetic.json +13 -0
- package/rules/autoconsent/godaddy-website-builder.json +9 -0
- package/rules/autoconsent/guesty.json +31 -0
- package/rules/autoconsent/gundam-base-entry.json +40 -0
- package/rules/autoconsent/hearst-us.json +1 -1
- package/rules/autoconsent/indy-systems.json +26 -0
- package/rules/autoconsent/ing-nl.json +54 -0
- package/rules/autoconsent/iubenda.json +25 -3
- 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/lucrin.json +18 -0
- package/rules/autoconsent/mackeeper.json +34 -0
- package/rules/autoconsent/makitatools.json +41 -0
- package/rules/autoconsent/milestone-internet.json +32 -0
- package/rules/autoconsent/ndl-go-jp.json +35 -0
- package/rules/autoconsent/nhm-ac-uk.json +29 -0
- package/rules/autoconsent/npo-ccm.json +42 -0
- package/rules/autoconsent/opalcollection-com.json +12 -0
- package/rules/autoconsent/orw-cookie-banner.json +42 -0
- package/rules/autoconsent/osf-io.json +29 -0
- package/rules/autoconsent/palace-company.json +13 -0
- package/rules/autoconsent/paypal-us.json +3 -3
- package/rules/autoconsent/paypal.json +5 -2
- package/rules/autoconsent/paytronix.json +30 -0
- package/rules/autoconsent/pitt-edu.json +12 -0
- package/rules/autoconsent/pizzapilgrims.co.uk.json +49 -0
- package/rules/autoconsent/podimo.json +73 -0
- package/rules/autoconsent/publicmobile.json +16 -0
- package/rules/autoconsent/rakshaos.json +45 -0
- package/rules/autoconsent/rutjes.json +13 -0
- package/rules/autoconsent/saturdaysnyc.json +33 -0
- package/rules/autoconsent/serpstat-com.json +13 -0
- package/rules/autoconsent/shopquarters.json +41 -0
- package/rules/autoconsent/shopware.json +71 -0
- package/rules/autoconsent/simpleview-cookie-banner.json +27 -0
- package/rules/autoconsent/solvhealth-com.json +12 -0
- package/rules/autoconsent/spermidinelife-us.json +29 -0
- package/rules/autoconsent/squarespace-cookie-banner.json +1 -1
- package/rules/autoconsent/squarespace-cookie-notice.json +29 -0
- package/rules/autoconsent/store2000-fr.json +17 -0
- package/rules/autoconsent/tempest-cookie-notice.json +9 -0
- package/rules/autoconsent/termsfeed.json +4 -4
- 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/therealest.json +42 -0
- package/rules/autoconsent/tineye.json +35 -0
- package/rules/autoconsent/tk-aerztefuehrer.de.json +18 -0
- package/rules/autoconsent/toyota.json +16 -5
- package/rules/autoconsent/tplink.json +57 -9
- package/rules/autoconsent/trust360.json +29 -0
- package/rules/autoconsent/uft-cookie-notice.json +15 -0
- package/rules/autoconsent/up-cookie-consent.json +53 -0
- package/rules/autoconsent/uw-madison-cookieconsent.json +10 -0
- package/rules/autoconsent/vowels.json +13 -0
- package/rules/autoconsent/wbd-legal-terms.json +32 -0
- package/rules/autoconsent/web-rewind.com.json +21 -0
- package/rules/autoconsent/wildling-com.json +29 -0
- package/rules/autoconsent/worldbank.json +30 -0
- package/rules/autoconsent/yuntrack.json +50 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/scripts/benchmark-button-classification.ts +18 -3
- package/scripts/button-text-benchmark.ts +5 -5
- package/tests/abcacupuncture1.spec.ts +3 -0
- package/tests/aceodds.spec.ts +3 -0
- package/tests/allabout-japan.spec.ts +3 -0
- package/tests/amazon-hiring.spec.ts +3 -0
- package/tests/avada-cookie-consent.spec.ts +9 -0
- package/tests/avvio.spec.ts +8 -0
- package/tests/axeptio.spec.ts +11 -4
- package/tests/bdirect-booking-engine.spec.ts +9 -0
- package/tests/berelax.com.spec.ts +5 -0
- package/tests/bigcrunch.spec.ts +16 -0
- package/tests/bigid.spec.ts +8 -0
- package/tests/bluepark.spec.ts +8 -0
- package/tests/bricklink.spec.ts +3 -0
- package/tests/burpee-com.spec.ts +2 -0
- package/tests/bynder.spec.ts +3 -0
- package/tests/ceneo.spec.ts +3 -0
- package/tests/cinemaplus.spec.ts +8 -0
- package/tests/columbia-privacy-notice.spec.ts +8 -0
- package/tests/complianz-notice.spec.ts +7 -3
- package/tests/conjointly.spec.ts +3 -0
- package/tests/cookieconsent2-legacy.spec.ts +8 -0
- package/tests/cookiesjsr.spec.ts +9 -0
- package/tests/copaamerica.spec.ts +3 -0
- package/tests/cornerstone-brands.spec.ts +8 -0
- package/tests/darkounity.com.spec.ts +6 -0
- package/tests/dhbbank.spec.ts +6 -0
- package/tests/duda-cookie-notification.spec.ts +8 -0
- package/tests/ee-consent-notice.spec.ts +9 -0
- package/tests/endocrine.org.spec.ts +3 -0
- package/tests/ezoic.spec.ts +1 -1
- package/tests/fera-cookies.spec.ts +6 -0
- package/tests/fis-data-exchange.spec.ts +9 -0
- package/tests/getproven.spec.ts +5 -0
- package/tests/givedirectly.spec.ts +3 -0
- package/tests/godaddy-website-builder-cosmetic.spec.ts +7 -0
- package/tests/godaddy-website-builder.spec.ts +8 -0
- package/tests/guesty.spec.ts +7 -0
- package/tests/gundam-base-entry.spec.ts +3 -0
- package/tests/hearst-us.spec.ts +1 -0
- package/tests/indy-systems.spec.ts +8 -0
- package/tests/ing-nl.spec.ts +6 -0
- package/tests/iubenda.spec.ts +5 -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/lucrin.spec.ts +3 -0
- package/tests/mackeeper.spec.ts +3 -0
- package/tests/makitatools.spec.ts +5 -0
- package/tests/milestone-internet.spec.ts +8 -0
- package/tests/ndl-go-jp.spec.ts +8 -0
- package/tests/nhm-ac-uk.spec.ts +3 -0
- package/tests/npo-ccm.spec.ts +17 -0
- package/tests/opalcollection-com.spec.ts +3 -0
- package/tests/orw-cookie-banner.spec.ts +5 -0
- package/tests/osf-io.spec.ts +3 -0
- package/tests/palace-company.spec.ts +8 -0
- package/tests/paypal-us.spec.ts +2 -3
- package/tests/paytronix.spec.ts +7 -0
- package/tests/pitt-edu.spec.ts +3 -0
- package/tests/pizzapilgrims.co.uk.spec.ts +3 -0
- package/tests/podimo.spec.ts +3 -0
- package/tests/publicmobile.spec.ts +3 -0
- package/tests/rakshaos.spec.ts +9 -0
- package/tests/rutjes.spec.ts +3 -0
- package/tests/saturdaysnyc.spec.ts +3 -0
- package/tests/serpstat-com.spec.ts +3 -0
- package/tests/shopquarters.spec.ts +5 -0
- package/tests/shopware.spec.ts +8 -0
- package/tests/simpleview-cookie-banner.spec.ts +10 -0
- package/tests/solvhealth-com.spec.ts +10 -0
- package/tests/spermidinelife-us.spec.ts +3 -0
- package/tests/squarespace-cookie-notice.spec.ts +9 -0
- package/tests/store2000-fr.spec.ts +5 -0
- package/tests/tempest-cookie-notice.spec.ts +7 -0
- package/tests/termsfeed.spec.ts +4 -0
- package/tests/texas-instruments.spec.ts +3 -0
- package/tests/thegrandyork.spec.ts +3 -0
- package/tests/thenounproject.spec.ts +3 -0
- package/tests/therealest.spec.ts +6 -0
- package/tests/tineye.spec.ts +3 -0
- package/tests/tk-aerztefuehrer.de.spec.ts +6 -0
- package/tests/tplink.spec.ts +11 -1
- package/tests/trust360.spec.ts +8 -0
- package/tests/uft-cookie-notice.spec.ts +3 -0
- package/tests/up-cookie-consent.spec.ts +9 -0
- package/tests/uw-madison-cookieconsent.spec.ts +7 -0
- package/tests/vowels.spec.ts +3 -0
- package/tests/wbd-legal-terms.spec.ts +18 -0
- package/tests/web-rewind.com.spec.ts +5 -0
- package/tests/wildling-com.spec.ts +3 -0
- package/tests/worldbank.spec.ts +7 -0
- package/tests/yuntrack.spec.ts +6 -0
- package/tests-wtr/heuristics/button-classification-accuracy.test.ts +9 -5
- package/tests-wtr/heuristics/get-potential-popups.test.ts +28 -0
- package/tests-wtr/heuristics/heuristics-utils.test.ts +57 -6
- package/tsconfig.build.json +1 -1
- package/tsconfig.heuristics.json +10 -0
- package/rules/autoconsent/paypal-cookieprefs.json +0 -29
- package/tests/paypal-cookieprefs.spec.ts +0 -7
|
@@ -344,6 +344,8 @@
|
|
|
344
344
|
EVAL_COOKIEFIRST_1: () => document.querySelectorAll("button[data-cookiefirst-accent-color=true][role=checkbox]:not([disabled])").forEach((i) => i.getAttribute("aria-checked") === "true" && i.click()) || true,
|
|
345
345
|
EVAL_COOKIEINFORMATION_0: () => CookieInformation.declineAllCategories() || true,
|
|
346
346
|
EVAL_COOKIEINFORMATION_1: () => CookieInformation.submitAllCategories() || true,
|
|
347
|
+
// turn the single-button form into a decline submission, same fields as the CMP's own decline form
|
|
348
|
+
EVAL_EE_CONSENT_DECLINE_0: () => document.querySelectorAll('#cookieConsentFormAccept input[name^="ee:cookies_"]').forEach((i) => i.value = "n") || true,
|
|
347
349
|
EVAL_ETSY_0: () => document.querySelectorAll(".gdpr-overlay-body input").forEach((toggle) => {
|
|
348
350
|
toggle.checked = false;
|
|
349
351
|
}) || true,
|
|
@@ -430,7 +432,8 @@
|
|
|
430
432
|
EVAL_USERCENTRICS_API_5: () => UC_UI.areAllConsentsAccepted() === true,
|
|
431
433
|
EVAL_USERCENTRICS_API_6: () => UC_UI.areAllConsentsAccepted() === false,
|
|
432
434
|
EVAL_USERCENTRICS_BUTTON_0: () => JSON.parse(localStorage.getItem("usercentrics")).consents.every((c) => c.isEssential || !c.consentStatus),
|
|
433
|
-
EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true
|
|
435
|
+
EVAL_WAITROSE_0: () => Array.from(document.querySelectorAll("label[id$=cookies-deny-label]")).forEach((e) => e.click()) || true,
|
|
436
|
+
EVAL_WBD_LTP_CLOSE: () => document.querySelector("dialog#ltp-dialog").close() || true
|
|
434
437
|
};
|
|
435
438
|
function getFunctionBody(snippetFunc) {
|
|
436
439
|
const snippetStr = snippetFunc.toString();
|
|
@@ -446,7 +449,8 @@
|
|
|
446
449
|
// "only necessary" is probably too broad
|
|
447
450
|
/(?:by continuing.{0,100}cookie)|(?:cookie.{0,100}by continuing)/gi,
|
|
448
451
|
/(?:by continuing.{0,100}privacy)|(?:privacy.{0,100}by continuing)/gi,
|
|
449
|
-
|
|
452
|
+
// a single qualifier is common: "optional", "essential", "necessary", "analytics", ...
|
|
453
|
+
/we (?:use|serve)(?: \w+)? cookies/gi,
|
|
450
454
|
/we are using cookies/gi,
|
|
451
455
|
/use of cookies/gi,
|
|
452
456
|
/website uses cookies to enhance your browsing experience/gi,
|
|
@@ -590,7 +594,10 @@
|
|
|
590
594
|
// "файлы cookie" / "cookie-файлы" / "куки-файлы" in any phrasing
|
|
591
595
|
/(?:файл[а-яё]*[\s-]+(?:cookie|куки)|(?:cookie|куки)[\s-]+файл[а-яё]*)/gi,
|
|
592
596
|
// Italian (IT)
|
|
593
|
-
/usiamo.{0,20}cookie/gi
|
|
597
|
+
/usiamo.{0,20}cookie/gi,
|
|
598
|
+
// Japanese (JA)
|
|
599
|
+
// e.g. "当サイトはCookieを使用しています", "クッキー(Cookie)を利用しています"
|
|
600
|
+
/(?:cookie|クッキー).{0,10}を(?:使用|利用)/gi
|
|
594
601
|
];
|
|
595
602
|
var REJECT_PATTERNS_ENGLISH = [
|
|
596
603
|
// e.g. "reject", "reject all", "reject all cookies", "deny all", "refuse cookies", "decline",
|
|
@@ -606,8 +613,9 @@
|
|
|
606
613
|
/^\s*(i\s+)?(want\s+to\s+)?(only\s+)?(use|accept|allow|keep|enable|choose|continue\s+with|i\s+confirm)\s*(only\s+)?(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s*(continue|only)?\s*$/is,
|
|
607
614
|
/^\s*(i\s+)?(want\s+to\s+)?only\s+(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s*(cookies)?\s*(continue|only)?\s*$/is,
|
|
608
615
|
/^\s*(strictly\s+)?(necessary|essential|essentials|functional|required|minimal)\s+((cookies\s+)?only|only\s+cookies)\s*$/is,
|
|
609
|
-
// e.g. "do not sell or share my personal information", "opt out of sale ..." (CCPA)
|
|
610
|
-
|
|
616
|
+
// e.g. "do not sell or share my personal information", "do not share my personal information", "opt out of sale ..." (CCPA)
|
|
617
|
+
// "do not sell page" is a link; "do not sellcookie settings" is two concatenated buttons
|
|
618
|
+
/do\s+not\s+sell(?!\s*(page|cookie settings))|do\s+not\s+share\s+my\s+(personal\s+)?(information|info|data)|opt\s+out\s+of\s+sale/is,
|
|
611
619
|
// e.g. "opt-out of sale/share or targeted advertising", "opt-out of advertising/social media cookies"
|
|
612
620
|
/^opt[ -]?out of /is,
|
|
613
621
|
// e.g. "reject all except strictly necessary", "reject all (except necessary cookies)"
|
|
@@ -618,7 +626,6 @@
|
|
|
618
626
|
/^no,? thank(s| you)$/is,
|
|
619
627
|
/^opt[ -]out$/is,
|
|
620
628
|
"dont enable",
|
|
621
|
-
"withdraw consent",
|
|
622
629
|
"i do not agree"
|
|
623
630
|
];
|
|
624
631
|
var REJECT_PATTERNS_DUTCH = [
|
|
@@ -645,9 +652,10 @@
|
|
|
645
652
|
var REJECT_PATTERNS_FRENCH = [
|
|
646
653
|
// refuser / rejeter / interdire / décliner (reject verbs, any position)
|
|
647
654
|
// "refuser et s'abonner" / "refuser et payer" are excluded via BUTTON_NEVER_MATCH_PATTERNS
|
|
648
|
-
|
|
655
|
+
// skip English prose such as "cookies that you can refuse"
|
|
656
|
+
/^(?!.*\bcan refuse\b)(.*\s)?(refus|rejet|rejeter|interdire|interdis|déclin|declin)/is,
|
|
649
657
|
// only necessary / essential / technical / functional
|
|
650
|
-
|
|
658
|
+
/^(?=.*(cookie|nécessaire|essentiel|techni|requis|obligatoire|fonctionnel|indispensable|sdk)).*(uniquement|seulement|indispensable|strictement nécessaire|que les cookies\s+(nécessaires|techniques|essentiels|indispensables|fonctionnels))/is,
|
|
651
659
|
// continue/proceed without accepting; refuse everything; disable purposes
|
|
652
660
|
/(sans accepter|ne pas accepter|je naccepte rien|je désactive)/is,
|
|
653
661
|
// "non" / "non, merci"
|
|
@@ -705,7 +713,7 @@
|
|
|
705
713
|
// "solo/sólo/no, sólo ... necessary/essential"
|
|
706
714
|
/^(no,?\s+)?(solo|sólo|només)\s+(usar\s+|las?\s+|los\s+|lo\s+)?.{0,20}(necesari|esencial|estrictamente)/is,
|
|
707
715
|
// refusals / opt-outs
|
|
708
|
-
/^(no acept|no consentir|no permitir|no estoy de acuerdo|no,? gracias|sin consentimiento|
|
|
716
|
+
/^(no acept|no consentir|no permitir|no estoy de acuerdo|no,? gracias|sin consentimiento|continuar sin aceptar|prefiero rechazarlas|descartar todas)/is,
|
|
709
717
|
"acceptar nom\xE9s les necess\xE0ries",
|
|
710
718
|
"nom\xE9s sutilitzen cookies quan \xE9s necessari",
|
|
711
719
|
"pulsa aqu\xED para desactivar las cookies opcionales"
|
|
@@ -754,6 +762,12 @@
|
|
|
754
762
|
];
|
|
755
763
|
var REJECT_PATTERNS_TURKISH = ["reddet", "\xE7erezleri reddet"];
|
|
756
764
|
var REJECT_PATTERNS_INDONESIAN = ["tolak cookie"];
|
|
765
|
+
var REJECT_PATTERNS_JAPANESE = [
|
|
766
|
+
// e.g. "拒否", "すべて拒否", "全て拒否する", "cookieを拒否"
|
|
767
|
+
/^(すべて|全て)?\s?(の)?(cookie|クッキー)?\s?(を)?拒否(する)?$/i,
|
|
768
|
+
"\u540C\u610F\u3057\u306A\u3044",
|
|
769
|
+
"\u540C\u610F\u3057\u307E\u305B\u3093"
|
|
770
|
+
];
|
|
757
771
|
var REJECT_PATTERNS = [
|
|
758
772
|
...REJECT_PATTERNS_ENGLISH,
|
|
759
773
|
...REJECT_PATTERNS_DUTCH,
|
|
@@ -771,9 +785,13 @@
|
|
|
771
785
|
...REJECT_PATTERNS_POLISH,
|
|
772
786
|
...REJECT_PATTERNS_RUSSIAN,
|
|
773
787
|
...REJECT_PATTERNS_TURKISH,
|
|
774
|
-
...REJECT_PATTERNS_INDONESIAN
|
|
788
|
+
...REJECT_PATTERNS_INDONESIAN,
|
|
789
|
+
...REJECT_PATTERNS_JAPANESE
|
|
775
790
|
];
|
|
776
791
|
var BUTTON_NEVER_MATCH_PATTERNS = [
|
|
792
|
+
// text of several concatenated buttons, or popup body text rather than a button
|
|
793
|
+
/accept all.*reject all|reject all.*accept all/is,
|
|
794
|
+
/^.{300,}$/s,
|
|
777
795
|
/pay|subscribe/is,
|
|
778
796
|
/abonneer/is,
|
|
779
797
|
/abonnier/is,
|
|
@@ -814,8 +832,10 @@
|
|
|
814
832
|
// Multilingual "open customization" patterns: a customization verb next to a
|
|
815
833
|
// cookie/preference/settings/options/details/purposes noun (both word orders).
|
|
816
834
|
// The negative lookahead avoids policy links and save/confirm/accept phrases (those are accept/acknowledge/other).
|
|
817
|
-
/^(?!.*\b(policy|policies|notice|statement|impressum
|
|
818
|
-
/^(?!.*\b(policy|policies|notice|statement|impressum
|
|
835
|
+
/^(?!.*\b(policy|policies|notice|statement|impressum|\w*richtlinie\w*|\w*erklärung|page|beschrijving|privacy$|beleid|politique|política|polityk|speichern|guardar|opslaan|zapisz|enregistrer|sauvegarder|bevestig|bestätig|confirm|save|submit|akzeptier|accept|zaakcept)\b)(customi[sz]e|manage|adjust|configure|personali[sz]e|let me choose|edit|change|set|select|view|see|review|update|open|show|choose|anpassen|verwalten|konfigurieren|bearbeiten|öffnen|anzeigen|einblenden|einstellen|festlegen|auswählen|wählen|aanpassen|beheren|instellen|wijzig\w*|personaliseren|personaliseer|kies|bekijk|toon|personnaliser|paramétrer|gérer|configurer|choisir|afficher|définir|modifier|configurar|personalizar|gestionar|administrar|ajustar|seleccionar|modificar|establecer|dostosuj|zarządzaj|personalizuj|ustaw\w*|zmień|pokaż|wybierz)\b.{0,20}(cookies?|preferences?|settings?|options?|choices?|controls?|details?|purposes?|services?|consent|einstellung\w*|optionen|präferenzen|einzelheiten|zwecke|dienste|datenschutz\w*|auswahl|voorkeur\w*|instelling\w*|opties|diensten|préférences|paramètres|réglages|choix|détails|finalités|témoins|preferencia\w*|opciones|ajustes|configuraci\w*|detalles|servicios|elección|preferencj\w*|ustawie\w*|opcje|szczegół\w*|cele|galetes)\b/is,
|
|
836
|
+
/^(?!.*\b(policy|policies|notice|statement|impressum|\w*richtlinie\w*|\w*erklärung|page|beschrijving|privacy$|beleid|politique|política|polityk|speichern|guardar|opslaan|zapisz|enregistrer|sauvegarder|bevestig|bestätig|confirm|save|submit|akzeptier|accept|zaakcept)\b)(cookies?|preferences?|settings?|options?|choices?|controls?|details?|purposes?|services?|consent|einstellung\w*|optionen|präferenzen|einzelheiten|zwecke|dienste|datenschutz\w*|auswahl|voorkeur\w*|instelling\w*|opties|diensten|préférences|paramètres|réglages|choix|détails|finalités|témoins|preferencia\w*|opciones|ajustes|configuraci\w*|detalles|servicios|elección|preferencj\w*|ustawie\w*|opcje|szczegół\w*|cele|galetes)\b(.{0,14}\W)?(customi[sz]e|manage|adjust|configure|personali[sz]e|let me choose|edit|change|set|select|view|see|review|update|open|show|choose|anpassen|verwalten|konfigurieren|bearbeiten|öffnen|anzeigen|einblenden|einstellen|festlegen|auswählen|wählen|aanpassen|beheren|instellen|wijzig\w*|personaliseren|personaliseer|kies|bekijk|toon|personnaliser|paramétrer|gérer|configurer|choisir|afficher|définir|modifier|configurar|personalizar|gestionar|administrar|ajustar|seleccionar|modificar|establecer|dostosuj|zarządzaj|personalizuj|ustaw\w*|zmień|pokaż|wybierz)\b/is,
|
|
837
|
+
// settings noun + cookies, e.g. "paramètres des cookies", "ajustes de cookies", "instellingen voor cookies en diensten"
|
|
838
|
+
/^(paramètres|préférences|réglages|ajustes|opciones|elección|preferencias|instellingen)( (de|des|les|voor|van))? cookies( (et des|en|y) (services|diensten|servicios))?$/is,
|
|
819
839
|
"settings",
|
|
820
840
|
"preferences",
|
|
821
841
|
/customi(s|z)e/is,
|
|
@@ -829,8 +849,8 @@
|
|
|
829
849
|
"cookieconsent preferences",
|
|
830
850
|
/privacy choices/is,
|
|
831
851
|
/^(privacy|cookie|custom) settings$/is,
|
|
832
|
-
/^cookies? (settings|preferences|setting)
|
|
833
|
-
|
|
852
|
+
/^cookies? (settings|preferences|setting)(?!.*\bdo not\b)/is,
|
|
853
|
+
/^(?!.*\bpolic(y|ies)\b).*(manage|customize|customise|opt-out|edit).*(cookies|preferences|settings|options)/is,
|
|
834
854
|
"cookie consent options",
|
|
835
855
|
"privacy controls",
|
|
836
856
|
// German
|
|
@@ -1001,7 +1021,7 @@
|
|
|
1001
1021
|
"yes",
|
|
1002
1022
|
/accept all above/is,
|
|
1003
1023
|
"close and accept",
|
|
1004
|
-
/accept all$/is,
|
|
1024
|
+
/(^|\s)accept all$/is,
|
|
1005
1025
|
"im ok with that",
|
|
1006
1026
|
// Spanish (ES)
|
|
1007
1027
|
/^acept(ar|o)( cookies)?$/,
|
|
@@ -1027,6 +1047,8 @@
|
|
|
1027
1047
|
"accepta",
|
|
1028
1048
|
"accepta totes les cookies",
|
|
1029
1049
|
"accepta-ho tot",
|
|
1050
|
+
// FR/CA "d'accord" / "d'acord"
|
|
1051
|
+
/^dac?cord( fermer)?$/is,
|
|
1030
1052
|
"accepta-les totes",
|
|
1031
1053
|
"acceptar galetes",
|
|
1032
1054
|
"acceptar i tancar",
|
|
@@ -1068,7 +1090,6 @@
|
|
|
1068
1090
|
"akceptuj\u0119!",
|
|
1069
1091
|
"ok, zgadzam si\u0119",
|
|
1070
1092
|
"potwierdzam wszystkie",
|
|
1071
|
-
"przejd\u017A do serwisu",
|
|
1072
1093
|
"tak",
|
|
1073
1094
|
"tak, zgadzam si\u0119 na wszystkie pliki cookie",
|
|
1074
1095
|
"tak, zgadzam si\u0119",
|
|
@@ -1139,8 +1160,6 @@
|
|
|
1139
1160
|
"seguir",
|
|
1140
1161
|
"vale",
|
|
1141
1162
|
"\xA1vamos!",
|
|
1142
|
-
// Catalan (CA)
|
|
1143
|
-
"dacord",
|
|
1144
1163
|
// Polish (PL)
|
|
1145
1164
|
"kontynuuj",
|
|
1146
1165
|
"ok, zrozumia\u0142em",
|
|
@@ -1164,10 +1183,8 @@
|
|
|
1164
1183
|
"\u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C"
|
|
1165
1184
|
];
|
|
1166
1185
|
|
|
1167
|
-
// lib/
|
|
1168
|
-
var BUTTON_LIKE_ELEMENT_SELECTOR = 'button, input[type="button"], input[type="submit"], a, [role="button"], [class*="button"]';
|
|
1186
|
+
// lib/heuristic-classify.ts
|
|
1169
1187
|
var TEXT_LIMIT = 1e5;
|
|
1170
|
-
var POPUP_SEARCH_MAX_TIME = 100;
|
|
1171
1188
|
function checkHeuristicPatterns(allText, detectPatterns = DETECT_PATTERNS) {
|
|
1172
1189
|
allText = allText.slice(0, TEXT_LIMIT);
|
|
1173
1190
|
const patterns = [];
|
|
@@ -1185,31 +1202,6 @@
|
|
|
1185
1202
|
}
|
|
1186
1203
|
return { patterns, snippets: snippets2 };
|
|
1187
1204
|
}
|
|
1188
|
-
function getActionablePopups(mode = "reject", timeout = POPUP_SEARCH_MAX_TIME) {
|
|
1189
|
-
const acceptedLevels = mode === "tier2" ? ["reject", "tier1", "tier2"] : mode === "tier1" ? ["reject", "tier1"] : ["reject"];
|
|
1190
|
-
if (acceptedLevels.length === 0) {
|
|
1191
|
-
return [];
|
|
1192
|
-
}
|
|
1193
|
-
const popups = getPotentialPopups(timeout);
|
|
1194
|
-
const result = popups.reduce((acc, popup) => {
|
|
1195
|
-
const popupText = popup.text?.trim();
|
|
1196
|
-
if (popupText) {
|
|
1197
|
-
if (isExcludedPopup(popupText)) {
|
|
1198
|
-
return acc;
|
|
1199
|
-
}
|
|
1200
|
-
const { patterns } = checkHeuristicPatterns(popupText);
|
|
1201
|
-
if (patterns.length > 0) {
|
|
1202
|
-
classifyButtons(popup.buttons);
|
|
1203
|
-
popup.regexClassification = classifyPopup(popup.buttons);
|
|
1204
|
-
acc.push({
|
|
1205
|
-
...popup
|
|
1206
|
-
});
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
return acc;
|
|
1210
|
-
}, []);
|
|
1211
|
-
return result.filter((popup) => popup.regexClassification !== void 0 && acceptedLevels.includes(popup.regexClassification)).sort((a, b) => (a.regexClassification ?? "") > (b.regexClassification ?? "") ? 1 : -1);
|
|
1212
|
-
}
|
|
1213
1205
|
function classifyButtons(buttons) {
|
|
1214
1206
|
for (const button of buttons) {
|
|
1215
1207
|
button.regexClassification = classifyButtonTextRegex(button.text);
|
|
@@ -1280,6 +1272,35 @@
|
|
|
1280
1272
|
}
|
|
1281
1273
|
return "other";
|
|
1282
1274
|
}
|
|
1275
|
+
|
|
1276
|
+
// lib/heuristics.ts
|
|
1277
|
+
var BUTTON_LIKE_ELEMENT_SELECTOR = 'button, input[type="button"], input[type="submit"], a, [role="button"], [class*="button"]';
|
|
1278
|
+
var POPUP_SEARCH_MAX_TIME = 100;
|
|
1279
|
+
function getActionablePopups(mode = "reject", timeout = POPUP_SEARCH_MAX_TIME) {
|
|
1280
|
+
const acceptedLevels = mode === "tier2" ? ["reject", "tier1", "tier2"] : mode === "tier1" ? ["reject", "tier1"] : ["reject"];
|
|
1281
|
+
if (acceptedLevels.length === 0) {
|
|
1282
|
+
return [];
|
|
1283
|
+
}
|
|
1284
|
+
const popups = getPotentialPopups(timeout);
|
|
1285
|
+
const result = popups.reduce((acc, popup) => {
|
|
1286
|
+
const popupText = popup.text?.trim();
|
|
1287
|
+
if (popupText) {
|
|
1288
|
+
if (isExcludedPopup(popupText)) {
|
|
1289
|
+
return acc;
|
|
1290
|
+
}
|
|
1291
|
+
const { patterns } = checkHeuristicPatterns(popupText);
|
|
1292
|
+
if (patterns.length > 0) {
|
|
1293
|
+
classifyButtons(popup.buttons);
|
|
1294
|
+
popup.regexClassification = classifyPopup(popup.buttons);
|
|
1295
|
+
acc.push({
|
|
1296
|
+
...popup
|
|
1297
|
+
});
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
return acc;
|
|
1301
|
+
}, []);
|
|
1302
|
+
return result.filter((popup) => popup.regexClassification !== void 0 && acceptedLevels.includes(popup.regexClassification)).sort((a, b) => (a.regexClassification ?? "") > (b.regexClassification ?? "") ? 1 : -1);
|
|
1303
|
+
}
|
|
1283
1304
|
function getPotentialPopups(timeout = POPUP_SEARCH_MAX_TIME) {
|
|
1284
1305
|
const isFramed = !isTopFrame();
|
|
1285
1306
|
if (isFramed && window.parent && window.parent !== window.top) {
|
|
@@ -3394,6 +3415,7 @@
|
|
|
3394
3415
|
_config = new WeakMap();
|
|
3395
3416
|
|
|
3396
3417
|
// playwright/content.ts
|
|
3418
|
+
window.autoconsentHeuristics = { getPotentialPopups, getButtonData };
|
|
3397
3419
|
if (!window.autoconsentReceiveMessage) {
|
|
3398
3420
|
const consent = new AutoConsent(window.autoconsentSendMessage, null, { autoconsent: [] });
|
|
3399
3421
|
window.autoconsentReceiveMessage = (message) => {
|