@duckduckgo/autoconsent 9.2.0 → 9.3.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.
@@ -770,6 +770,38 @@
770
770
  }
771
771
  ]
772
772
  },
773
+ {
774
+ "name": "canyon.com",
775
+ "runContext": {
776
+ "urlPattern": "^https://www\\.canyon\\.com/"
777
+ },
778
+ "prehideSelectors": [
779
+ "div.modal.cookiesModal.is-open"
780
+ ],
781
+ "detectCmp": [
782
+ {
783
+ "exists": "div.modal.cookiesModal.is-open"
784
+ }
785
+ ],
786
+ "detectPopup": [
787
+ {
788
+ "visible": "div.modal.cookiesModal.is-open"
789
+ }
790
+ ],
791
+ "optIn": [
792
+ {
793
+ "click": "div.cookiesModal__buttonWrapper > button[data-closecause=\"close-by-submit\"]"
794
+ }
795
+ ],
796
+ "optOut": [
797
+ {
798
+ "click": "div.cookiesModal__buttonWrapper > button[data-closecause=\"close-by-manage-cookies\"]"
799
+ },
800
+ {
801
+ "waitForThenClick": "button#js-manage-data-privacy-save-button"
802
+ }
803
+ ]
804
+ },
773
805
  {
774
806
  "name": "cc-banner-springer",
775
807
  "prehideSelectors": [
@@ -2116,7 +2148,7 @@
2116
2148
  "waitFor": "#ez-cookie-dialog input[type=checkbox]"
2117
2149
  },
2118
2150
  {
2119
- "click": "#ez-cookie-dialog input[type=checkbox][checked]",
2151
+ "click": "#ez-cookie-dialog input[type=checkbox]:checked",
2120
2152
  "all": true
2121
2153
  },
2122
2154
  {
@@ -2413,6 +2445,35 @@
2413
2445
  }
2414
2446
  ]
2415
2447
  },
2448
+ {
2449
+ "name": "hetzner.com",
2450
+ "runContext": {
2451
+ "urlPattern": "^https://www\\.hetzner\\.com/"
2452
+ },
2453
+ "prehideSelectors": [
2454
+ "#CookieConsent"
2455
+ ],
2456
+ "detectCmp": [
2457
+ {
2458
+ "exists": "#CookieConsent"
2459
+ }
2460
+ ],
2461
+ "detectPopup": [
2462
+ {
2463
+ "visible": "#CookieConsent"
2464
+ }
2465
+ ],
2466
+ "optIn": [
2467
+ {
2468
+ "click": "#CookieConsentGiven"
2469
+ }
2470
+ ],
2471
+ "optOut": [
2472
+ {
2473
+ "click": "#CookieConsentDeclined"
2474
+ }
2475
+ ]
2476
+ },
2416
2477
  {
2417
2478
  "name": "hl.co.uk",
2418
2479
  "prehideSelectors": [
@@ -4019,6 +4080,38 @@
4019
4080
  }
4020
4081
  ]
4021
4082
  },
4083
+ {
4084
+ "name": "rog-forum.asus.com",
4085
+ "runContext": {
4086
+ "urlPattern": "^https://rog-forum\\.asus\\.com/"
4087
+ },
4088
+ "prehideSelectors": [
4089
+ "#cookie-policy-info"
4090
+ ],
4091
+ "detectCmp": [
4092
+ {
4093
+ "exists": "#cookie-policy-info"
4094
+ }
4095
+ ],
4096
+ "detectPopup": [
4097
+ {
4098
+ "visible": "#cookie-policy-info"
4099
+ }
4100
+ ],
4101
+ "optIn": [
4102
+ {
4103
+ "click": "div.cookie-btn-box > div[aria-label=\"Accept\"]"
4104
+ }
4105
+ ],
4106
+ "optOut": [
4107
+ {
4108
+ "click": "div.cookie-btn-box > div[aria-label=\"Reject\"]"
4109
+ },
4110
+ {
4111
+ "waitForThenClick": ".cookie-policy-lightbox-bottom > div[aria-label=\"Save Settings\"]"
4112
+ }
4113
+ ]
4114
+ },
4022
4115
  {
4023
4116
  "name": "roofingmegastore.co.uk",
4024
4117
  "runContext": {
@@ -4261,6 +4354,39 @@
4261
4354
  }
4262
4355
  ]
