Skip to content

Commit

Permalink
Fix rule validation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov committed Jan 29, 2025
1 parent 8a7631f commit 678895e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export type AutoConsentCMPRule = {
optIn: AutoConsentRuleStep[];
openCmp?: AutoConsentRuleStep[];
test?: AutoConsentRuleStep[];
comment?: string;
};

export type RunContext = {
Expand All @@ -24,7 +25,7 @@ export type RunContext = {

export type ElementSelector = string | string[];

export type AutoConsentRuleStep = { optional?: boolean } & Partial<ElementExistsRule> &
export type AutoConsentRuleStep = { optional?: boolean; comment?: string } & Partial<ElementExistsRule> &
Partial<ElementVisibleRule> &
Partial<EvalRule> &
Partial<WaitForRule> &
Expand Down
2 changes: 1 addition & 1 deletion rules/autoconsent/dsgvo.json
Original file line number Diff line number Diff line change
@@ -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" }],
Expand Down
2 changes: 1 addition & 1 deletion rules/autoconsent/johnlewis.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion rules/autoconsent/true-car.json
Original file line number Diff line number Diff line change
Expand Up @@ -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\"]" }],
Expand Down
3 changes: 1 addition & 2 deletions rules/autoconsent/twitter.json
Original file line number Diff line number Diff line change
Expand Up @@ -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')" }]
]
}

0 comments on commit 678895e

Please sign in to comment.