@duckduckgo/autoconsent 14.70.0 → 14.72.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 +46 -0
- package/Jenkinsfile +8 -22
- package/dist/addon-firefox/background.bundle.js +15 -2
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +13 -0
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/popup.bundle.js +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +15 -2
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +13 -0
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/popup.bundle.js +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +13 -0
- package/dist/autoconsent.esm.js +13 -0
- package/dist/autoconsent.extra.cjs.js +14 -1
- package/dist/autoconsent.extra.esm.js +14 -1
- package/dist/autoconsent.playwright.js +14 -1
- package/dist/types/eval-snippets.d.ts +2 -0
- package/docs/puppeteer.md +156 -0
- package/lib/eval-snippets.ts +13 -0
- package/package.json +1 -1
- package/readme.md +4 -0
- package/rules/autoconsent/consentmo.json +44 -0
- package/rules/autoconsent/cookieconsent2.json +3 -1
- package/rules/autoconsent/didomi.json +22 -0
- package/rules/autoconsent/real-cookie-banner.json +1 -1
- package/rules/autoconsent/squarespace-cookie-banner.json +31 -0
- package/rules/build.ts +1 -1
- package/rules/compact-rules.json +1 -1
- package/rules/consentomatic.json +1 -1
- package/rules/generated/auto_AU_goodmoodprints.com_9fy.json +11 -11
- package/rules/generated/auto_GB_supremecourt.uk_0.json +9 -9
- package/rules/generated/auto_US_musicnotes.com_0.json +20 -5
- package/rules/rules.json +1 -1
- package/scripts/get-tests-to-run.js +79 -0
- package/tests/consentmo.spec.ts +15 -0
- package/tests/cookieconsent2.spec.ts +1 -1
- package/tests/didomi.spec.ts +5 -4
- package/tests/squarespace-cookie-banner.spec.ts +9 -0
- package/rules/generated/auto_AU_urallawoolroom.com.au_3ng.json +0 -28
- package/rules/generated/auto_CH_degussa-goldhandel.ch_mqc.json +0 -40
- package/rules/generated/auto_GB_filofax.com_uxo.json +0 -40
- package/rules/generated/auto_GB_musicnotes.com_0.json +0 -28
- package/tests/generated/auto_AU_urallawoolroom.com.au_3ng.spec.ts +0 -6
- package/tests/generated/auto_CH_degussa-goldhandel.ch_mqc.spec.ts +0 -6
- package/tests/generated/auto_GB_filofax.com_uxo.spec.ts +0 -2
- package/tests/generated/auto_GB_musicnotes.com_0.spec.ts +0 -6
|
@@ -459,6 +459,19 @@
|
|
|
459
459
|
var snippets = {
|
|
460
460
|
// code-based rules
|
|
461
461
|
EVAL_0: () => console.log(1),
|
|
462
|
+
EVAL_DIDOMI_OPT_OUT: () => {
|
|
463
|
+
if (window.Didomi) {
|
|
464
|
+
window.Didomi.setUserDisagreeToAll();
|
|
465
|
+
return true;
|
|
466
|
+
}
|
|
467
|
+
return false;
|
|
468
|
+
},
|
|
469
|
+
EVAL_DIDOMI_TEST: () => {
|
|
470
|
+
if (window.Didomi) {
|
|
471
|
+
return window.Didomi.getUserConsentStatusForAll().purposes.disabled.length > 0;
|
|
472
|
+
}
|
|
473
|
+
return false;
|
|
474
|
+
},
|
|
462
475
|
EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp("getCMPData") === "object",
|
|
463
476
|
EVAL_CONSENTMANAGER_2: () => !__cmp("consentStatus").userChoiceExists,
|
|
464
477
|
EVAL_CONSENTMANAGER_3: () => __cmp("setConsent", 0),
|
|
@@ -3767,7 +3780,7 @@
|
|
|
3767
3780
|
_config = new WeakMap();
|
|
3768
3781
|
|
|
3769
3782
|
// rules/consentomatic.json
|
|
3770
|
-
var consentomatic = { "didomi.io": { detectors: [{ presentMatcher: { target: { selector: "#didomi-host, #didomi-notice" }, type: "css" }, showingMatcher: { target: { selector: "body.didomi-popup-open, .didomi-notice-banner" }, type: "css" } }], methods: [{ action: { target: { selector: ".didomi-popup-notice-buttons .didomi-button:not(.didomi-button-highlight), .didomi-notice-banner .didomi-learn-more-button" }, type: "click" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ retries: 50, target: { selector: "#didomi-purpose-cookies" }, type: "waitcss", waitTime: 50 }, { consents: [{ description: "Share (everything) with others", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-share_whith_others]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-share_whith_others]:last-child" }, type: "click" }, type: "X" }, { description: "Information storage and access", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-cookies]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-cookies]:last-child" }, type: "click" }, type: "D" }, { description: "Content selection, offers and marketing", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-CL-T1Rgm7]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-CL-T1Rgm7]:last-child" }, type: "click" }, type: "E" }, { description: "Analytics", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-analytics]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-analytics]:last-child" }, type: "click" }, type: "B" }, { description: "Analytics", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-M9NRHJe3G]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-M9NRHJe3G]:last-child" }, type: "click" }, type: "B" }, { description: "Ad and content selection", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-advertising_personalization]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-advertising_personalization]:last-child" }, type: "click" }, type: "F" }, { description: "Ad and content selection", falseAction: { parent: { childFilter: { target: { selector: "#didomi-purpose-pub-ciblee" } }, selector: ".didomi-consent-popup-data-processing, .didomi-components-accordion-label-container" }, target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-pub-ciblee]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-pub-ciblee]:last-child" }, type: "click" }, type: "F" }, { description: "Ad and content selection - basics", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-q4zlJqdcD]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-q4zlJqdcD]:last-child" }, type: "click" }, type: "F" }, { description: "Ad and content selection - partners and subsidiaries", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-partenaire-cAsDe8jC]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-partenaire-cAsDe8jC]:last-child" }, type: "click" }, type: "F" }, { description: "Ad and content selection - social networks", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-p4em9a8m]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-p4em9a8m]:last-child" }, type: "click" }, type: "F" }, { description: "Ad and content selection - others", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-autres-pub]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-autres-pub]:last-child" }, type: "click" }, type: "F" }, { description: "Social networks", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-reseauxsociaux]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-reseauxsociaux]:last-child" }, type: "click" }, type: "A" }, { description: "Social networks", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-social_media]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-social_media]:last-child" }, type: "click" }, type: "A" }, { description: "Content selection", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-content_personalization]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-content_personalization]:last-child" }, type: "click" }, type: "E" }, { description: "Ad delivery", falseAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-ad_delivery]:first-child" }, type: "click" }, trueAction: { target: { selector: ".didomi-components-radio__option[aria-describedby=didomi-purpose-ad_delivery]:last-child" }, type: "click" }, type: "F" }], type: "consent" }, { action: { consents: [{ matcher: { childFilter: { target: { selector: ":not(.didomi-components-radio__option--selected)" } }, type: "css" }, trueAction: { target: { selector: ":nth-child(2)" }, type: "click" }, falseAction: { target: { selector: ":first-child" }, type: "click" }, type: "X" }], type: "consent" }, target: { selector: ".didomi-components-radio" }, type: "foreach" }], type: "list" }, name: "DO_CONSENT" }, { action: { parent: { selector: ".didomi-consent-popup-footer .didomi-consent-popup-actions" }, target: { selector: ".didomi-components-button:first-child" }, type: "click" }, name: "SAVE_CONSENT" }] }, oil: { detectors: [{ presentMatcher: { target: { selector: ".as-oil-content-overlay" }, type: "css" }, showingMatcher: { target: { selector: ".as-oil-content-overlay" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".as-js-advanced-settings" }, type: "click" }, { retries: "10", target: { selector: ".as-oil-cpc__purpose-container" }, type: "waitcss", waitTime: "250" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ consents: [{ matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Information storage and access", "Opbevaring af og adgang til oplysninger p\xE5 din enhed"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Information storage and access", "Opbevaring af og adgang til oplysninger p\xE5 din enhed"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "D" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personlige annoncer", "Personalisation"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personlige annoncer", "Personalisation"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Annoncevalg, levering og rapportering", "Ad selection, delivery, reporting"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Annoncevalg, levering og rapportering", "Ad selection, delivery, reporting"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personalisering af indhold", "Content selection, delivery, reporting"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personalisering af indhold", "Content selection, delivery, reporting"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "E" }, { matcher: { parent: { childFilter: { target: { selector: ".as-oil-cpc__purpose-header", textFilter: ["M\xE5ling", "Measurement"] } }, selector: ".as-oil-cpc__purpose-container" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { childFilter: { target: { selector: ".as-oil-cpc__purpose-header", textFilter: ["M\xE5ling", "Measurement"] } }, selector: ".as-oil-cpc__purpose-container" }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: "Google" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: "Google" }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, name: "DO_CONSENT" }, { action: { target: { selector: ".as-oil__btn-optin" }, type: "click" }, name: "SAVE_CONSENT" }, { action: { target: { selector: "div.as-oil" }, type: "hide" }, name: "HIDE_CMP" }] }, optanon: { detectors: [{ presentMatcher: { target: { selector: "#optanon-menu, .optanon-alert-box-wrapper" }, type: "css" }, showingMatcher: { target: { displayFilter: true, selector: ".optanon-alert-box-wrapper" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".optanon-alert-box-wrapper .optanon-toggle-display, a[onclick*='OneTrust.ToggleInfoDisplay()'], a[onclick*='Optanon.ToggleInfoDisplay()']" }, type: "click" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ target: { selector: ".preference-menu-item #Your-privacy" }, type: "click" }, { target: { selector: "#optanon-vendor-consent-text" }, type: "click" }, { action: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, target: { selector: "#optanon-vendor-consent-list .vendor-item" }, type: "foreach" }, { target: { selector: ".vendor-consent-back-link" }, type: "click" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-performance" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-performance" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-functional" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-functional" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-advertising" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-advertising" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-social" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-social" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Social Media Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Social Media Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalisation" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalisation" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Site monitoring cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Site monitoring cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Third party privacy-enhanced content" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Third party privacy-enhanced content" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Performance & Advertising Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Performance & Advertising Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Information storage and access" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Information storage and access" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "D" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad selection, delivery, reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad selection, delivery, reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content selection, delivery, reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content selection, delivery, reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Measurement" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Measurement" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Recommended Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Recommended Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Unclassified Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Unclassified Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Analytical Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Analytical Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Marketing Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Marketing Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalization" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalization" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad Selection, Delivery & Reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad Selection, Delivery & Reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content Selection, Delivery & Reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content Selection, Delivery & Reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }], type: "list" }, name: "DO_CONSENT" }, { action: { parent: { selector: ".optanon-save-settings-button" }, target: { selector: ".optanon-white-button-middle" }, type: "click" }, name: "SAVE_CONSENT" }, { action: { actions: [{ target: { selector: "#optanon-popup-wrapper" }, type: "hide" }, { target: { selector: "#optanon-popup-bg" }, type: "hide" }, { target: { selector: ".optanon-alert-box-wrapper" }, type: "hide" }], type: "list" }, name: "HIDE_CMP" }] }, quantcast2: { detectors: [{ presentMatcher: { target: { selector: "[data-tracking-opt-in-overlay]" }, type: "css" }, showingMatcher: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-learn-more]" }, type: "css" } }], methods: [{ action: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-learn-more]" }, type: "click" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ type: "wait", waitTime: 500 }, { action: { actions: [{ target: { selector: "div", textFilter: ["Information storage and access"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "D" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Personalization"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Ad selection, delivery, reporting"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Content selection, delivery, reporting"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "E" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Measurement"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "B" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Other Partners"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, type: "ifcss" }], type: "list" }, parent: { childFilter: { target: { selector: "input" } }, selector: "[data-tracking-opt-in-overlay] > div > div" }, target: { childFilter: { target: { selector: "input" } }, selector: ":scope > div" }, type: "foreach" }], type: "list" }, name: "DO_CONSENT" }, { action: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-save]" }, type: "click" }, name: "SAVE_CONSENT" }] }, springer: { detectors: [{ presentMatcher: { parent: null, target: { selector: ".cmp-app_gdpr" }, type: "css" }, showingMatcher: { parent: null, target: { displayFilter: true, selector: ".cmp-popup_popup" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".cmp-intro_rejectAll" }, type: "click" }, { type: "wait", waitTime: 250 }, { target: { selector: ".cmp-purposes_purposeItem:not(.cmp-purposes_selectedPurpose)" }, type: "click" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { consents: [{ matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Przechowywanie informacji na urz\u0105dzeniu lub dost\u0119p do nich", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Przechowywanie informacji na urz\u0105dzeniu lub dost\u0119p do nich", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "D" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r podstawowych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r podstawowych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Stosowanie bada\u0144 rynkowych w celu generowania opinii odbiorc\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Stosowanie bada\u0144 rynkowych w celu generowania opinii odbiorc\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "X" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Opracowywanie i ulepszanie produkt\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Opracowywanie i ulepszanie produkt\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "X" }], type: "consent" }, name: "DO_CONSENT" }, { action: { target: { selector: ".cmp-details_save" }, type: "click" }, name: "SAVE_CONSENT" }] }, wordpressgdpr: { detectors: [{ presentMatcher: { parent: null, target: { selector: ".wpgdprc-consent-bar" }, type: "css" }, showingMatcher: { parent: null, target: { displayFilter: true, selector: ".wpgdprc-consent-bar" }, type: "css" } }], methods: [{ action: { parent: null, target: { selector: ".wpgdprc-consent-bar .wpgdprc-consent-bar__settings", textFilter: null }, type: "click" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ target: { selector: ".wpgdprc-consent-modal .wpgdprc-button", textFilter: "Eyeota" }, type: "click" }, { consents: [{ description: "Eyeota Cookies", matcher: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Eyeota" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Eyeota" }, target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, { target: { selector: ".wpgdprc-consent-modal .wpgdprc-button", textFilter: "Advertising" }, type: "click" }, { consents: [{ description: "Advertising Cookies", matcher: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Advertising" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Advertising" }, target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, name: "DO_CONSENT" }, { action: { parent: null, target: { selector: ".wpgdprc-button", textFilter: "Save my settings" }, type: "click" }, name: "SAVE_CONSENT" }] } };
|
|
3783
|
+
var consentomatic = { oil: { detectors: [{ presentMatcher: { target: { selector: ".as-oil-content-overlay" }, type: "css" }, showingMatcher: { target: { selector: ".as-oil-content-overlay" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".as-js-advanced-settings" }, type: "click" }, { retries: "10", target: { selector: ".as-oil-cpc__purpose-container" }, type: "waitcss", waitTime: "250" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ consents: [{ matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Information storage and access", "Opbevaring af og adgang til oplysninger p\xE5 din enhed"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Information storage and access", "Opbevaring af og adgang til oplysninger p\xE5 din enhed"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "D" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personlige annoncer", "Personalisation"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personlige annoncer", "Personalisation"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Annoncevalg, levering og rapportering", "Ad selection, delivery, reporting"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Annoncevalg, levering og rapportering", "Ad selection, delivery, reporting"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personalisering af indhold", "Content selection, delivery, reporting"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personalisering af indhold", "Content selection, delivery, reporting"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "E" }, { matcher: { parent: { childFilter: { target: { selector: ".as-oil-cpc__purpose-header", textFilter: ["M\xE5ling", "Measurement"] } }, selector: ".as-oil-cpc__purpose-container" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { childFilter: { target: { selector: ".as-oil-cpc__purpose-header", textFilter: ["M\xE5ling", "Measurement"] } }, selector: ".as-oil-cpc__purpose-container" }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: "Google" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: "Google" }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, name: "DO_CONSENT" }, { action: { target: { selector: ".as-oil__btn-optin" }, type: "click" }, name: "SAVE_CONSENT" }, { action: { target: { selector: "div.as-oil" }, type: "hide" }, name: "HIDE_CMP" }] }, optanon: { detectors: [{ presentMatcher: { target: { selector: "#optanon-menu, .optanon-alert-box-wrapper" }, type: "css" }, showingMatcher: { target: { displayFilter: true, selector: ".optanon-alert-box-wrapper" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".optanon-alert-box-wrapper .optanon-toggle-display, a[onclick*='OneTrust.ToggleInfoDisplay()'], a[onclick*='Optanon.ToggleInfoDisplay()']" }, type: "click" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ target: { selector: ".preference-menu-item #Your-privacy" }, type: "click" }, { target: { selector: "#optanon-vendor-consent-text" }, type: "click" }, { action: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, target: { selector: "#optanon-vendor-consent-list .vendor-item" }, type: "foreach" }, { target: { selector: ".vendor-consent-back-link" }, type: "click" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-performance" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-performance" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-functional" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-functional" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-advertising" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-advertising" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-social" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-social" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Social Media Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Social Media Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalisation" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalisation" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Site monitoring cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Site monitoring cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Third party privacy-enhanced content" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Third party privacy-enhanced content" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Performance & Advertising Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Performance & Advertising Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Information storage and access" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Information storage and access" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "D" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad selection, delivery, reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad selection, delivery, reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content selection, delivery, reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content selection, delivery, reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Measurement" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Measurement" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Recommended Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Recommended Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Unclassified Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Unclassified Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Analytical Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Analytical Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Marketing Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Marketing Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalization" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalization" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad Selection, Delivery & Reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad Selection, Delivery & Reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content Selection, Delivery & Reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content Selection, Delivery & Reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }], type: "list" }, name: "DO_CONSENT" }, { action: { parent: { selector: ".optanon-save-settings-button" }, target: { selector: ".optanon-white-button-middle" }, type: "click" }, name: "SAVE_CONSENT" }, { action: { actions: [{ target: { selector: "#optanon-popup-wrapper" }, type: "hide" }, { target: { selector: "#optanon-popup-bg" }, type: "hide" }, { target: { selector: ".optanon-alert-box-wrapper" }, type: "hide" }], type: "list" }, name: "HIDE_CMP" }] }, quantcast2: { detectors: [{ presentMatcher: { target: { selector: "[data-tracking-opt-in-overlay]" }, type: "css" }, showingMatcher: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-learn-more]" }, type: "css" } }], methods: [{ action: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-learn-more]" }, type: "click" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ type: "wait", waitTime: 500 }, { action: { actions: [{ target: { selector: "div", textFilter: ["Information storage and access"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "D" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Personalization"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Ad selection, delivery, reporting"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Content selection, delivery, reporting"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "E" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Measurement"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "B" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Other Partners"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, type: "ifcss" }], type: "list" }, parent: { childFilter: { target: { selector: "input" } }, selector: "[data-tracking-opt-in-overlay] > div > div" }, target: { childFilter: { target: { selector: "input" } }, selector: ":scope > div" }, type: "foreach" }], type: "list" }, name: "DO_CONSENT" }, { action: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-save]" }, type: "click" }, name: "SAVE_CONSENT" }] }, springer: { detectors: [{ presentMatcher: { parent: null, target: { selector: ".cmp-app_gdpr" }, type: "css" }, showingMatcher: { parent: null, target: { displayFilter: true, selector: ".cmp-popup_popup" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".cmp-intro_rejectAll" }, type: "click" }, { type: "wait", waitTime: 250 }, { target: { selector: ".cmp-purposes_purposeItem:not(.cmp-purposes_selectedPurpose)" }, type: "click" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { consents: [{ matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Przechowywanie informacji na urz\u0105dzeniu lub dost\u0119p do nich", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Przechowywanie informacji na urz\u0105dzeniu lub dost\u0119p do nich", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "D" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r podstawowych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r podstawowych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Stosowanie bada\u0144 rynkowych w celu generowania opinii odbiorc\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Stosowanie bada\u0144 rynkowych w celu generowania opinii odbiorc\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "X" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Opracowywanie i ulepszanie produkt\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Opracowywanie i ulepszanie produkt\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "X" }], type: "consent" }, name: "DO_CONSENT" }, { action: { target: { selector: ".cmp-details_save" }, type: "click" }, name: "SAVE_CONSENT" }] }, wordpressgdpr: { detectors: [{ presentMatcher: { parent: null, target: { selector: ".wpgdprc-consent-bar" }, type: "css" }, showingMatcher: { parent: null, target: { displayFilter: true, selector: ".wpgdprc-consent-bar" }, type: "css" } }], methods: [{ action: { parent: null, target: { selector: ".wpgdprc-consent-bar .wpgdprc-consent-bar__settings", textFilter: null }, type: "click" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ target: { selector: ".wpgdprc-consent-modal .wpgdprc-button", textFilter: "Eyeota" }, type: "click" }, { consents: [{ description: "Eyeota Cookies", matcher: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Eyeota" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Eyeota" }, target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, { target: { selector: ".wpgdprc-consent-modal .wpgdprc-button", textFilter: "Advertising" }, type: "click" }, { consents: [{ description: "Advertising Cookies", matcher: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Advertising" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Advertising" }, target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, name: "DO_CONSENT" }, { action: { parent: null, target: { selector: ".wpgdprc-button", textFilter: "Save my settings" }, type: "click" }, name: "SAVE_CONSENT" }] } };
|
|
3771
3784
|
|
|
3772
3785
|
// playwright/content.ts
|
|
3773
3786
|
if (!window.autoconsentReceiveMessage) {
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# Using Autoconsent with Puppeteer
|
|
2
|
+
|
|
3
|
+
Autoconsent can be used with [Puppeteer](https://pptr.dev) via the bundled `dist/autoconsent.playwright.js` script. This self-contained IIFE expects two globals:
|
|
4
|
+
|
|
5
|
+
- `window.autoconsentSendMessage` — used by the content script to send messages from the page to Node.
|
|
6
|
+
- `window.autoconsentReceiveMessage` — used by Node to send messages back into the page.
|
|
7
|
+
|
|
8
|
+
Puppeteer's `page.exposeFunction` and `page.evaluateOnNewDocument` bridge the gap.
|
|
9
|
+
|
|
10
|
+
```javascript
|
|
11
|
+
import puppeteer from 'puppeteer'
|
|
12
|
+
import fs from 'fs'
|
|
13
|
+
import { dirname, resolve } from 'path'
|
|
14
|
+
import { fileURLToPath } from 'url'
|
|
15
|
+
|
|
16
|
+
const autoconsentScript = fs.readFileSync(
|
|
17
|
+
resolve(
|
|
18
|
+
dirname(fileURLToPath(import.meta.resolve('@duckduckgo/autoconsent'))),
|
|
19
|
+
'autoconsent.playwright.js'
|
|
20
|
+
),
|
|
21
|
+
'utf8'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
// Load the rule bundles shipped with the package
|
|
25
|
+
const rules = JSON.parse(
|
|
26
|
+
fs.readFileSync(
|
|
27
|
+
fileURLToPath(import.meta.resolve('@duckduckgo/autoconsent/rules/rules.json')),
|
|
28
|
+
'utf8'
|
|
29
|
+
)
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
// See https://github.com/duckduckgo/autoconsent/blob/main/docs/api.md
|
|
33
|
+
const autoconsentConfig = {
|
|
34
|
+
enabled: true,
|
|
35
|
+
autoAction: 'optOut',
|
|
36
|
+
disabledCmps: [],
|
|
37
|
+
enablePrehide: true,
|
|
38
|
+
enableCosmeticRules: true,
|
|
39
|
+
enableGeneratedRules: true,
|
|
40
|
+
detectRetries: 20,
|
|
41
|
+
isMainWorld: false,
|
|
42
|
+
prehideTimeout: 2000,
|
|
43
|
+
enableFilterList: false,
|
|
44
|
+
enableHeuristicDetection: true,
|
|
45
|
+
enableHeuristicAction: true,
|
|
46
|
+
logs: {
|
|
47
|
+
lifecycle: false,
|
|
48
|
+
rulesteps: false,
|
|
49
|
+
detectionsteps: false,
|
|
50
|
+
evals: false,
|
|
51
|
+
errors: true,
|
|
52
|
+
messages: false,
|
|
53
|
+
waits: false,
|
|
54
|
+
},
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const sendMessage = (page, message) =>
|
|
58
|
+
page
|
|
59
|
+
.evaluate(msg => {
|
|
60
|
+
if (window.autoconsentReceiveMessage) {
|
|
61
|
+
return window.autoconsentReceiveMessage(msg)
|
|
62
|
+
}
|
|
63
|
+
}, message)
|
|
64
|
+
.catch(() => {})
|
|
65
|
+
|
|
66
|
+
async function setupAutoconsent(page) {
|
|
67
|
+
await page.exposeFunction('autoconsentSendMessage', async message => {
|
|
68
|
+
if (!message || typeof message !== 'object') return
|
|
69
|
+
|
|
70
|
+
switch (message.type) {
|
|
71
|
+
case 'init':
|
|
72
|
+
return sendMessage(page, {
|
|
73
|
+
type: 'initResp',
|
|
74
|
+
config: autoconsentConfig,
|
|
75
|
+
rules, // must include rules or no CMPs will be detected
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
case 'eval': {
|
|
79
|
+
const result = await page.evaluate(message.code)
|
|
80
|
+
return sendMessage(page, {
|
|
81
|
+
type: 'evalResp',
|
|
82
|
+
id: message.id,
|
|
83
|
+
result,
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// informational messages — log or act on as needed
|
|
88
|
+
case 'cmpDetected':
|
|
89
|
+
console.log(`CMP detected: ${message.cmp}`)
|
|
90
|
+
break
|
|
91
|
+
case 'popupFound':
|
|
92
|
+
console.log(`Popup found: ${message.cmp}`)
|
|
93
|
+
break
|
|
94
|
+
case 'optOutResult':
|
|
95
|
+
console.log(`Opt-out result: ${message.result}`)
|
|
96
|
+
break
|
|
97
|
+
case 'autoconsentDone':
|
|
98
|
+
console.log(`Autoconsent done: ${message.cmp}`)
|
|
99
|
+
break
|
|
100
|
+
case 'autoconsentError':
|
|
101
|
+
console.error(`Autoconsent error:`, message.details)
|
|
102
|
+
break
|
|
103
|
+
}
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
await page.evaluateOnNewDocument(autoconsentScript)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
;(async () => {
|
|
110
|
+
const browser = await puppeteer.launch({ headless: 'new' })
|
|
111
|
+
const page = await browser.newPage()
|
|
112
|
+
|
|
113
|
+
await setupAutoconsent(page)
|
|
114
|
+
await page.goto('https://example.com', { waitUntil: 'load' })
|
|
115
|
+
|
|
116
|
+
// Re-run on the current document in case the page was already loaded
|
|
117
|
+
// before evaluateOnNewDocument had a chance to fire
|
|
118
|
+
await page.evaluate(autoconsentScript).catch(() => {})
|
|
119
|
+
|
|
120
|
+
// … continue with your automation
|
|
121
|
+
await browser.close()
|
|
122
|
+
})()
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## How it works
|
|
126
|
+
|
|
127
|
+
1. **`page.exposeFunction`** binds `window.autoconsentSendMessage` in the page, giving the content script a way to call back into Node.
|
|
128
|
+
2. **`page.evaluateOnNewDocument`** injects the content script so it runs before any page JavaScript, enabling early CMP detection and prehiding.
|
|
129
|
+
3. When the content script starts, it sends an `init` message. The Node-side handler replies with `initResp` containing both the config **and the rule bundles**, which triggers CMP detection and automatic opt-out.
|
|
130
|
+
4. `eval` messages are handled by running `page.evaluate(message.code)` in the main world, matching how the [Playwright test runner](../playwright/runner.ts) handles them.
|
|
131
|
+
5. A post-navigation `page.evaluate(autoconsentScript)` re-triggers the script on the current document, covering cases where the page loaded before the `evaluateOnNewDocument` hook was set up.
|
|
132
|
+
|
|
133
|
+
## Config reference
|
|
134
|
+
|
|
135
|
+
See the full `Config` type in [`lib/types.ts`](../lib/types.ts) and the [API documentation](./api.md) for details on all available options.
|
|
136
|
+
|
|
137
|
+
Key options:
|
|
138
|
+
|
|
139
|
+
| Option | Type | Default | Description |
|
|
140
|
+
|--------|------|---------|-------------|
|
|
141
|
+
| `enabled` | boolean | — | Master switch for autoconsent |
|
|
142
|
+
| `autoAction` | `'optOut' \| 'optIn' \| null` | — | Action to perform automatically when a popup is found |
|
|
143
|
+
| `enablePrehide` | boolean | — | Inject CSS early to prevent popup flicker |
|
|
144
|
+
| `enableCosmeticRules` | boolean | — | Enable rules that hide popups via CSS |
|
|
145
|
+
| `enableGeneratedRules` | boolean | — | Include auto-generated rules |
|
|
146
|
+
| `detectRetries` | number | — | How many times to retry CMP detection |
|
|
147
|
+
| `enableFilterList` | boolean | — | Enable ABP/uBO cosmetic filter support (requires the `/extra` build) |
|
|
148
|
+
|
|
149
|
+
## Rules
|
|
150
|
+
|
|
151
|
+
The `initResp` message **must** include a `rules` object. Without rules, no CMPs will be detected. The package ships pre-built rule bundles:
|
|
152
|
+
|
|
153
|
+
- `@duckduckgo/autoconsent/rules/rules.json` — full rules (includes `autoconsent` and `consentomatic` arrays)
|
|
154
|
+
- `@duckduckgo/autoconsent/rules/compact-rules.json` — compact encoding for opt-out only (smaller payload)
|
|
155
|
+
|
|
156
|
+
Load either file and pass it as the `rules` field in the `initResp` message.
|
package/lib/eval-snippets.ts
CHANGED
|
@@ -4,6 +4,19 @@
|
|
|
4
4
|
export const snippets = {
|
|
5
5
|
// code-based rules
|
|
6
6
|
EVAL_0: () => console.log(1),
|
|
7
|
+
EVAL_DIDOMI_OPT_OUT: () => {
|
|
8
|
+
if (window.Didomi) {
|
|
9
|
+
window.Didomi.setUserDisagreeToAll();
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
},
|
|
14
|
+
EVAL_DIDOMI_TEST: () => {
|
|
15
|
+
if (window.Didomi) {
|
|
16
|
+
return window.Didomi.getUserConsentStatusForAll().purposes.disabled.length > 0;
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
},
|
|
7
20
|
EVAL_CONSENTMANAGER_1: () => window.__cmp && typeof __cmp('getCMPData') === 'object',
|
|
8
21
|
EVAL_CONSENTMANAGER_2: () => !__cmp('consentStatus').userChoiceExists,
|
|
9
22
|
EVAL_CONSENTMANAGER_3: () => __cmp('setConsent', 0),
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -61,6 +61,10 @@ npm run watch
|
|
|
61
61
|
|
|
62
62
|
This will rebuild the extension on every source file change. You still need to refresh the extension in the browser to see the changes.
|
|
63
63
|
|
|
64
|
+
## Using with Puppeteer
|
|
65
|
+
|
|
66
|
+
See [puppeteer.md](./docs/puppeteer.md) for a full integration guide.
|
|
67
|
+
|
|
64
68
|
## Rules
|
|
65
69
|
|
|
66
70
|
The library's functionality is implemented as a set of rules that define how to manage consent on
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "consentmo",
|
|
3
|
+
"prehideSelectors": ["csm-cookie-consent"],
|
|
4
|
+
"detectCmp": [
|
|
5
|
+
{
|
|
6
|
+
"exists": ["csm-cookie-consent", ".csm-wrapper"]
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"detectPopup": [
|
|
10
|
+
{
|
|
11
|
+
"visible": ["csm-cookie-consent", ".csm-wrapper button"]
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"optIn": [
|
|
15
|
+
{
|
|
16
|
+
"waitForThenClick": ["csm-cookie-consent", ".csm-wrapper .cc-allow"]
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"optOut": [
|
|
20
|
+
{
|
|
21
|
+
"if": { "exists": ["csm-cookie-consent", ".csm-wrapper .cc-deny"] },
|
|
22
|
+
"then": [
|
|
23
|
+
{
|
|
24
|
+
"waitForThenClick": ["csm-cookie-consent", ".csm-wrapper .cc-deny"]
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"else": [
|
|
28
|
+
{
|
|
29
|
+
"waitForThenClick": ["csm-cookie-consent", ".csm-wrapper .cc-settings"]
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"waitForThenClick": ["csm-cookie-consent", ".csm-wrapper .cc-deny"]
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"test": [
|
|
38
|
+
{
|
|
39
|
+
"waitForVisible": ["csm-cookie-consent", ".csm-wrapper button"],
|
|
40
|
+
"timeout": 1000,
|
|
41
|
+
"check": "none"
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
}
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
],
|
|
24
24
|
"optOut": [
|
|
25
25
|
{
|
|
26
|
-
"
|
|
26
|
+
"if": { "exists": "#s-rall-bn" },
|
|
27
|
+
"then": [{ "waitForThenClick": "#s-rall-bn" }],
|
|
28
|
+
"else": [{ "waitForThenClick": "#c-s-bn" }, { "waitForThenClick": "#s-sv-bn" }]
|
|
27
29
|
}
|
|
28
30
|
],
|
|
29
31
|
"test": [
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "didomi",
|
|
3
|
+
"prehideSelectors": [
|
|
4
|
+
"#didomi-popup,.didomi-popup-container,.didomi-popup-notice,.didomi-consent-popup-preferences,#didomi-notice,.didomi-popup-backdrop,.didomi-screen-medium"
|
|
5
|
+
],
|
|
6
|
+
"detectCmp": [{ "visible": "#didomi-host" }],
|
|
7
|
+
"detectPopup": [
|
|
8
|
+
{
|
|
9
|
+
"visible": "#didomi-popup, #didomi-notice, .didomi-popup-notice, .didomi-notice-banner",
|
|
10
|
+
"check": "any"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"optIn": [{ "waitForThenClick": "#didomi-notice-agree-button" }],
|
|
14
|
+
"optOut": [
|
|
15
|
+
{
|
|
16
|
+
"if": { "exists": "#didomi-notice-disagree-button,.didomi-continue-without-agreeing" },
|
|
17
|
+
"then": [{ "waitForThenClick": "#didomi-notice-disagree-button,.didomi-continue-without-agreeing" }],
|
|
18
|
+
"else": [{ "eval": "EVAL_DIDOMI_OPT_OUT" }]
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"test": [{ "eval": "EVAL_DIDOMI_TEST" }]
|
|
22
|
+
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
{
|
|
29
29
|
"waitForThenClick": [
|
|
30
30
|
"div[consent-skip-blocker=\"1\"][id][data-bg] > dialog > div > div > div > div > div > a[role=button]:not([id])",
|
|
31
|
-
"xpath///span[contains(., ' ohne ') or contains(., 'without')]"
|
|
31
|
+
"xpath///span[contains(., ' ohne ') or contains(., 'without') or contains(., 'Ablehnen')]"
|
|
32
32
|
]
|
|
33
33
|
}
|
|
34
34
|
],
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "squarespace-cookie-banner",
|
|
3
|
+
"prehideSelectors": [".cookie-banner-mount-point"],
|
|
4
|
+
"detectCmp": [
|
|
5
|
+
{
|
|
6
|
+
"exists": ".cookie-banner-mount-point section[aria-label='Cookie banner']"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"detectPopup": [
|
|
10
|
+
{
|
|
11
|
+
"visible": ".cookie-banner-mount-point section[aria-label='Cookie banner']"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"optIn": [
|
|
15
|
+
{
|
|
16
|
+
"waitForThenClick": ".cookie-banner-mount-point button.accept"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"optOut": [
|
|
20
|
+
{
|
|
21
|
+
"waitForThenClick": ".cookie-banner-mount-point button.decline"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"test": [
|
|
25
|
+
{
|
|
26
|
+
"waitForVisible": ".cookie-banner-mount-point section[aria-label='Cookie banner']",
|
|
27
|
+
"timeout": 1000,
|
|
28
|
+
"check": "none"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
package/rules/build.ts
CHANGED
|
@@ -32,7 +32,7 @@ export async function buildConsentOMaticRules() {
|
|
|
32
32
|
// fetch ConsentOMatic rule set and merge with our custom rules
|
|
33
33
|
const consentOMaticCommit = '7d7fd2bd6bf2b662350b0eaeca74db6eba155efe';
|
|
34
34
|
const consentOMaticUrl = `https://raw.githubusercontent.com/cavi-au/Consent-O-Matic/${consentOMaticCommit}/Rules.json`;
|
|
35
|
-
const consentOMaticInclude = ['
|
|
35
|
+
const consentOMaticInclude = ['oil', 'optanon', 'quantcast2', 'springer', 'wordpressgdpr'];
|
|
36
36
|
const comRules: Record<string, object> = {};
|
|
37
37
|
const allComRules: Record<string, object> = await new Promise((resolve) => {
|
|
38
38
|
https.get(consentOMaticUrl, (res) => {
|