@duckduckgo/autoconsent 10.0.0 → 10.1.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.
@@ -550,7 +550,13 @@
550
550
  EVAL_PUBTECH_0: () => document.cookie.includes("euconsent-v2") && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)),
551
551
  EVAL_REDDIT_0: () => document.cookie.includes("eu_cookie={%22opted%22:true%2C%22nonessential%22:false}"),
552
552
  EVAL_SIBBO_0: () => !!window.localStorage.getItem("euconsent-v2"),
553
- EVAL_SIRDATA_0: () => document.cookie.includes("euconsent-v2"),
553
+ EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
554
+ document.documentElement.classList.forEach((cls) => {
555
+ if (cls.startsWith("sd-cmp-"))
556
+ document.documentElement.classList.remove(cls);
557
+ });
558
+ return true;
559
+ },
554
560
  EVAL_SNIGEL_0: () => !!document.cookie.match("snconsent"),
555
561
  EVAL_STEAMPOWERED_0: () => JSON.parse(decodeURIComponent(document.cookie.split(";").find((s) => s.trim().startsWith("cookieSettings")).split("=")[1])).preference_state === 2,
556
562
  EVAL_SVT_TEST: () => document.cookie.includes('cookie-consent-1={"optedIn":true,"functionality":false,"statistics":false}'),
@@ -3358,7 +3364,8 @@
3358
3364
  },
3359
3365
  {
3360
3366
  click: ".cc-preferences[data-cc-preferences] input[type=radio][data-cc-action=toggle-category][value=off]",
3361
- all: true
3367
+ all: true,
3368
+ optional: true
3362
3369
  },
3363
3370
  {
3364
3371
  if: {
@@ -7501,6 +7508,7 @@
7501
7508
  },
7502
7509
  {
7503
7510
  name: "Sirdata",
7511
+ cosmetic: true,
7504
7512
  prehideSelectors: [
7505
7513
  "#sd-cmp"
7506
7514
  ],
@@ -7521,12 +7529,10 @@
7521
7529
  ],
7522
7530
  optOut: [
7523
7531
  {
7524
- waitForThenClick: "#sd-cmp .sd-cmp-1pO44"
7525
- }
7526
- ],
7527
- test: [
7532
+ hide: "#sd-cmp"
7533
+ },
7528
7534
  {
7529
- eval: "EVAL_SIRDATA_0"
7535
+ eval: "EVAL_SIRDATA_UNBLOCK_SCROLL"
7530
7536
  }
7531
7537
  ]
7532
7538
  },
@@ -93,7 +93,12 @@ export const snippets = {
93
93
  EVAL_PUBTECH_0: () => document.cookie.includes('euconsent-v2') && (document.cookie.match(/.YAAAAAAAAAAA/) || document.cookie.match(/.aAAAAAAAAAAA/) || document.cookie.match(/.YAAACFgAAAAA/)) ,
94
94
  EVAL_REDDIT_0: () => document.cookie.includes('eu_cookie={%22opted%22:true%2C%22nonessential%22:false}'),
95
95
  EVAL_SIBBO_0: () => !!window.localStorage.getItem('euconsent-v2'),
96
- EVAL_SIRDATA_0: () => document.cookie.includes('euconsent-v2'),
96
+ EVAL_SIRDATA_UNBLOCK_SCROLL: () => {
97
+ document.documentElement.classList.forEach(cls => {
98
+ if (cls.startsWith('sd-cmp-')) document.documentElement.classList.remove(cls)
99
+ });
100
+ return true;
101
+ },
97
102
  EVAL_SNIGEL_0: () => !!document.cookie.match('snconsent'),
98
103
  EVAL_STEAMPOWERED_0: () => JSON.parse(decodeURIComponent(document.cookie.split(';').find(s => s.trim().startsWith('cookieSettings')).split('=')[1])).preference_state === 2,
99
104
  EVAL_SVT_TEST: () => document.cookie.includes('cookie-consent-1={"optedIn":true,"functionality":false,"statistics":false}'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckduckgo/autoconsent",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "",
5
5
  "main": "dist/autoconsent.cjs.js",
6
6
  "module": "dist/autoconsent.esm.js",
@@ -13,7 +13,7 @@
13
13
  "else": [
14
14
  { "waitForThenClick": ".cc-banner[data-cc-banner] button[data-cc-action=preferences]" },
15
15
  { "waitFor": ".cc-preferences[data-cc-preferences]" },
16
- { "click": ".cc-preferences[data-cc-preferences] input[type=radio][data-cc-action=toggle-category][value=off]", "all": true },
16
+ { "click": ".cc-preferences[data-cc-preferences] input[type=radio][data-cc-action=toggle-category][value=off]", "all": true, "optional": true },
17
17
  {
18
18
  "if": { "exists": ".cc-preferences[data-cc-preferences] button[data-cc-action=reject]" },
19
19
  "then": [{ "click": ".cc-preferences[data-cc-preferences] button[data-cc-action=reject]" }],
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "Sirdata",
3
+ "cosmetic": true,
3
4
  "prehideSelectors": ["#sd-cmp"],
4
5
  "detectCmp": [{ "exists": "#sd-cmp" }],
5
6
  "detectPopup": [{ "visible": "#sd-cmp" }],
6
7
  "optIn": [ { "waitForThenClick": "#sd-cmp .sd-cmp-3cRQ2" } ],
7
- "optOut": [ { "waitForThenClick": "#sd-cmp .sd-cmp-1pO44" } ],
8
- "test": [
9
- { "eval": "EVAL_SIRDATA_0" }
8
+ "optOut": [
9
+ { "hide": "#sd-cmp" },
10
+ { "eval": "EVAL_SIRDATA_UNBLOCK_SCROLL" }
10
11
  ]
11
12
  }
package/rules/rules.json CHANGED
@@ -1057,7 +1057,8 @@
1057
1057
  },
1058
1058
  {
1059
1059
  "click": ".cc-preferences[data-cc-preferences] input[type=radio][data-cc-action=toggle-category][value=off]",
1060
- "all": true
1060
+ "all": true,
1061
+ "optional": true
1061
1062
  },
1062
1063
  {
1063
1064
  "if": {
@@ -5200,6 +5201,7 @@
5200
5201
  },
5201
5202
  {
5202
5203
  "name": "Sirdata",
5204
+ "cosmetic": true,
5203
5205
  "prehideSelectors": [
5204
5206
  "#sd-cmp"
5205
5207
  ],
@@ -5220,12 +5222,10 @@
5220
5222
  ],
5221
5223
  "optOut": [
5222
5224
  {
5223
- "waitForThenClick": "#sd-cmp .sd-cmp-1pO44"
5224
- }
5225
- ],
5226
- "test": [
5225
+ "hide": "#sd-cmp"
5226
+ },
5227
5227
  {
5228
- "eval": "EVAL_SIRDATA_0"
5228
+ "eval": "EVAL_SIRDATA_UNBLOCK_SCROLL"
5229
5229
  }
5230
5230
  ]
5231
5231
  },