Skip to content

Commit

Permalink
Fix tekealot.com on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
muodov committed Nov 17, 2023
1 parent beebfa5 commit 9c27f9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/eval-snippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
9 changes: 7 additions & 2 deletions rules/autoconsent/takealot-com.json
Original file line number Diff line number Diff line change
@@ -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": []
}
]
}

0 comments on commit 9c27f9b

Please sign in to comment.