@duckduckgo/autoconsent 18.6.0 → 18.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -61,6 +61,7 @@ export declare const snippets: {
61
61
  EVAL_NHNIEUWS_TEST: () => boolean;
62
62
  EVAL_OSANO_DETECT: () => boolean;
63
63
  EVAL_PANDECTES_TEST: () => boolean;
64
+ EVAL_POSTHOG_TEST: () => boolean;
64
65
  EVAL_POVR_GOBACK: () => boolean;
65
66
  EVAL_PUBTECH_0: () => false | RegExpMatchArray | null;
66
67
  EVAL_SHOPIFY_TEST: () => boolean;
@@ -219,6 +219,7 @@ export const snippets = {
219
219
  .split('=')[1],
220
220
  ),
221
221
  ).status === 'deny',
222
+ EVAL_POSTHOG_TEST: () => localStorage.getItem('cookie_consent') === 'acknowledged',
222
223
  EVAL_POVR_GOBACK: () => window.history.back() || true,
223
224
  EVAL_PUBTECH_0: () =>
224
225
  document.cookie.includes('euconsent-v2') &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckduckgo/autoconsent",
3
- "version": "18.6.0",
3
+ "version": "18.7.0",
4
4
  "description": "",
5
5
  "types": "./dist/types/web.d.ts",
6
6
  "exports": {
@@ -2,7 +2,11 @@
2
2
  "name": "burpee.com",
3
3
  "minimumRuleStepVersion": 2,
4
4
  "prehideSelectors": [".cookie-modal", "#notice-cookie-block"],
5
- "detectCmp": [{ "exists": "#notice-cookie-block" }, { "exists": "#notice-cookie-block #cm-selectSpecific", "negated": true }],
5
+ "detectCmp": [
6
+ { "exists": "#notice-cookie-block" },
7
+ { "exists": "#notice-cookie-block #cm-selectSpecific", "negated": true },
8
+ { "any": [{ "visible": "#notice-cookie-block" }, { "cookieContains": "user_allowed_save_cookie=", "negated": true }] }
9
+ ],
6
10
  "detectPopup": [{ "visible": "#html-body #notice-cookie-block" }],
7
11
  "optIn": [
8
12
  {
@@ -3,6 +3,16 @@
3
3
  "prehideSelectors": ["div[aria-labelledby=pwa-consent-layer-title]", "div[class^=StyledConsentLayerWrapper-]"],
4
4
  "detectCmp": [{ "exists": "div[aria-labelledby^=pwa-consent-layer-title]" }],
5
5
  "detectPopup": [{ "exists": "div[aria-labelledby^=pwa-consent-layer-title]" }],
6
- "optOut": [{ "click": "button[data-test^=pwa-consent-layer-deny-all]" }],
7
- "optIn": [{ "click": "button[data-test^=pwa-consent-layer-accept-all" }]
6
+ "optOut": [
7
+ {
8
+ "if": { "exists": "button[data-test^=pwa-consent-layer-deny-all]" },
9
+ "then": [{ "click": "button[data-test^=pwa-consent-layer-deny-all]" }],
10
+ "else": [
11
+ { "click": "form[data-test=pwa-consent-layer] [role=switch][aria-checked=true]", "all": true, "optional": true },
12
+ { "waitForThenClick": "button[data-test^=pwa-consent-layer-save-settings]" }
13
+ ]
14
+ }
15
+ ],
16
+ "optIn": [{ "click": "button[data-test^=pwa-consent-layer-accept-all]" }],
17
+ "test": [{ "wait": 1000 }, { "cookieContains": "|comfort:0" }]
8
18
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "posthog.com",
3
+ "runContext": { "urlPattern": "^https?://(www\\.)?posthog\\.com/" },
4
+ "detectCmp": [{ "exists": "xpath///li[contains(@class,'ToastRoot')][contains(., 'cookie banner')]" }],
5
+ "detectPopup": [{ "visible": "xpath///li[contains(@class,'ToastRoot')][contains(., 'cookie banner')]" }],
6
+ "optIn": [{ "waitForThenClick": "xpath///li[contains(@class,'ToastRoot')][contains(., 'cookie banner')]//button" }],
7
+ "optOut": [
8
+ { "waitForThenClick": "xpath///li[contains(@class,'ToastRoot')][contains(., 'cookie banner')]//button" },
9
+ { "waitForVisible": "xpath///li[contains(@class,'ToastRoot')][contains(., 'cookie banner')]", "check": "none" }
10
+ ],
11
+ "test": [{ "eval": "EVAL_POSTHOG_TEST" }]
12
+ }
@@ -15,7 +15,7 @@
15
15
  ],
16
16
  "optIn": [
17
17
  {
18
- "waitForThenClick": "#sd-cmp [data-sd-override='choiceButtons']"
18
+ "waitForThenClick": "#sd-cmp button:last-child > [data-sd-override='choiceButtons']"
19
19
  }
20
20
  ],
21
21
  "optOut": [
@@ -27,8 +27,16 @@
27
27
  "optOut": [
28
28
  {
29
29
  "waitForThenClick": "button[data-dca-intent=\"open\"][role=\"link\"]",
30
- "retry": 5,
31
- "retryInterval": 500
30
+ "retry": 10,
31
+ "retryInterval": 1000
32
+ },
33
+ {
34
+ "waitFor": "#advertisingCookies"
35
+ },
36
+ {
37
+ "click": "#personalizationCookies:checked, #advertisingCookies:checked",
38
+ "all": true,
39
+ "optional": true
32
40
  },
33
41
  {
34
42
  "waitForThenClick": "xpath///button[contains(., 'Save settings') or contains(., 'Enregistrer les paramètres')]"
@@ -39,6 +47,9 @@
39
47
  "waitForVisible": "a[href=\"https://www.walmartcanada.ca/cookie-notice\"]",
40
48
  "check": "none",
41
49
  "timeout": 5000
50
+ },
51
+ {
52
+ "cookieContains": "&p13n=false&ads=false&"
42
53
  }
43
54
  ]
44
55
  }
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "wbd-legal-terms",
3
3
  "vendorUrl": "https://www.wbd.com/",
4
- "comment": "Terms-and-cookies notice with only an Agree button. The <dialog> variant is modal, so hiding it with CSS leaves the page inert; close it without submitting the form instead. The MUI modal variant cannot be dismissed, so it is hidden. Sweepstakes pages only load their entry form (ngxFrame embed) after Agree, so the rule skips them to keep the popup available.",
4
+ "comment": "Terms-and-cookies notice with only an Agree button. The <dialog> variant is modal, so hiding it with CSS leaves the page inert; close it without submitting the form instead. The MUI modal variant cannot be dismissed, so it is hidden; its scroll lock is overridden with a stylesheet because the site re-applies it inline on client-side navigation. Sweepstakes pages only load their entry form (ngxFrame embed) after Agree, so the rule skips them to keep the popup available.",
5
5
  "cosmetic": true,
6
- "minimumRuleStepVersion": 2,
6
+ "minimumRuleStepVersion": 3,
7
7
  "detectCmp": [
8
8
  {
9
9
  "exists": "dialog#ltp-dialog, [id=\"id/ltp\"]"
@@ -44,9 +44,8 @@
44
44
  "hide": "[id=\"id/ltp\"]"
45
45
  },
46
46
  {
47
- "addStyle": "overflow: auto !important",
48
- "selector": "body",
49
- "optional": true
47
+ "stylesheet": "body:has([id=\"id/ltp\"]) { overflow: auto !important; }",
48
+ "stylesheetId": "wbd-legal-terms-scroll-unlock"
50
49
  }
51
50
  ]
52
51
  }