@duckduckgo/autoconsent 16.3.0 → 16.5.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckduckgo/autoconsent",
3
- "version": "16.3.0",
3
+ "version": "16.5.0",
4
4
  "description": "",
5
5
  "types": "./dist/types/web.d.ts",
6
6
  "exports": {
@@ -40,37 +40,61 @@
40
40
  ],
41
41
  "optOut": [
42
42
  {
43
- "comment": "If the banner has a direct Reject All button (newer Ketch DOM), click it and we're done.",
43
+ "comment": "Banner phase: pick one banner action.",
44
44
  "if": {
45
- "exists": "#ketch-banner-button-tertiary"
46
- },
47
- "then": [{ "waitForThenClick": "#ketch-banner-button-tertiary" }]
48
- },
49
- {
50
- "comment": "Older banner variant exposed via aria-describedby=banner-description: open settings/reject (same button class)",
51
- "if": {
52
- "exists": "#lanyard_root [aria-describedby=banner-description]"
45
+ "exists": "#lanyard_root button[aria-label^='Reject' i], #ketch-banner button[aria-label^='Reject' i]"
53
46
  },
54
47
  "then": [
55
48
  {
49
+ "waitForThenClick": "#lanyard_root button[aria-label^='Reject' i], #ketch-banner button[aria-label^='Reject' i]"
50
+ },
51
+ {
52
+ "comment": "Submit if the preferences modal is still open (Reject All only toggled switches).",
56
53
  "if": {
57
- "exists": "#lanyard_root div[class*=buttons] > button[class*=secondaryButton], #lanyard_root button[class*=buttons-secondary]"
54
+ "visible": "#lanyard_root [aria-describedby=preference-description], #lanyard_root [aria-describedby=modal-description], #ketch-modal, #ketch-purposes-modal, #ketch-preferences"
58
55
  },
59
56
  "then": [
60
57
  {
61
- "waitForThenClick": "#lanyard_root div[class*=buttons] > button[class*=secondaryButton], #lanyard_root button[class*=buttons-secondary]",
62
- "comment": "can be either settings or reject button"
58
+ "click": "#lanyard_root button[class*=confirmButton], #lanyard_root div[class*=actions_] > button:nth-child(1), #lanyard_root button[class*=actionButton], #ketch-modal button[aria-label='Confirm'], #ketch-purposes-modal button[aria-label='Confirm'], #ketch-modal button[aria-label='Save Settings'], #ketch-purposes-modal button[aria-label='Save Settings']"
63
59
  }
64
- ],
60
+ ]
61
+ }
62
+ ],
63
+ "else": [
64
+ {
65
+ "comment": "Reject button without aria-label match.",
66
+ "if": {
67
+ "exists": "#ketch-banner-button-tertiary"
68
+ },
69
+ "then": [{ "waitForThenClick": "#ketch-banner-button-tertiary" }],
65
70
  "else": [
66
71
  {
72
+ "comment": "Open settings from banner, or dismiss disclosure-only banner.",
67
73
  "if": {
68
- "exists": "#lanyard_root [id^='ketch-banner-buttons-container'] > button:only-child"
74
+ "exists": "#lanyard_root [aria-describedby=banner-description]"
69
75
  },
70
76
  "then": [
71
77
  {
72
- "click": "#lanyard_root [id^='ketch-banner-buttons-container'] > button:only-child",
73
- "comment": "Disclosure-only banner (e.g. US/CCPA notice with a single 'I understand'/'OK' acknowledge button and no reject option). Clicking the lone button dismisses the notice; consent state is already determined by Ketch's jurisdiction defaults."
78
+ "if": {
79
+ "exists": "#lanyard_root div[class*=buttons] > button[class*=secondaryButton], #lanyard_root button[class*=buttons-secondary], #ketch-banner-button-secondary"
80
+ },
81
+ "then": [
82
+ {
83
+ "waitForThenClick": "#lanyard_root div[class*=buttons] > button[class*=secondaryButton], #lanyard_root button[class*=buttons-secondary], #ketch-banner-button-secondary"
84
+ }
85
+ ],
86
+ "else": [
87
+ {
88
+ "if": {
89
+ "exists": "#lanyard_root [id^='ketch-banner-buttons-container'] > button:only-child"
90
+ },
91
+ "then": [
92
+ {
93
+ "click": "#lanyard_root [id^='ketch-banner-buttons-container'] > button:only-child"
94
+ }
95
+ ]
96
+ }
97
+ ]
74
98
  }
75
99
  ]
76
100
  }
@@ -84,16 +108,31 @@
84
108
  "optional": true
85
109
  },
86
110
  {
87
- "comment": "Preferences/purposes modal is open: click Reject All then Confirm.",
111
+ "comment": "Preferences modal handling.",
88
112
  "if": {
89
113
  "exists": "#lanyard_root [aria-describedby=preference-description],#lanyard_root [aria-describedby=modal-description], #ketch-preferences, #ketch-purposes-modal"
90
114
  },
91
115
  "then": [
92
116
  {
93
- "waitForThenClick": "#lanyard_root button[class*=rejectButton], #lanyard_root button[class*=rejectAllButton], #ketch-modal button[aria-label='Reject All'], #ketch-purposes-modal button[aria-label='Reject All']"
117
+ "if": {
118
+ "exists": "#lanyard_root button[class*=rejectButton], #lanyard_root button[class*=rejectAllButton], #ketch-modal button[aria-label='Reject All'], #ketch-purposes-modal button[aria-label='Reject All']"
119
+ },
120
+ "then": [
121
+ {
122
+ "waitForThenClick": "#lanyard_root button[class*=rejectButton], #lanyard_root button[class*=rejectAllButton], #ketch-modal button[aria-label='Reject All'], #ketch-purposes-modal button[aria-label='Reject All']"
123
+ }
124
+ ],
125
+ "else": [
126
+ {
127
+ "comment": "No Reject All: uncheck every enabled purpose switch.",
128
+ "click": "#lanyard_root input[type=checkbox][role=switch][aria-checked=true]:not(:disabled)",
129
+ "all": true,
130
+ "optional": true
131
+ }
132
+ ]
94
133
  },
95
134
  {
96
- "click": "#lanyard_root button[class*=confirmButton], #lanyard_root div[class*=actions_] > button:nth-child(1), #lanyard_root button[class*=actionButton], #ketch-modal button[aria-label='Confirm'], #ketch-purposes-modal button[aria-label='Confirm']"
135
+ "click": "#lanyard_root button[class*=confirmButton], #lanyard_root div[class*=actions_] > button:nth-child(1), #lanyard_root button[class*=actionButton], #ketch-modal button[aria-label='Confirm'], #ketch-purposes-modal button[aria-label='Confirm'], #ketch-modal button[aria-label='Save Settings'], #ketch-purposes-modal button[aria-label='Save Settings']"
97
136
  }
98
137
  ]
99
138
  }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "msn",
3
+ "_metadata": {
4
+ "vendorUrl": "https://www.msn.com"
5
+ },
6
+ "cosmetic": false,
7
+ "runContext": {
8
+ "main": true,
9
+ "frame": false,
10
+ "urlPattern": "^https?://(www\\.)?msn\\.com/"
11
+ },
12
+ "prehideSelectors": ["#cmp-banner-sdk", ".cmp-sdk-container"],
13
+ "detectCmp": [{ "exists": "#cmp-banner-sdk" }],
14
+ "detectPopup": [{ "visible": "#cmp-banner-sdk" }],
15
+ "optIn": [{ "waitForThenClick": "#cmp-accept-btn-handler" }],
16
+ "optOut": [{ "waitForThenClick": "#cmp-reject-all-handler" }],
17
+ "test": [{ "cookieContains": "OptanonAlertBoxClosed" }]
18
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "pikpak",
3
+ "vendorUrl": "https://mypikpak.com/",
4
+ "prehideSelectors": [".cookie-wrapper .cookie-tip"],
5
+ "detectCmp": [
6
+ {
7
+ "exists": ".cookie-wrapper .cookie-tip__container"
8
+ }
9
+ ],
10
+ "detectPopup": [
11
+ {
12
+ "visible": ".cookie-wrapper .cookie-tip__text"
13
+ }
14
+ ],
15
+ "optIn": [
16
+ {
17
+ "waitForThenClick": ".cookie-wrapper .cookie-tip__button button.el-button--primary"
18
+ }
19
+ ],
20
+ "optOut": [
21
+ {
22
+ "waitForThenClick": ".cookie-wrapper .cookie-tip__button > .button"
23
+ },
24
+ {
25
+ "waitForVisible": ".el-dialog.cookie-dialog"
26
+ },
27
+ {
28
+ "click": ".el-dialog.cookie-dialog .el-switch.is-checked",
29
+ "all": true,
30
+ "optional": true
31
+ },
32
+ {
33
+ "waitForThenClick": ".el-dialog.cookie-dialog .el-dialog__footer button.el-button--primary"
34
+ }
35
+ ],
36
+ "test": [
37
+ {
38
+ "any": [
39
+ {
40
+ "cookieContains": "allow_analysis=%22false%22"
41
+ },
42
+ {
43
+ "cookieContains": "allow_analysis=false"
44
+ }
45
+ ]
46
+ }
47
+ ]
48
+ }