From 678895e2242300abadf9217129eb7943dddd35ee Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Wed, 29 Jan 2025 14:47:41 +0100 Subject: [PATCH] Fix rule validation issues --- lib/rules.ts | 3 ++- rules/autoconsent/dsgvo.json | 2 +- rules/autoconsent/johnlewis.json | 2 +- rules/autoconsent/true-car.json | 2 +- rules/autoconsent/twitter.json | 3 +-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/rules.ts b/lib/rules.ts index 04cd8b36..61f1c5d3 100644 --- a/lib/rules.ts +++ b/lib/rules.ts @@ -14,6 +14,7 @@ export type AutoConsentCMPRule = { optIn: AutoConsentRuleStep[]; openCmp?: AutoConsentRuleStep[]; test?: AutoConsentRuleStep[]; + comment?: string; }; export type RunContext = { @@ -24,7 +25,7 @@ export type RunContext = { export type ElementSelector = string | string[]; -export type AutoConsentRuleStep = { optional?: boolean } & Partial & +export type AutoConsentRuleStep = { optional?: boolean; comment?: string } & Partial & Partial & Partial & Partial & diff --git a/rules/autoconsent/dsgvo.json b/rules/autoconsent/dsgvo.json index 895eea1c..c75e9317 100644 --- a/rules/autoconsent/dsgvo.json +++ b/rules/autoconsent/dsgvo.json @@ -1,6 +1,6 @@ { "name": "WP DSGVO Tools", - "link": "https://wordpress.org/plugins/shapepress-dsgvo/", + "vendorUrl": "https://wordpress.org/plugins/shapepress-dsgvo/", "prehideSelectors": [".sp-dsgvo"], "cosmetic": true, "detectCmp": [{ "exists": ".sp-dsgvo.sp-dsgvo-popup-overlay" }], diff --git a/rules/autoconsent/johnlewis.json b/rules/autoconsent/johnlewis.json index 113b37e6..e0903bdd 100644 --- a/rules/autoconsent/johnlewis.json +++ b/rules/autoconsent/johnlewis.json @@ -5,7 +5,7 @@ "detectPopup": [{ "exists": "div[class^=pecr-cookie-banner-]" }], "optOut": [ { "click": "button[data-test^=manage-cookies]" }, - { "wait": "500" }, + { "wait": 500 }, { "click": "label[data-test^=toggle][class*=checked]:not([class*=disabled])", "all": true, diff --git a/rules/autoconsent/true-car.json b/rules/autoconsent/true-car.json index f3d3a829..5bedf5c5 100644 --- a/rules/autoconsent/true-car.json +++ b/rules/autoconsent/true-car.json @@ -4,7 +4,7 @@ "urlPattern": "^https://www\\.truecar\\.com/" }, "cosmetic": true, - "prehideSelectors": [["div[aria-labelledby=\"cookie-banner-heading\"]"]], + "prehideSelectors": ["div[aria-labelledby=\"cookie-banner-heading\"]"], "detectCmp": [{ "exists": "div[aria-labelledby=\"cookie-banner-heading\"]" }], "detectPopup": [{ "visible": "div[aria-labelledby=\"cookie-banner-heading\"]" }], "optIn": [{ "click": "div[aria-labelledby=\"cookie-banner-heading\"] > button[aria-label=\"Close\"]" }], diff --git a/rules/autoconsent/twitter.json b/rules/autoconsent/twitter.json index c6a15cce..5f5dffa1 100644 --- a/rules/autoconsent/twitter.json +++ b/rules/autoconsent/twitter.json @@ -15,6 +15,5 @@ { "waitForThenClick": "[data-testid=\"BottomBar\"] > div:has(>div:first-child>div:last-child>button[role=button]>span) > div:last-child > button[role=button]:last-child" } - ], - "TODOtest": [{ "eval": "EVAL_document.cookie.includes('d_prefs=MjoxLGNvbnNlbnRfdmVyc2lvbjoy')" }] + ] }