4263
4356
  },
4357
+ {
4358
+ "name": "strato.de",
4359
+ "prehideSelectors": [
4360
+ "#cookie_initial_modal",
4361
+ ".modal-backdrop"
4362
+ ],
4363
+ "runContext": {
4364
+ "urlPattern": "^https://www\\.strato\\.de/"
4365
+ },
4366
+ "detectCmp": [
4367
+ {
4368
+ "exists": "#cookie_initial_modal"
4369
+ }
4370
+ ],
4371
+ "detectPopup": [
4372
+ {
4373
+ "visible": "#cookie_initial_modal"
4374
+ }
4375
+ ],
4376
+ "optIn": [
4377
+ {
4378
+ "click": "button#jss_consent_all_initial_modal"
4379
+ }
4380
+ ],
4381
+ "optOut": [
4382
+ {
4383
+ "click": "button#jss_open_settings_modal"
4384
+ },
4385
+ {
4386
+ "click": "button#jss_consent_checked"
4387
+ }
4388
+ ]
4389
+ },
4264
4390
  {
4265
4391
  "name": "takealot.com",
4266
4392
  "cosmetic": true,
@@ -4697,6 +4823,61 @@
4697
4823
  }
4698
4824
  ]
4699
4825
  },
4826
+ {
4827
+ "name": "transip-nl",
4828
+ "runContext": {
4829
+ "urlPattern": "^https://www\\.transip\\.nl/"
4830
+ },
4831
+ "prehideSelectors": [
4832
+ "#consent-modal"
4833
+ ],
4834
+ "detectCmp": [
4835
+ {
4836
+ "any": [
4837
+ {
4838
+ "exists": "#consent-modal"
4839
+ },
4840
+ {
4841
+ "exists": "#privacy-settings-content"
4842
+ }
4843
+ ]
4844
+ }
4845
+ ],
4846
+ "detectPopup": [
4847
+ {
4848
+ "any": [
4849
+ {
4850
+ "visible": "#consent-modal"
4851
+ },
4852
+ {
4853
+ "visible": "#privacy-settings-content"
4854
+ }
4855
+ ]
4856
+ }
4857
+ ],
4858
+ "optIn": [
4859
+ {
4860
+ "click": "button[type=\"submit\"]"
4861
+ }
4862
+ ],
4863
+ "optOut": [
4864
+ {
4865
+ "if": {
4866
+ "exists": "#privacy-settings-content"
4867
+ },
4868
+ "then": [
4869
+ {
4870
+ "click": "button[type=\"submit\"]"
4871
+ }
4872
+ ],
4873
+ "else": [
4874
+ {
4875
+ "click": "div.one-modal__action-footer-column--secondary > a"
4876
+ }
4877
+ ]
4878
+ }
4879
+ ]
4880
+ },
4700
4881
  {
4701
4882
  "name": "tropicfeel-com",
4702
4883
  "prehideSelectors": [
@@ -4946,7 +5127,7 @@
4946
5127
  {
4947
5128
  "any": [
4948
5129
  {
4949
- "waitForThenClick": "button.p-button"
5130
+ "waitForThenClick": "button.js-manage"
4950
5131
  },
4951
5132
  {
4952
5133
  "waitForThenClick": "xpath///*[@id=\"cookie-policy-content\"]/p[4]/button[2]"
@@ -4954,14 +5135,15 @@
4954
5135
  ]
4955
5136
  },
4956
5137
  {
4957
- "waitForThenClick": ".p-switch__input:checked",
5138
+ "waitForThenClick": "dialog.cookie-policy .p-switch__input:checked",
4958
5139
  "optional": true,
4959
- "all": true
5140
+ "all": true,
5141
+ "timeout": 500
4960
5142
  },
4961
5143
  {
4962
5144
  "any": [
4963
5145
  {
4964
- "waitForThenClick": "div > button"
5146
+ "waitForThenClick": "dialog.cookie-policy .js-save-preferences"
4965
5147
  },
4966
5148
  {
4967
5149
  "waitForThenClick": "xpath///*[@id=\"modal\"]/div/button"
@@ -539,7 +539,7 @@ var snippets = {
539
539
  EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
540
540
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
541
541
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
542
- EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
542
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
543
543
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
544
544
  EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
545
545
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
@@ -582,7 +582,7 @@ var snippets = {
582
582
  EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
583
583
  EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
584
584
  EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
585
- EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
585
+ EVAL_UBUNTU_COM_0: () => document.cookie.includes("_cookies_accepted=essential"),
586
586
  EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
587
587
  EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
588
588
  EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
@@ -974,6 +974,12 @@ function isElementVisible(elem) {
974
974
  }
975
975
  return false;
976
976
  }
977
+ function copyObject(data) {
978
+ if (globalThis.structuredClone) {
979
+ return structuredClone(data);
980
+ }
981
+ return JSON.parse(JSON.stringify(data));
982
+ }
977
983
  function normalizeConfig(providedConfig) {
978
984
  const defaultConfig = {
979
985
  enabled: true,
@@ -993,7 +999,7 @@ function normalizeConfig(providedConfig) {
993
999
  messages: false
994
1000
  }
995
1001
  };
996
- const updatedConfig = structuredClone(defaultConfig);
1002
+ const updatedConfig = copyObject(defaultConfig);
997
1003
  for (const key of Object.keys(defaultConfig)) {
998
1004
  if (typeof providedConfig[key] !== "undefined") {
999
1005
  updatedConfig[key] = providedConfig[key];
@@ -514,7 +514,7 @@ var snippets = {
514
514
  EVAL_EU_COOKIE_COMPLIANCE_0: () => document.cookie.indexOf("cookie-agreed=2") === -1,
515
515
  EVAL_EU_COOKIE_LAW_0: () => !document.cookie.includes("euCookie"),
516
516
  EVAL_EZOIC_0: () => ezCMP.handleAcceptAllClick(),
517
- EVAL_EZOIC_1: () => !!document.cookie.match(/ezCMPCookieConsent=[^;]+\|2=0\|3=0\|4=0/),
517
+ EVAL_EZOIC_1: () => !!document.cookie.match(/ez-consent-tcf/),
518
518
  EVAL_GOOGLE_0: () => !!document.cookie.match(/SOCS=CAE/),
519
519
  EVAL_HEMA_TEST_0: () => document.cookie.includes("cookies_rejected=1"),
520
520
  EVAL_IUBENDA_0: () => document.querySelectorAll(".purposes-item input[type=checkbox]:not([disabled])").forEach((x) => {
@@ -557,7 +557,7 @@ var snippets = {
557
557
  EVAL_THEFREEDICTIONARY_0: () => cmpUi.showPurposes() || cmpUi.rejectAll() || true,
558
558
  EVAL_THEFREEDICTIONARY_1: () => cmpUi.allowAll() || true,
559
559
  EVAL_THEVERGE_0: () => document.cookie.includes("_duet_gdpr_acknowledged=1"),
560
- EVAL_UBUNTU_COM_0: () => document.cookie === "_cookies_accepted=essential",
560
+ EVAL_UBUNTU_COM_0: () => document.cookie.includes("_cookies_accepted=essential"),
561
561
  EVAL_UK_COOKIE_CONSENT_0: () => !document.cookie.includes("catAccCookies"),
562
562
  EVAL_USERCENTRICS_API_0: () => typeof UC_UI === "object",
563
563
  EVAL_USERCENTRICS_API_1: () => !!UC_UI.closeCMP(),
@@ -949,6 +949,12 @@ function isElementVisible(elem) {
949
949
  }
950
950
  return false;
951
951
  }
952
+ function copyObject(data) {
953
+ if (globalThis.structuredClone) {
954
+ return structuredClone(data);
955
+ }
956
+ return JSON.parse(JSON.stringify(data));
957
+ }
952
958
  function normalizeConfig(providedConfig) {
953
959
  const defaultConfig = {
954
960
  enabled: true,
@@ -968,7 +974,7 @@ function normalizeConfig(providedConfig) {
968
974
  messages: false
969
975
  }
970
976
  };
971
- const updatedConfig = structuredClone(defaultConfig);
977
+ const updatedConfig = copyObject(defaultConfig);
972
978
  for (const key of Object.keys(defaultConfig)) {
973
979
  if (typeof providedConfig[key] !== "undefined") {
974
980
  updatedConfig[key] = providedConfig[key];