From 9c27f9ba2d8b6a3d0715460574160cd17d0b6d47 Mon Sep 17 00:00:00 2001 From: Maxim Tsoy Date: Fri, 17 Nov 2023 15:51:51 +0100 Subject: [PATCH] Fix tekealot.com on mobile --- lib/eval-snippets.ts | 1 + rules/autoconsent/takealot-com.json | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/eval-snippets.ts b/lib/eval-snippets.ts index b6865f44..bda0661c 100644 --- a/lib/eval-snippets.ts +++ b/lib/eval-snippets.ts @@ -70,6 +70,7 @@ export const snippets = { EVAL_SIRDATA_0: () => document.cookie.includes('euconsent-v2'), EVAL_SNIGEL_0: () => !!document.cookie.match('snconsent'), EVAL_STEAMPOWERED_0: () => JSON.parse(decodeURIComponent(document.cookie.split(';').find(s => s.trim().startsWith('cookieSettings')).split('=')[1])).preference_state === 2, + EVAL_TAKEALOT_0: () => document.body.classList.remove('freeze') || (document.body.style = '') || true, EVAL_TARTEAUCITRON_0: () => tarteaucitron.userInterface.respondAll(false) || true, EVAL_TARTEAUCITRON_1: () => tarteaucitron.userInterface.respondAll(true) || true, EVAL_TARTEAUCITRON_2: () => document.cookie.match(/tarteaucitron=[^;]*/)[0].includes('false'), diff --git a/rules/autoconsent/takealot-com.json b/rules/autoconsent/takealot-com.json index 0fec827c..68dcbb55 100644 --- a/rules/autoconsent/takealot-com.json +++ b/rules/autoconsent/takealot-com.json @@ -1,13 +1,18 @@ { "name": "takealot.com", "cosmetic": true, - "prehideSelectors": ["div[class^=\"cookies-banner-module_cookie-banner_\"]"], + "prehideSelectors": ["div[class^=\"cookies-banner-module_\"]"], "detectCmp": [{ "exists": "div[class^=\"cookies-banner-module_cookie-banner_\"]" }], "detectPopup": [{ "exists": "div[class^=\"cookies-banner-module_cookie-banner_\"]" }], "optIn": [ { "click": "button[class*=\"cookies-banner-module_dismiss-button_\"]" } ], "optOut": [ - { "hide": ["div[class^=\"cookies-banner-module_cookie-banner_\"]"] } + { "hide": ["div[class^=\"cookies-banner-module_\"]"] }, + { + "if": { "exists": "div[class^=\"cookies-banner-module_small-cookie-banner_\"]" }, + "then": [{ "eval": "EVAL_TAKEALOT_0"}], + "else": [] + } ] } \ No newline at end of file