@duckduckgo/autoconsent 14.66.0 → 14.67.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": "14.66.0",
3
+ "version": "14.67.0",
4
4
  "description": "",
5
5
  "types": "./dist/types/web.d.ts",
6
6
  "exports": {
@@ -7,6 +7,9 @@ import { ContentScriptMessage } from '../lib/messages';
7
7
  import { AutoAction, RuleBundle } from '../lib/types';
8
8
  import { filterCompactRules } from '../lib/encoding';
9
9
  import compactRules from '../rules/compact-rules.json';
10
+ // Full rules include optIn steps that compact rules intentionally omit.
11
+ // We need both formats: compact for optOut tests, full for optIn tests.
12
+ import { autoconsent as fullRules } from '../rules/rules.json';
10
13
 
11
14
  const LOG_MESSAGES: ContentScriptMessage['type'][] = process.env.CI
12
15
  ? []
@@ -150,6 +153,11 @@ class TestRun {
150
153
  case 'init': {
151
154
  const url = frame.url();
152
155
  const mainFrame = frame.parentFrame() === null;
156
+ // Use full rules for optIn (compact rules omit optIn steps), compact rules for optOut.
157
+ const rules =
158
+ this.autoAction === 'optIn'
159
+ ? { autoconsent: fullRules }
160
+ : { compact: filterCompactRules(compactRules, { url, mainFrame }) };
153
161
  await frame.evaluate(
154
162
  `autoconsentReceiveMessage({ type: "initResp", config: ${JSON.stringify({
155
163
  enabled: true,
@@ -159,7 +167,7 @@ class TestRun {
159
167
  detectRetries: 20,
160
168
  enableCosmeticRules: true,
161
169
  visualTest: true,
162
- })}, rules: ${JSON.stringify({ compact: filterCompactRules(compactRules, { url, mainFrame }) })} })`,
170
+ })}, rules: ${JSON.stringify(rules)} })`,
163
171
  );
164
172
  break;
165
173
  }
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "Ensighten",
3
+ "prehideSelectors": ["#ensNotifyBanner", ".ensModal"],
4
+ "detectCmp": [
5
+ {
6
+ "any": [{ "visible": "#ensNotifyBanner[style*=block]" }, { "visible": "#ensModalWrapper[style*=block]" }]
7
+ }
8
+ ],
9
+ "detectPopup": [
10
+ {
11
+ "any": [{ "visible": "#ensNotifyBanner[style*=block]" }, { "visible": "#ensModalWrapper[style*=block]" }]
12
+ }
13
+ ],
14
+ "optIn": [{ "waitForThenClick": "#ensCloseBanner,#modalAcceptButton,#ensAcceptAll,#bannerAcceptButton" }],
15
+ "optOut": [
16
+ { "wait": 500 },
17
+ {
18
+ "if": { "visible": "#ensNotifyBanner[style*=block]" },
19
+ "then": [
20
+ {
21
+ "if": {
22
+ "visible": "#ensNotifyBanner #ensRejectAll,#ensNotifyBanner #rejectAll,#ensNotifyBanner #ensRejectBanner,#ensNotifyBanner .rejectAll,#ensNotifyBanner #bannerRejectButton,#ensNotifyBanner #ensRejectAds",
23
+ "check": "any"
24
+ },
25
+ "then": [
26
+ {
27
+ "waitForThenClick": "#ensNotifyBanner #ensRejectAll,#ensNotifyBanner #rejectAll,#ensNotifyBanner #ensRejectBanner,#ensNotifyBanner .rejectAll,#ensNotifyBanner #bannerRejectButton,#ensNotifyBanner #ensRejectAds"
28
+ }
29
+ ],
30
+ "else": [
31
+ {
32
+ "if": { "visible": "#ensOpenModal,#modalOpenButton,#bannerOpenModal", "check": "any" },
33
+ "then": [
34
+ { "waitForThenClick": "#ensOpenModal,#modalOpenButton,#bannerOpenModal" },
35
+ { "waitFor": "#ensModalWrapper[style*=block]", "timeout": 1000 },
36
+ { "click": ".ensCheckbox:checked:not(:disabled)", "all": true, "optional": true },
37
+ { "waitForThenClick": "#ensSave,#modalSaveButton,#bannerSave" }
38
+ ],
39
+ "else": [{ "waitForThenClick": "#ensCloseBanner" }]
40
+ }
41
+ ]
42
+ }
43
+ ],
44
+ "else": [
45
+ { "click": ".ensCheckbox:checked:not(:disabled)", "all": true, "optional": true },
46
+ { "waitForThenClick": "#ensSave,#modalSaveButton,#bannerSave" }
47
+ ]
48
+ }
49
+ ]
50
+ }