@duckduckgo/autoconsent 16.20.0 → 16.21.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.
Files changed (41) hide show
  1. package/.github/workflows/asana-sync.yml +2 -1
  2. package/CHANGELOG.md +41 -0
  3. package/data/coverage.json +1362 -1255
  4. package/dist/addon-firefox/background.bundle.js +1 -0
  5. package/dist/addon-firefox/compact-rules.json +1 -1
  6. package/dist/addon-firefox/content.bundle.js +1 -0
  7. package/dist/addon-firefox/manifest.json +1 -1
  8. package/dist/addon-firefox/rule-index.json +1 -1
  9. package/dist/addon-firefox/rules.json +1 -1
  10. package/dist/addon-mv3/background.bundle.js +1 -0
  11. package/dist/addon-mv3/compact-rules.json +1 -1
  12. package/dist/addon-mv3/content.bundle.js +1 -0
  13. package/dist/addon-mv3/manifest.json +1 -1
  14. package/dist/addon-mv3/rule-index.json +1 -1
  15. package/dist/addon-mv3/rules.json +1 -1
  16. package/dist/autoconsent.cjs.js +1 -0
  17. package/dist/autoconsent.esm.js +1 -0
  18. package/dist/autoconsent.playwright.js +1 -0
  19. package/dist/autoconsent.standalone.js +2 -1
  20. package/dist/types/eval-snippets.d.ts +1 -0
  21. package/lib/eval-snippets.ts +1 -0
  22. package/package.json +1 -1
  23. package/rules/autoconsent/aylo-cookie-banner.json +59 -4
  24. package/rules/autoconsent/cookie-banner-element.json +8 -0
  25. package/rules/autoconsent/ctv-disneyonice.json +12 -0
  26. package/rules/autoconsent/fever.json +42 -0
  27. package/rules/autoconsent/ibanez.json +13 -0
  28. package/rules/autoconsent/scmp.json +0 -1
  29. package/rules/autoconsent/simplehuman-com.json +33 -0
  30. package/rules/autoconsent/toho-one.json +50 -0
  31. package/rules/autoconsent/tohotheater-jp.json +20 -0
  32. package/rules/compact-rules.json +1 -1
  33. package/rules/rule-index.json +1 -1
  34. package/rules/rules.json +1 -1
  35. package/tests/cookie-banner-element.spec.ts +7 -0
  36. package/tests/ctv-disneyonice.spec.ts +5 -0
  37. package/tests/fever.spec.ts +3 -0
  38. package/tests/ibanez.spec.ts +3 -0
  39. package/tests/simplehuman-com.spec.ts +3 -0
  40. package/tests/toho-one.spec.ts +3 -0
  41. package/tests/tohotheater-jp.spec.ts +3 -0
