diff --git a/rules/autoconsent/medium.json b/rules/autoconsent/medium.json new file mode 100644 index 00000000..047dc0d9 --- /dev/null +++ b/rules/autoconsent/medium.json @@ -0,0 +1,31 @@ +{ + "name": "medium", + "vendorUrl": "https://medium.com", + "cosmetic": true, + "runContext": { + "main": true, + "frame": false, + "urlPattern": "^https://([a-z0-9-]+\\.)?medium\\.com/" + }, + "prehideSelectors": [], + "detectCmp": [ + { + "exists": "div:has(> div > div > div[role=alert] > a[href^=\"https://policy.medium.com/medium-privacy-policy-\"])" + } + ], + "detectPopup": [ + { + "visible": "div:has(> div > div > div[role=alert] > a[href^=\"https://policy.medium.com/medium-privacy-policy-\"])" + } + ], + "optIn": [ + { + "waitForThenClick": "[data-testid=close-button]" + } + ], + "optOut": [ + { + "hide": "div:has(> div > div > div[role=alert] > a[href^=\"https://policy.medium.com/medium-privacy-policy-\"])" + } + ] +} diff --git a/tests/medium.spec.ts b/tests/medium.spec.ts new file mode 100644 index 00000000..68043cb9 --- /dev/null +++ b/tests/medium.spec.ts @@ -0,0 +1,5 @@ +import generateCMPTests from "../playwright/runner"; + +generateCMPTests('medium', [ + 'https://medium.com/', +]);