From de473bbb110075c990ac53ed1e59c0e53c7a055b Mon Sep 17 00:00:00 2001 From: HoJeong Go Date: Sat, 27 Jan 2024 00:32:54 +0900 Subject: [PATCH] Add rules from Jan 10 Ghostery fixes (#341) * Add a rule for canyon.com refs https://github.com/ghostery/broken-page-reports/issues/277 * Add a rule for transip.nl This website requires us to be redirect to opt-out. Successful test wasn't generated. * Add a rule for rog-forum.asus.com * Add a rule for hetzner.com * Add a rule for strato.de * Remove cosmetic flags --- rules/autoconsent/canyon-com.json | 18 +++++++++ rules/autoconsent/hetzner-com.json | 11 +++++ rules/autoconsent/rog-forum-asus-com.json | 14 +++++++ rules/autoconsent/strato-de.json | 20 +++++++++ rules/autoconsent/transip-nl.json | 49 +++++++++++++++++++++++ tests/canyon-com.spec.ts | 5 +++ tests/hetzner-com.spec.ts | 5 +++ tests/rog-forum-asus-com.spec.ts | 5 +++ tests/strato-de.spec.ts | 5 +++ 9 files changed, 132 insertions(+) create mode 100644 rules/autoconsent/canyon-com.json create mode 100644 rules/autoconsent/hetzner-com.json create mode 100644 rules/autoconsent/rog-forum-asus-com.json create mode 100644 rules/autoconsent/strato-de.json create mode 100644 rules/autoconsent/transip-nl.json create mode 100644 tests/canyon-com.spec.ts create mode 100644 tests/hetzner-com.spec.ts create mode 100644 tests/rog-forum-asus-com.spec.ts create mode 100644 tests/strato-de.spec.ts diff --git a/rules/autoconsent/canyon-com.json b/rules/autoconsent/canyon-com.json new file mode 100644 index 00000000..0d48d58d --- /dev/null +++ b/rules/autoconsent/canyon-com.json @@ -0,0 +1,18 @@ +{ + "name": "canyon.com", + "runContext": { + "urlPattern": "^https://www\\.canyon\\.com/" + }, + "prehideSelectors": ["div.modal.cookiesModal.is-open"], + "detectCmp": [{ "exists": "div.modal.cookiesModal.is-open" }], + "detectPopup": [{ "visible": "div.modal.cookiesModal.is-open" }], + "optIn": [{ "click": "div.cookiesModal__buttonWrapper > button[data-closecause=\"close-by-submit\"]" }], + "optOut": [ + { + "click": "div.cookiesModal__buttonWrapper > button[data-closecause=\"close-by-manage-cookies\"]" + }, + { + "waitForThenClick": "button#js-manage-data-privacy-save-button" + } + ] +} diff --git a/rules/autoconsent/hetzner-com.json b/rules/autoconsent/hetzner-com.json new file mode 100644 index 00000000..35f25701 --- /dev/null +++ b/rules/autoconsent/hetzner-com.json @@ -0,0 +1,11 @@ +{ + "name": "hetzner.com", + "runContext": { + "urlPattern": "^https://www\\.hetzner\\.com/" + }, + "prehideSelectors": ["#CookieConsent"], + "detectCmp": [{ "exists": "#CookieConsent" }], + "detectPopup": [{ "visible": "#CookieConsent" }], + "optIn": [{ "click": "#CookieConsentGiven" }], + "optOut": [{ "click": "#CookieConsentDeclined" }] +} diff --git a/rules/autoconsent/rog-forum-asus-com.json b/rules/autoconsent/rog-forum-asus-com.json new file mode 100644 index 00000000..fb1977c5 --- /dev/null +++ b/rules/autoconsent/rog-forum-asus-com.json @@ -0,0 +1,14 @@ +{ + "name": "rog-forum.asus.com", + "runContext": { + "urlPattern": "^https://rog-forum\\.asus\\.com/" + }, + "prehideSelectors": ["#cookie-policy-info"], + "detectCmp": [{ "exists": "#cookie-policy-info" }], + "detectPopup": [{ "visible": "#cookie-policy-info" }], + "optIn": [{ "click": "div.cookie-btn-box > div[aria-label=\"Accept\"]" }], + "optOut": [ + { "click": "div.cookie-btn-box > div[aria-label=\"Reject\"]" }, + { "waitForThenClick": ".cookie-policy-lightbox-bottom > div[aria-label=\"Save Settings\"]" } + ] +} diff --git a/rules/autoconsent/strato-de.json b/rules/autoconsent/strato-de.json new file mode 100644 index 00000000..c62cb291 --- /dev/null +++ b/rules/autoconsent/strato-de.json @@ -0,0 +1,20 @@ +{ + "name": "strato.de", + "prehideSelectors": ["#cookie_initial_modal", ".modal-backdrop"], + "runContext": { + "urlPattern": "^https://www\\.strato\\.de/" + }, + "detectCmp": [{ "exists": "#cookie_initial_modal" }], + "detectPopup": [{ "visible": "#cookie_initial_modal" }], + "optIn": [{ + "click": "button#jss_consent_all_initial_modal" + }], + "optOut": [ + { + "click": "button#jss_open_settings_modal" + }, + { + "click": "button#jss_consent_checked" + } + ] +} diff --git a/rules/autoconsent/transip-nl.json b/rules/autoconsent/transip-nl.json new file mode 100644 index 00000000..063e00f1 --- /dev/null +++ b/rules/autoconsent/transip-nl.json @@ -0,0 +1,49 @@ +{ + "name": "transip-nl", + "runContext": { + "urlPattern": "^https://www\\.transip\\.nl/" + }, + "prehideSelectors": ["#consent-modal"], + "detectCmp": [{ + "any": [ + { + "exists": "#consent-modal" + }, + { + "exists": "#privacy-settings-content" + } + ] + }], + "detectPopup": [{ + "any": [ + { + "visible": "#consent-modal" + }, + { + "visible": "#privacy-settings-content" + } + ] + }], + "optIn": [ + { + "click": "button[type=\"submit\"]" + } + ], + "optOut": [ + { + "if": { + "exists": "#privacy-settings-content" + }, + "then": [ + { + "click": "button[type=\"submit\"]" + } + ], + "else": [ + { + "click": "div.one-modal__action-footer-column--secondary > a" + } + ] + } + ] +} diff --git a/tests/canyon-com.spec.ts b/tests/canyon-com.spec.ts new file mode 100644 index 00000000..e2eca3f4 --- /dev/null +++ b/tests/canyon-com.spec.ts @@ -0,0 +1,5 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('canyon.com', [ + 'https://www.canyon.com/en-us/' +], {}); diff --git a/tests/hetzner-com.spec.ts b/tests/hetzner-com.spec.ts new file mode 100644 index 00000000..fea4adb5 --- /dev/null +++ b/tests/hetzner-com.spec.ts @@ -0,0 +1,5 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('hetzner.com', [ + 'https://www.hetzner.com/news/12-22-cloud-usa', +]); diff --git a/tests/rog-forum-asus-com.spec.ts b/tests/rog-forum-asus-com.spec.ts new file mode 100644 index 00000000..f6722d1e --- /dev/null +++ b/tests/rog-forum-asus-com.spec.ts @@ -0,0 +1,5 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('rog-forum.asus.com', [ + 'https://rog-forum.asus.com/' +], {}); diff --git a/tests/strato-de.spec.ts b/tests/strato-de.spec.ts new file mode 100644 index 00000000..c5d1610d --- /dev/null +++ b/tests/strato-de.spec.ts @@ -0,0 +1,5 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('strato.de', [ + 'https://www.strato.de/apps/CustomerService', +], {});