@@ -21,6 +21,7 @@ export declare const snippets: {
21
21
  EVAL_TRUSTARC_FRAME_GTM: () => any;
22
22
  EVAL_ADOPT_TEST: () => boolean;
23
23
  EVAL_ADULTFRIENDFINDER_TEST: () => boolean;
24
+ EVAL_AYLO_COOKIE_MANAGER_READY: () => boolean;
24
25
  EVAL_BAHN_TEST: () => boolean;
25
26
  EVAL_BIGCOMMERCE_CONSENT_MANAGER_DETECT: () => boolean;
26
27
  EVAL_BORLABS_0: () => boolean;
@@ -82,6 +82,7 @@ export const snippets = {
82
82
  // declarative rules
83
83
  EVAL_ADOPT_TEST: () => !!localStorage.getItem('adoptConsentMode'),
84
84
  EVAL_ADULTFRIENDFINDER_TEST: () => !!localStorage.getItem('cookieConsent'),
85
+ EVAL_AYLO_COOKIE_MANAGER_READY: () => !!(window.wl_cookie_consent_manager || window._Cookie_Consent_Manager_brand),
85
86
  EVAL_BAHN_TEST: () => utag.gdpr.getSelectedCategories().length === 1,
86
87
  EVAL_BIGCOMMERCE_CONSENT_MANAGER_DETECT: () => !!(window.consentManager && window.consentManager.version),
87
88
  EVAL_BORLABS_0: () =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckduckgo/autoconsent",
3
- "version": "16.20.0",
3
+ "version": "16.21.0",
4
4
  "description": "",
5
5
  "types": "./dist/types/web.d.ts",
6
6
  "exports": {
@@ -19,17 +19,65 @@
19
19
  {
20
20
  "visible": "#age_disclaimer_window,#ageDisclaimerWrapper",
21
21
  "check": "none"
22
+ },
23
+ {
24
+ "any": [
25
+ {
26
+ "visible": "#cookie_consent_wrapper.non_cookie_consent_wrapper #js_cookieBannerCloseBtn"
27
+ },
28
+ {
29
+ "eval": "EVAL_AYLO_COOKIE_MANAGER_READY"
30
+ }
31
+ ]
22
32
  }
23
33
  ],
24
34
  "optIn": [
25
35
  {
26
- "waitForThenClick": "#cookie_consent_wrapper #consent_accept_all, #manage_cookie_consent_modal #modal_consent_accept_all"
36
+ "if": {
37
+ "visible": "#cookie_consent_wrapper #consent_accept_all"
38
+ },
39
+ "then": [
40
+ {
41
+ "waitForThenClick": "#cookie_consent_wrapper #consent_accept_all"
42
+ }
43
+ ],
44
+ "else": [
45
+ {
46
+ "waitForThenClick": "#manage_cookie_consent_modal #modal_consent_accept_all"
47
+ }
48
+ ]
27
49
  }
28
50
  ],
29
51
  "optOut": [
30
52
  {
31
- "waitForThenClick": "#cookie_consent_wrapper #consent_accept_essential, #manage_cookie_consent_modal #modal_consent_accept_essential",
32
- "all": true
53
+ "if": {
54
+ "visible": "#cookie_consent_wrapper #consent_accept_essential"
55
+ },
56
+ "then": [
57
+ {
58
+ "waitForThenClick": "#cookie_consent_wrapper #consent_accept_essential"
59
+ }
60
+ ],
61
+ "else": [
62
+ {
63
+ "if": {
64
+ "visible": "#cookie_consent_wrapper #js_cookieBannerCloseBtn"
65
+ },
66
+ "then": [
67
+ {
68
+ "wait": 8000
69
+ },
70
+ {
71
+ "waitForThenClick": "#cookie_consent_wrapper #js_cookieBannerCloseBtn"
72
+ }
73
+ ],
74
+ "else": [
75
+ {
76
+ "waitForThenClick": "#manage_cookie_consent_modal #modal_consent_accept_essential"
77
+ }
78
+ ]
79
+ }
80
+ ]
33
81
  },
34
82
  {
35
83
  "waitForThenClick": "#cookie_consent_min_wrapper #close_minimized_banner",
@@ -39,7 +87,14 @@
39
87
  ],
40
88
  "test": [
41
89
  {
42
- "cookieContains": "cookieConsent=1"
90
+ "any": [
91
+ {
92
+ "cookieContains": "cookieConsent=1"
93
+ },
94
+ {
95
+ "cookieContains": "cookieConsent=5"
96
+ }
97
+ ]
43
98
  }
44
99
  ]
45
100
  }
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "cookie-banner-element",
3
+ "prehideSelectors": ["cookie-banner-element#ckb"],
4
+ "detectCmp": [{ "exists": "cookie-banner-element#ckb" }],
5
+ "detectPopup": [{ "visible": ["cookie-banner-element#ckb", "#ckb[role=\"dialog\"]"] }],
6
+ "optIn": [{ "waitForThenClick": ["cookie-banner-element#ckb", "#cky"] }],
7
+ "optOut": [{ "waitForThenClick": ["cookie-banner-element#ckb", "#ckn"] }]
8
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "ctv-disneyonice",
3
+ "runContext": {
4
+ "urlPattern": "^https://www\\.ctv\\.co\\.jp/disneyonice(?:/|[?#]|$)"
5
+ },
6
+ "prehideSelectors": [".box-cookie"],
7
+ "detectCmp": [{ "exists": ".box-cookie .box-cookie__inner" }],
8
+ "detectPopup": [{ "visible": ".box-cookie .box-cookie__inner" }],
9
+ "optIn": [{ "waitForThenClick": ".box-cookie .btn-normal.is-small" }],
10
+ "optOut": [{ "waitForThenClick": ".box-cookie .btn-normal.is-small" }],
11
+ "test": [{ "cookieContains": "disney_cc=ok" }]
12
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "fever",
3
+ "prehideSelectors": ["astro-island[component-url*=\"CookiesBanner\"] .cookies"],
4
+ "detectCmp": [
5
+ {
6
+ "exists": "astro-island[component-url*=\"CookiesBanner\"] .cookies button.cookies__buttons--settings"
7
+ }
8
+ ],
9
+ "detectPopup": [
10
+ {
11
+ "visible": "astro-island[component-url*=\"CookiesBanner\"] .cookies"
12
+ }
13
+ ],
14
+ "optIn": [
15
+ {
16
+ "waitForThenClick": "astro-island[component-url*=\"CookiesBanner\"] .cookies button.cookies__buttons--accept"
17
+ }
18
+ ],
19
+ "optOut": [
20
+ {
21
+ "waitForThenClick": "astro-island[component-url*=\"CookiesBanner\"] .cookies button.cookies__buttons--settings"
22
+ },
23
+ {
24
+ "if": {
25
+ "exists": "astro-island[component-url*=\"CookiesBanner\"] .cookies input[name=\"targeting\"]:checked"
26
+ },
27
+ "then": [
28
+ {
29
+ "click": "astro-island[component-url*=\"CookiesBanner\"] .cookies input[name=\"targeting\"]"
30
+ }
31
+ ]
32
+ },
33
+ {
34
+ "waitForThenClick": "astro-island[component-url*=\"CookiesBanner\"] .cookies button.cookies__buttons--accept"
35
+ }
36
+ ],
37
+ "test": [
38
+ {
39
+ "cookieContains": "cookiesPreferences=[%22necessary%22]"
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "ibanez",
3
+ "vendorUrl": "https://www.ibanez.com/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://www\\.ibanez\\.com/"
6
+ },
7
+ "prehideSelectors": ["#header-gdpr"],
8
+ "detectCmp": [{ "exists": "#header-gdpr #header-gdpr-in-btn button" }],
9
+ "detectPopup": [{ "visible": "#header-gdpr.is-active" }],
10
+ "optOut": [{ "waitForThenClick": "#header-gdpr #header-gdpr-in-btn button" }],
11
+ "optIn": [{ "waitForThenClick": "#header-gdpr #header-gdpr-in-btn button" }],
12
+ "test": [{ "cookieContains": "gdprCookieData=ok" }]
13
+ }
@@ -1,7 +1,6 @@
1
1
  {
2
2
  "name": "scmp",
3
3
  "vendorUrl": "https://www.scmp.com/",
4
- "cosmetic": true,
5
4
  "runContext": {
6
5
  "urlPattern": "^https://(www\\.)?scmp\\.com/"
7
6
  },
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "simplehuman-com",
3
+ "vendorUrl": "https://www.simplehuman.com/",
4
+ "runContext": {
5
+ "main": true,
6
+ "frame": false,
7
+ "urlPattern": "^https?://(www\\.)?simplehuman\\.com/"
8
+ },
9
+ "prehideSelectors": ["custom-cookie-consent#cookieBubble.banner-show"],
10
+ "detectCmp": [
11
+ {
12
+ "exists": "custom-cookie-consent#cookieBubble #configureBtn"
13
+ }
14
+ ],
15
+ "detectPopup": [
16
+ {
17
+ "visible": "custom-cookie-consent#cookieBubble.banner-show #configureBtn"
18
+ }
19
+ ],
20
+ "optIn": [
21
+ {
22
+ "waitForThenClick": "custom-cookie-consent#cookieBubble #cookieBubbleAcceptAll"
23
+ }
24
+ ],
25
+ "optOut": [
26
+ {
27
+ "waitForThenClick": "custom-cookie-consent#cookieBubble #configureBtn"
28
+ },
29
+ {
30
+ "waitForThenClick": ".custom-cookie-modal #acceptNecessaryBtn"
31
+ }
32
+ ]
33
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "toho-one.com",
3
+ "vendorUrl": "https://www.toho-one.com/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://www\\.toho-one\\.com/"
6
+ },
7
+ "detectCmp": [
8
+ {
9
+ "exists": "xpath///div[contains(@class, 'fixed') and contains(., 'Cookieをブロック') and .//button[normalize-space()='Cookieの設定']]"
10
+ }
11
+ ],
12
+ "detectPopup": [
13
+ {
14
+ "visible": "xpath///div[contains(@class, 'fixed') and contains(., 'Cookieをブロック') and .//button[normalize-space()='Cookieの設定']]"
15
+ }
16
+ ],
17
+ "optIn": [
18
+ {
19
+ "waitForThenClick": "xpath///div[contains(@class, 'fixed') and contains(., 'Cookieをブロック')]//button[normalize-space()='すべてのCookieを受け入れる']"
20
+ }
21
+ ],
22
+ "optOut": [
23
+ {
24
+ "waitForThenClick": "xpath///div[contains(@class, 'fixed') and contains(., 'Cookieをブロック')]//button[normalize-space()='Cookieの設定']"
25
+ },
26
+ {
27
+ "waitFor": [
28
+ "xpath///div[contains(@class, 'fixed') and .//button[normalize-space()='設定を保存する']]",
29
+ "input[type=checkbox]:checked:not(:disabled)"
30
+ ]
31
+ },
32
+ {
33
+ "click": [
34
+ "xpath///div[contains(@class, 'fixed') and .//button[normalize-space()='設定を保存する']]",
35
+ "input[type=checkbox]:checked:not(:disabled)"
36
+ ],
37
+ "all": true
38
+ },
39
+ {
40
+ "waitForThenClick": "xpath///button[normalize-space()='設定を保存する']"
41
+ }
42
+ ],
43
+ "test": [
44
+ {
45
+ "waitForVisible": "xpath///div[contains(@class, 'fixed') and contains(., 'Cookieをブロック') and .//button[normalize-space()='Cookieの設定']]",
46
+ "timeout": 1000,
47
+ "check": "none"
48
+ }
49
+ ]
50
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "tohotheater-jp",
3
+ "vendorUrl": "https://www.tohotheater.jp/",
4
+ "runContext": {
5
+ "urlPattern": "^https?://(?:[^/]+\\.)?tohotheater\\.jp/"
6
+ },
7
+ "prehideSelectors": [".optIn"],
8
+ "detectCmp": [{ "exists": ".optIn .js-optin-cookie-settings" }],
9
+ "detectPopup": [{ "visible": ".optIn" }],
10
+ "optIn": [{ "waitForThenClick": ".optIn .js-optin-accept-all-cookies" }],
11
+ "optOut": [
12
+ { "waitForThenClick": ".optIn .js-optin-cookie-settings" },
13
+ { "waitForThenClick": "label[for=\"TAB-02\"]" },
14
+ { "waitForThenClick": "label[for=\"TAB-02\"] + .tab-content .toggleSwitch__circle" },
15
+ { "waitForThenClick": "label[for=\"TAB-03\"]" },
16
+ { "waitForThenClick": "label[for=\"TAB-03\"] + .tab-content .toggleSwitch__circle" },
17
+ { "waitForThenClick": ".js-modal-save-settings" }
18
+ ],
19
+ "test": [{ "cookieContains": "__performanceCookieFlag__=0" }, { "cookieContains": "__targetingCookieFlag__=0" }]
20
+ }