@duckduckgo/autoconsent 15.1.0 → 16.0.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 (84) hide show
  1. package/.github/dependabot.yml +0 -3
  2. package/.github/workflows/release.yml +0 -4
  3. package/AGENTS.md +3 -3
  4. package/CHANGELOG.md +20 -0
  5. package/build.sh +0 -2
  6. package/dist/addon-firefox/background.bundle.js +8 -24
  7. package/dist/addon-firefox/compact-rules.json +1 -1
  8. package/dist/addon-firefox/content.bundle.js +176 -686
  9. package/dist/addon-firefox/manifest.json +1 -1
  10. package/dist/addon-firefox/popup.bundle.js +31 -27
  11. package/dist/addon-firefox/popup.html +21 -13
  12. package/dist/addon-firefox/rule-index.json +1 -1
  13. package/dist/addon-firefox/rules.json +1 -1
  14. package/dist/addon-mv3/background.bundle.js +8 -24
  15. package/dist/addon-mv3/compact-rules.json +1 -1
  16. package/dist/addon-mv3/content.bundle.js +176 -686
  17. package/dist/addon-mv3/manifest.json +1 -1
  18. package/dist/addon-mv3/popup.bundle.js +31 -27
  19. package/dist/addon-mv3/popup.html +21 -13
  20. package/dist/addon-mv3/rule-index.json +1 -1
  21. package/dist/addon-mv3/rules.json +1 -1
  22. package/dist/autoconsent.cjs.js +176 -685
  23. package/dist/autoconsent.esm.js +176 -685
  24. package/dist/autoconsent.playwright.js +177 -689
  25. package/dist/autoconsent.standalone.js +177 -690
  26. package/dist/types/cmps/base.d.ts +3 -3
  27. package/dist/types/heuristics.d.ts +2 -2
  28. package/dist/types/types.d.ts +10 -23
  29. package/dist/types/web.d.ts +0 -9
  30. package/docs/api.md +1 -8
  31. package/docs/puppeteer.md +1 -3
  32. package/docs/rule-syntax.md +0 -17
  33. package/eslint.config.mjs +1 -1
  34. package/lib/cmps/base.ts +5 -6
  35. package/lib/heuristics.ts +15 -15
  36. package/lib/types.ts +9 -21
  37. package/lib/utils.ts +2 -4
  38. package/lib/web.ts +3 -53
  39. package/package.json +4 -17
  40. package/playwright/content.ts +1 -2
  41. package/readme.md +3 -6
  42. package/rules/autoconsent/dreamlab-cmp.json +13 -0
  43. package/rules/build.ts +1 -24
  44. package/rules/compact-rules.json +1 -1
  45. package/rules/rule-index-builder.ts +2 -7
  46. package/rules/rule-index.json +1 -1
  47. package/rules/rules.json +1 -1
  48. package/standalone/content.ts +0 -2
  49. package/tests/dreamlab-cmp.spec.ts +3 -0
  50. package/tests/quantcast.spec.ts +0 -6
  51. package/tests-wtr/heuristics/get-actionable-popups.ts +13 -13
  52. package/tests-wtr/heuristics/heuristic-cmp.ts +32 -33
  53. package/tests-wtr/lifecycle/find-cmp.ts +5 -8
  54. package/tests-wtr/web/do-opt-in.test.ts +0 -1
  55. package/tests-wtr/web/do-opt-out.test.ts +0 -1
  56. package/tests-wtr/web/do-self-test.test.ts +0 -1
  57. package/tests-wtr/web/filter-cmps.test.ts +0 -1
  58. package/tests-wtr/web/receive-message-callback.test.ts +1 -2
  59. package/tests-wtr/web/update-state.test.ts +1 -3
  60. package/tsconfig.build.json +1 -1
  61. package/.github/workflows/update-filterlist.yml +0 -42
  62. package/dist/autoconsent.extra.cjs.js +0 -15717
  63. package/dist/autoconsent.extra.esm.js +0 -15649
  64. package/dist/types/cmps/consentomatic.d.ts +0 -34
  65. package/dist/types/consentomatic/index.d.ts +0 -2
  66. package/dist/types/consentomatic/tools.d.ts +0 -10
  67. package/dist/types/filterlist-engine.d.ts +0 -2
  68. package/dist/types/filterlist-utils.d.ts +0 -4
  69. package/dist/types/web-extra.d.ts +0 -11
  70. package/lib/cmps/consentomatic.ts +0 -97
  71. package/lib/consentomatic/index.ts +0 -252
  72. package/lib/consentomatic/tools.ts +0 -199
  73. package/lib/filterlist-engine.ts +0 -5
  74. package/lib/filterlist-utils.ts +0 -45
  75. package/lib/web-extra.ts +0 -116
  76. package/rules/consentomatic.json +0 -1
  77. package/rules/filterlist.txt +0 -18440
  78. package/rules/filterlists/overrides.txt +0 -4
  79. package/scripts/compile-filterlist.mjs +0 -63
  80. package/scripts/fetch-easylist.sh +0 -25
  81. package/scripts/rebuild-filterlist.mjs +0 -216
  82. package/tests/oil.spec.ts +0 -7
  83. package/tests/springer.spec.ts +0 -7
  84. package/tests/wordpressgdpr.spec.ts +0 -6
@@ -8,412 +8,8 @@
8
8
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
9
9
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
10
10
 
11
- // lib/consentomatic/tools.ts
12
- var _Tools = class _Tools {
13
- static setBase(base) {
14
- _Tools.base = base;
15
- }
16
- static findElement(options, parent = null, multiple = false) {
17
- let possibleTargets = null;
18
- if (parent != null) {
19
- possibleTargets = Array.from(parent.querySelectorAll(options.selector));
20
- } else {
21
- if (_Tools.base != null) {
22
- possibleTargets = Array.from(
23
- _Tools.base.querySelectorAll(options.selector)
24
- );
25
- } else {
26
- possibleTargets = Array.from(
27
- document.querySelectorAll(options.selector)
28
- );
29
- }
30
- }
31
- if (options.textFilter != null) {
32
- possibleTargets = possibleTargets.filter((possibleTarget) => {
33
- const textContent = possibleTarget.textContent.toLowerCase();
34
- if (Array.isArray(options.textFilter)) {
35
- let foundText = false;
36
- for (const text of options.textFilter) {
37
- if (textContent.indexOf(text.toLowerCase()) !== -1) {
38
- foundText = true;
39
- break;
40
- }
41
- }
42
- return foundText;
43
- } else if (options.textFilter != null) {
44
- return textContent.indexOf(options.textFilter.toLowerCase()) !== -1;
45
- }
46
- return false;
47
- });
48
- }
49
- if (options.styleFilters != null) {
50
- possibleTargets = possibleTargets.filter((possibleTarget) => {
51
- const styles = window.getComputedStyle(possibleTarget);
52
- let keep = true;
53
- for (const styleFilter of options.styleFilters) {
54
- const option = styles[styleFilter.option];
55
- if (styleFilter.negated) {
56
- keep = keep && option !== styleFilter.value;
57
- } else {
58
- keep = keep && option === styleFilter.value;
59
- }
60
- }
61
- return keep;
62
- });
63
- }
64
- if (options.displayFilter != null) {
65
- possibleTargets = possibleTargets.filter((possibleTarget) => {
66
- if (options.displayFilter) {
67
- return possibleTarget.offsetHeight !== 0;
68
- } else {
69
- return possibleTarget.offsetHeight === 0;
70
- }
71
- });
72
- }
73
- if (options.iframeFilter != null) {
74
- possibleTargets = possibleTargets.filter(() => {
75
- if (options.iframeFilter) {
76
- return window.location !== window.parent.location;
77
- } else {
78
- return window.location === window.parent.location;
79
- }
80
- });
81
- }
82
- if (options.childFilter != null) {
83
- possibleTargets = possibleTargets.filter((possibleTarget) => {
84
- const oldBase = _Tools.base;
85
- _Tools.setBase(possibleTarget);
86
- const childResults = _Tools.find(options.childFilter);
87
- _Tools.setBase(oldBase);
88
- return childResults.target != null;
89
- });
90
- }
91
- if (multiple) {
92
- return possibleTargets;
93
- } else {
94
- if (possibleTargets.length > 1) {
95
- console.warn(
96
- "Multiple possible targets: ",
97
- possibleTargets,
98
- options,
99
- parent
100
- );
101
- }
102
- return possibleTargets[0];
103
- }
104
- }
105
- static find(options, multiple = false) {
106
- const results = [];
107
- if (options.parent != null) {
108
- const parent = _Tools.findElement(options.parent, null, multiple);
109
- if (parent != null) {
110
- if (parent instanceof Array) {
111
- parent.forEach((p) => {
112
- const targets = _Tools.findElement(options.target, p, multiple);
113
- if (targets instanceof Array) {
114
- targets.forEach((target) => {
115
- results.push({
116
- parent: p,
117
- target
118
- });
119
- });
120
- } else {
121
- results.push({
122
- parent: p,
123
- target: targets
124
- });
125
- }
126
- });
127
- return results;
128
- } else {
129
- const targets = _Tools.findElement(options.target, parent, multiple);
130
- if (targets instanceof Array) {
131
- targets.forEach((target) => {
132
- results.push({
133
- parent,
134
- target
135
- });
136
- });
137
- } else {
138
- results.push({
139
- parent,
140
- target: targets
141
- });
142
- }
143
- }
144
- }
145
- } else {
146
- const targets = _Tools.findElement(options.target, null, multiple);
147
- if (targets instanceof Array) {
148
- targets.forEach((target) => {
149
- results.push({
150
- parent: null,
151
- target
152
- });
153
- });
154
- } else {
155
- results.push({
156
- parent: null,
157
- target: targets
158
- });
159
- }
160
- }
161
- if (results.length === 0) {
162
- results.push({
163
- parent: null,
164
- target: null
165
- });
166
- }
167
- if (multiple) {
168
- return results;
169
- } else {
170
- if (results.length !== 1) {
171
- console.warn(
172
- "Multiple results found, even though multiple false",
173
- results
174
- );
175
- }
176
- return results[0];
177
- }
178
- }
179
- };
180
- _Tools.base = null;
181
- var Tools = _Tools;
182
-
183
- // lib/consentomatic/index.ts
184
- function matches(config) {
185
- const result = Tools.find(config);
186
- if (config.type === "css") {
187
- return !!result.target;
188
- } else if (config.type === "checkbox") {
189
- return !!result.target && result.target.checked;
190
- }
191
- }
192
- async function executeAction(config, param) {
193
- switch (config.type) {
194
- case "click":
195
- return clickAction(config);
196
- case "list":
197
- return listAction(config, param);
198
- case "consent":
199
- return consentAction(config, param);
200
- case "ifcss":
201
- return ifCssAction(config, param);
202
- case "waitcss":
203
- return waitCssAction(config);
204
- case "foreach":
205
- return forEachAction(config, param);
206
- case "hide":
207
- return hideAction(config);
208
- case "slide":
209
- return slideAction(config);
210
- case "close":
211
- return closeAction();
212
- case "wait":
213
- return waitAction(config);
214
- case "eval":
215
- return evalAction(config);
216
- default:
217
- throw new Error("Unknown action type: " + config.type);
218
- }
219
- }
220
- var STEP_TIMEOUT = 0;
221
- function waitTimeout(timeout) {
222
- return new Promise((resolve) => {
223
- setTimeout(() => {
224
- resolve();
225
- }, timeout);
226
- });
227
- }
228
- async function clickAction(config) {
229
- const result = Tools.find(config);
230
- if (result.target != null) {
231
- result.target.click();
232
- }
233
- return waitTimeout(STEP_TIMEOUT);
234
- }
235
- async function listAction(config, param) {
236
- for (const action of config.actions) {
237
- await executeAction(action, param);
238
- }
239
- }
240
- async function consentAction(config, consentTypes) {
241
- for (const consentConfig of config.consents) {
242
- const shouldEnable = consentTypes.indexOf(consentConfig.type) !== -1;
243
- if (consentConfig.matcher && consentConfig.toggleAction) {
244
- const isEnabled = matches(consentConfig.matcher);
245
- if (isEnabled !== shouldEnable) {
246
- await executeAction(consentConfig.toggleAction);
247
- }
248
- } else {
249
- if (shouldEnable) {
250
- await executeAction(consentConfig.trueAction);
251
- } else {
252
- await executeAction(consentConfig.falseAction);
253
- }
254
- }
255
- }
256
- }
257
- async function ifCssAction(config, param) {
258
- const result = Tools.find(config);
259
- if (!result.target) {
260
- if (config.trueAction) {
261
- await executeAction(config.trueAction, param);
262
- }
263
- } else {
264
- if (config.falseAction) {
265
- await executeAction(config.falseAction, param);
266
- }
267
- }
268
- }
269
- async function waitCssAction(config) {
270
- await new Promise((resolve) => {
271
- let numRetries = config.retries || 10;
272
- const waitTime = config.waitTime || 250;
273
- const checkCss = () => {
274
- const result = Tools.find(config);
275
- if (config.negated && result.target || !config.negated && !result.target) {
276
- if (numRetries > 0) {
277
- numRetries -= 1;
278
- setTimeout(checkCss, waitTime);
279
- } else {
280
- resolve();
281
- }
282
- } else {
283
- resolve();
284
- }
285
- };
286
- checkCss();
287
- });
288
- }
289
- async function forEachAction(config, param) {
290
- const results = Tools.find(config, true);
291
- const oldBase = Tools.base;
292
- for (const result of results) {
293
- if (result.target) {
294
- Tools.setBase(result.target);
295
- await executeAction(config.action, param);
296
- }
297
- }
298
- Tools.setBase(oldBase);
299
- }
300
- async function hideAction(config) {
301
- const result = Tools.find(config);
302
- if (result.target) {
303
- result.target.classList.add("Autoconsent-Hidden");
304
- }
305
- }
306
- async function slideAction(config) {
307
- const result = Tools.find(config);
308
- const dragResult = Tools.find(config.dragTarget);
309
- if (result.target) {
310
- const targetBounds = result.target.getBoundingClientRect();
311
- const dragTargetBounds = dragResult.target.getBoundingClientRect();
312
- let yDiff = dragTargetBounds.top - targetBounds.top;
313
- let xDiff = dragTargetBounds.left - targetBounds.left;
314
- if (this.config.axis.toLowerCase() === "y") {
315
- xDiff = 0;
316
- }
317
- if (this.config.axis.toLowerCase() === "x") {
318
- yDiff = 0;
319
- }
320
- const screenX = window.screenX + targetBounds.left + targetBounds.width / 2;
321
- const screenY = window.screenY + targetBounds.top + targetBounds.height / 2;
322
- const clientX = targetBounds.left + targetBounds.width / 2;
323
- const clientY = targetBounds.top + targetBounds.height / 2;
324
- const mouseDown = document.createEvent("MouseEvents");
325
- mouseDown.initMouseEvent(
326
- "mousedown",
327
- true,
328
- true,
329
- window,
330
- 0,
331
- screenX,
332
- screenY,
333
- clientX,
334
- clientY,
335
- false,
336
- false,
337
- false,
338
- false,
339
- 0,
340
- result.target
341
- );
342
- const mouseMove = document.createEvent("MouseEvents");
343
- mouseMove.initMouseEvent(
344
- "mousemove",
345
- true,
346
- true,
347
- window,
348
- 0,
349
- screenX + xDiff,
350
- screenY + yDiff,
351
- clientX + xDiff,
352
- clientY + yDiff,
353
- false,
354
- false,
355
- false,
356
- false,
357
- 0,
358
- result.target
359
- );
360
- const mouseUp = document.createEvent("MouseEvents");
361
- mouseUp.initMouseEvent(
362
- "mouseup",
363
- true,
364
- true,
365
- window,
366
- 0,
367
- screenX + xDiff,
368
- screenY + yDiff,
369
- clientX + xDiff,
370
- clientY + yDiff,
371
- false,
372
- false,
373
- false,
374
- false,
375
- 0,
376
- result.target
377
- );
378
- result.target.dispatchEvent(mouseDown);
379
- await this.waitTimeout(10);
380
- result.target.dispatchEvent(mouseMove);
381
- await this.waitTimeout(10);
382
- result.target.dispatchEvent(mouseUp);
383
- }
384
- }
385
- async function waitAction(config) {
386
- await waitTimeout(config.waitTime);
387
- }
388
- async function closeAction() {
389
- window.close();
390
- }
391
- async function evalAction(config) {
392
- console.log("eval!", config.code);
393
- return new Promise((resolve) => {
394
- try {
395
- if (config.async) {
396
- window.eval(config.code);
397
- setTimeout(() => {
398
- resolve(window.eval("window.__consentCheckResult"));
399
- }, config.timeout || 250);
400
- } else {
401
- resolve(window.eval(config.code));
402
- }
403
- } catch (e) {
404
- console.warn("eval error", e, config.code);
405
- resolve(false);
406
- }
407
- });
408
- }
409
-
410
- // lib/types.ts
411
- var PopupHandlingModes = {
412
- None: -1,
413
- Reject: 0,
414
- Tier1: 1,
415
- Tier2: 2
416
- };
11
+ // lib/rules.ts
12
+ var SUPPORTED_RULE_STEP_VERSION = 2;
417
13
 
418
14
  // lib/random.ts
419
15
  function getRandomID() {
@@ -466,6 +62,155 @@
466
62
  }
467
63
  }
468
64
 
65
+ // lib/utils.ts
66
+ function getStyleElement(styleOverrideElementId = "autoconsent-css-rules") {
67
+ const styleSelector = `style#${styleOverrideElementId}`;
68
+ const existingElement = document.querySelector(styleSelector);
69
+ if (existingElement && existingElement instanceof HTMLStyleElement) {
70
+ return existingElement;
71
+ } else {
72
+ const parent = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
73
+ const css = document.createElement("style");
74
+ css.id = styleOverrideElementId;
75
+ parent.appendChild(css);
76
+ return css;
77
+ }
78
+ }
79
+ function getHidingStyle(method) {
80
+ const hidingSnippet = method === "opacity" ? `opacity: 0` : `display: none`;
81
+ return `${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important;`;
82
+ }
83
+ function hideElements(styleEl, selector, method = "display") {
84
+ const rule = `${selector} { ${getHidingStyle(method)} } `;
85
+ if (styleEl instanceof HTMLStyleElement) {
86
+ styleEl.innerText += rule;
87
+ return selector.length > 0;
88
+ }
89
+ return false;
90
+ }
91
+ async function waitFor(predicate, maxTimes, interval) {
92
+ const result = await predicate();
93
+ if (!result && maxTimes > 0) {
94
+ return new Promise((resolve) => {
95
+ setTimeout(async () => {
96
+ resolve(waitFor(predicate, maxTimes - 1, interval));
97
+ }, interval);
98
+ });
99
+ }
100
+ return Promise.resolve(result);
101
+ }
102
+ function isElementVisible(elem) {
103
+ if (!elem) {
104
+ return false;
105
+ }
106
+ if (elem.offsetParent !== null) {
107
+ return true;
108
+ } else {
109
+ const css = window.getComputedStyle(elem);
110
+ if (css.position === "fixed" && css.display !== "none") {
111
+ return true;
112
+ }
113
+ }
114
+ return false;
115
+ }
116
+ function copyObject(data) {
117
+ if (globalThis.structuredClone) {
118
+ return structuredClone(data);
119
+ }
120
+ return JSON.parse(JSON.stringify(data));
121
+ }
122
+ function normalizeConfig(providedConfig) {
123
+ const defaultConfig = {
124
+ enabled: true,
125
+ autoAction: "optOut",
126
+ // if falsy, the extension will wait for an explicit user signal before opting in/out
127
+ disabledCmps: [],
128
+ enablePrehide: true,
129
+ enableCosmeticRules: true,
130
+ enableGeneratedRules: true,
131
+ enableHeuristicDetection: false,
132
+ enablePopupMutationObserver: false,
133
+ detectRetries: 20,
134
+ isMainWorld: false,
135
+ prehideTimeout: 2e3,
136
+ visualTest: false,
137
+ logs: {
138
+ lifecycle: false,
139
+ rulesteps: false,
140
+ detectionsteps: false,
141
+ evals: false,
142
+ errors: true,
143
+ messages: false,
144
+ waits: false
145
+ },
146
+ performanceLoggingEnabled: false,
147
+ heuristicPopupSearchTimeout: 100,
148
+ heuristicMode: "off"
149
+ // heuristic disabled by default
150
+ };
151
+ const updatedConfig = copyObject(defaultConfig);
152
+ for (const key of Object.keys(defaultConfig)) {
153
+ if (typeof providedConfig[key] !== "undefined") {
154
+ updatedConfig[key] = providedConfig[key];
155
+ }
156
+ }
157
+ return updatedConfig;
158
+ }
159
+ function scheduleWhenIdle(callback, timeout = 500) {
160
+ if (globalThis.requestIdleCallback) {
161
+ requestIdleCallback(callback, { timeout });
162
+ } else {
163
+ setTimeout(callback, 0);
164
+ }
165
+ }
166
+ function highlightNode(node) {
167
+ const highlightedNode = node;
168
+ if (!node.style) return;
169
+ if (highlightedNode.__oldStyles !== void 0) {
170
+ return;
171
+ }
172
+ if (node.hasAttribute("style")) {
173
+ highlightedNode.__oldStyles = node.style.cssText;
174
+ }
175
+ node.style.animation = "pulsate .5s infinite";
176
+ node.style.outline = "solid red";
177
+ let styleTag = document.querySelector("style#autoconsent-debug-styles");
178
+ if (!styleTag) {
179
+ styleTag = document.createElement("style");
180
+ styleTag.id = "autoconsent-debug-styles";
181
+ }
182
+ styleTag.textContent = `
183
+ @keyframes pulsate {
184
+ 0% {
185
+ outline-width: 8px;
186
+ outline-offset: -4px;
187
+ }
188
+ 50% {
189
+ outline-width: 4px;
190
+ outline-offset: -2px;
191
+ }
192
+ 100% {
193
+ outline-width: 8px;
194
+ outline-offset: -4px;
195
+ }
196
+ }
197
+ `;
198
+ document.head.appendChild(styleTag);
199
+ }
200
+ function unhighlightNode(node) {
201
+ const highlightedNode = node;
202
+ if (!node.style || !node.hasAttribute("style")) return;
203
+ if (highlightedNode.__oldStyles !== void 0) {
204
+ node.style.cssText = highlightedNode.__oldStyles;
205
+ delete highlightedNode.__oldStyles;
206
+ } else {
207
+ node.removeAttribute("style");
208
+ }
209
+ }
210
+ function isTopFrame() {
211
+ return window.top === window && (!globalThis.location.ancestorOrigins || globalThis.location.ancestorOrigins.length === 0);
212
+ }
213
+
469
214
  // lib/eval-snippets.ts
470
215
  var snippets = {
471
216
  // code-based rules
@@ -643,156 +388,6 @@
643
388
  return `(${snippetStr})()`;
644
389
  }
645
390
 
646
- // lib/utils.ts
647
- function getStyleElement(styleOverrideElementId = "autoconsent-css-rules") {
648
- const styleSelector = `style#${styleOverrideElementId}`;
649
- const existingElement = document.querySelector(styleSelector);
650
- if (existingElement && existingElement instanceof HTMLStyleElement) {
651
- return existingElement;
652
- } else {
653
- const parent = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
654
- const css = document.createElement("style");
655
- css.id = styleOverrideElementId;
656
- parent.appendChild(css);
657
- return css;
658
- }
659
- }
660
- function getHidingStyle(method) {
661
- const hidingSnippet = method === "opacity" ? `opacity: 0` : `display: none`;
662
- return `${hidingSnippet} !important; z-index: -1 !important; pointer-events: none !important;`;
663
- }
664
- function hideElements(styleEl, selector, method = "display") {
665
- const rule = `${selector} { ${getHidingStyle(method)} } `;
666
- if (styleEl instanceof HTMLStyleElement) {
667
- styleEl.innerText += rule;
668
- return selector.length > 0;
669
- }
670
- return false;
671
- }
672
- async function waitFor(predicate, maxTimes, interval) {
673
- const result = await predicate();
674
- if (!result && maxTimes > 0) {
675
- return new Promise((resolve) => {
676
- setTimeout(async () => {
677
- resolve(waitFor(predicate, maxTimes - 1, interval));
678
- }, interval);
679
- });
680
- }
681
- return Promise.resolve(result);
682
- }
683
- function isElementVisible(elem) {
684
- if (!elem) {
685
- return false;
686
- }
687
- if (elem.offsetParent !== null) {
688
- return true;
689
- } else {
690
- const css = window.getComputedStyle(elem);
691
- if (css.position === "fixed" && css.display !== "none") {
692
- return true;
693
- }
694
- }
695
- return false;
696
- }
697
- function copyObject(data) {
698
- if (globalThis.structuredClone) {
699
- return structuredClone(data);
700
- }
701
- return JSON.parse(JSON.stringify(data));
702
- }
703
- function normalizeConfig(providedConfig) {
704
- const defaultConfig = {
705
- enabled: true,
706
- autoAction: "optOut",
707
- // if falsy, the extension will wait for an explicit user signal before opting in/out
708
- disabledCmps: [],
709
- enablePrehide: true,
710
- enableCosmeticRules: true,
711
- enableGeneratedRules: true,
712
- enableHeuristicDetection: false,
713
- enableHeuristicAction: false,
714
- enablePopupMutationObserver: false,
715
- detectRetries: 20,
716
- isMainWorld: false,
717
- prehideTimeout: 2e3,
718
- enableFilterList: false,
719
- visualTest: false,
720
- logs: {
721
- lifecycle: false,
722
- rulesteps: false,
723
- detectionsteps: false,
724
- evals: false,
725
- errors: true,
726
- messages: false,
727
- waits: false
728
- },
729
- performanceLoggingEnabled: false,
730
- heuristicPopupSearchTimeout: 100,
731
- heuristicMode: PopupHandlingModes.Reject
732
- };
733
- const updatedConfig = copyObject(defaultConfig);
734
- for (const key of Object.keys(defaultConfig)) {
735
- if (typeof providedConfig[key] !== "undefined") {
736
- updatedConfig[key] = providedConfig[key];
737
- }
738
- }
739
- return updatedConfig;
740
- }
741
- function scheduleWhenIdle(callback, timeout = 500) {
742
- if (globalThis.requestIdleCallback) {
743
- requestIdleCallback(callback, { timeout });
744
- } else {
745
- setTimeout(callback, 0);
746
- }
747
- }
748
- function highlightNode(node) {
749
- const highlightedNode = node;
750
- if (!node.style) return;
751
- if (highlightedNode.__oldStyles !== void 0) {
752
- return;
753
- }
754
- if (node.hasAttribute("style")) {
755
- highlightedNode.__oldStyles = node.style.cssText;
756
- }
757
- node.style.animation = "pulsate .5s infinite";
758
- node.style.outline = "solid red";
759
- let styleTag = document.querySelector("style#autoconsent-debug-styles");
760
- if (!styleTag) {
761
- styleTag = document.createElement("style");
762
- styleTag.id = "autoconsent-debug-styles";
763
- }
764
- styleTag.textContent = `
765
- @keyframes pulsate {
766
- 0% {
767
- outline-width: 8px;
768
- outline-offset: -4px;
769
- }
770
- 50% {
771
- outline-width: 4px;
772
- outline-offset: -2px;
773
- }
774
- 100% {
775
- outline-width: 8px;
776
- outline-offset: -4px;
777
- }
778
- }
779
- `;
780
- document.head.appendChild(styleTag);
781
- }
782
- function unhighlightNode(node) {
783
- const highlightedNode = node;
784
- if (!node.style || !node.hasAttribute("style")) return;
785
- if (highlightedNode.__oldStyles !== void 0) {
786
- node.style.cssText = highlightedNode.__oldStyles;
787
- delete highlightedNode.__oldStyles;
788
- } else {
789
- node.removeAttribute("style");
790
- }
791
- }
792
- function isTopFrame() {
793
- return window.top === window && (!globalThis.location.ancestorOrigins || globalThis.location.ancestorOrigins.length === 0);
794
- }
795
-
796
391
  // lib/heuristic-patterns.ts
797
392
  var DETECT_PATTERNS = [
798
393
  /accept cookies/gi,
@@ -1551,15 +1146,19 @@
1551
1146
  const patterns = [];
1552
1147
  const snippets2 = [];
1553
1148
  for (const p of detectPatterns) {
1554
- const matches2 = allText?.match(p);
1555
- if (matches2) {
1149
+ const matches = allText?.match(p);
1150
+ if (matches) {
1556
1151
  patterns.push(p.toString());
1557
- snippets2.push(...matches2.map((m) => m.substring(0, 200)));
1152
+ snippets2.push(...matches.map((m) => m.substring(0, 200)));
1558
1153
  }
1559
1154
  }
1560
1155
  return { patterns, snippets: snippets2 };
1561
1156
  }
1562
- function getActionablePopups(mode = PopupHandlingModes.Reject, timeout = POPUP_SEARCH_MAX_TIME) {
1157
+ function getActionablePopups(mode = "reject", timeout = POPUP_SEARCH_MAX_TIME) {
1158
+ const acceptedLevels = mode === "tier2" ? ["reject", "tier1", "tier2"] : mode === "tier1" ? ["reject", "tier1"] : ["reject"];
1159
+ if (acceptedLevels.length === 0) {
1160
+ return [];
1161
+ }
1563
1162
  const popups = getPotentialPopups(timeout);
1564
1163
  const result = popups.reduce((acc, popup) => {
1565
1164
  const popupText = popup.text?.trim();
@@ -1575,9 +1174,7 @@
1575
1174
  }
1576
1175
  return acc;
1577
1176
  }, []);
1578
- return result.filter(
1579
- (popup) => popup.regexClassification !== void 0 && popup.regexClassification !== PopupHandlingModes.None && popup.regexClassification <= mode
1580
- ).sort((a, b) => (a.regexClassification ?? 0) - (b.regexClassification ?? 0));
1177
+ return result.filter((popup) => popup.regexClassification !== void 0 && acceptedLevels.includes(popup.regexClassification)).sort((a, b) => (a.regexClassification ?? "") > (b.regexClassification ?? "") ? 1 : -1);
1581
1178
  }
1582
1179
  function classifyButtons(buttons) {
1583
1180
  for (const button of buttons) {
@@ -1595,18 +1192,18 @@
1595
1192
  { reject: 0, settings: 0, accept: 0, acknowledge: 0 }
1596
1193
  );
1597
1194
  if (reject > 0) {
1598
- return PopupHandlingModes.Reject;
1195
+ return "reject";
1599
1196
  }
1600
1197
  if (settings > 0) {
1601
- return PopupHandlingModes.None;
1198
+ return "none";
1602
1199
  }
1603
1200
  if (acknowledge > 0) {
1604
- return PopupHandlingModes.Tier1;
1201
+ return "tier1";
1605
1202
  }
1606
1203
  if (accept > 0) {
1607
- return accept === 1 ? PopupHandlingModes.Tier2 : PopupHandlingModes.None;
1204
+ return accept === 1 ? "tier2" : "none";
1608
1205
  }
1609
- return PopupHandlingModes.None;
1206
+ return "none";
1610
1207
  }
1611
1208
  function testButtonMatches(buttonText, matchPatterns, neverMatchPatterns) {
1612
1209
  if (!buttonText) {
@@ -2087,7 +1684,7 @@
2087
1684
  }
2088
1685
  };
2089
1686
  var AutoConsentHeuristicCMP = class extends AutoConsentCMPBase {
2090
- constructor(autoconsentInstance, mode = PopupHandlingModes.Reject) {
1687
+ constructor(autoconsentInstance, mode = "reject") {
2091
1688
  super(autoconsentInstance);
2092
1689
  this.popups = [];
2093
1690
  this.name = "HEURISTIC";
@@ -2114,7 +1711,7 @@
2114
1711
  this.autoconsent.config.performanceLoggingEnabled && performance.mark("heuristicDetectorEnd");
2115
1712
  this.autoconsent.config.performanceLoggingEnabled && performance.measure("heuristicDetector", "heuristicDetectorStart", "heuristicDetectorEnd");
2116
1713
  if (this.popups.length > 0) {
2117
- this.name = `HEURISTIC-TIER${this.popups[0].regexClassification}`;
1714
+ this.name = `HEURISTIC-${this.popups[0].regexClassification?.toUpperCase()}`;
2118
1715
  return Promise.resolve(true);
2119
1716
  }
2120
1717
  return Promise.resolve(false);
@@ -2132,7 +1729,7 @@
2132
1729
  const popup = this.popups[0];
2133
1730
  const level = popup.regexClassification;
2134
1731
  const buttons = popup.buttons;
2135
- const targetButtonType = level === PopupHandlingModes.Reject ? "reject" : level === PopupHandlingModes.Tier1 ? "acknowledge" : "accept";
1732
+ const targetButtonType = level === "reject" ? "reject" : level === "tier1" ? "acknowledge" : "accept";
2136
1733
  return buttons.find((button) => button.regexClassification === targetButtonType);
2137
1734
  }
2138
1735
  optOut() {
@@ -2158,76 +1755,6 @@
2158
1755
  }
2159
1756
  };
2160
1757
 
2161
- // lib/cmps/consentomatic.ts
2162
- var ConsentOMaticCMP = class {
2163
- constructor(name, config) {
2164
- this.name = name;
2165
- this.config = config;
2166
- this.methods = /* @__PURE__ */ new Map();
2167
- this.runContext = defaultRunContext;
2168
- this.isCosmetic = false;
2169
- config.methods.forEach((methodConfig) => {
2170
- if (methodConfig.action) {
2171
- this.methods.set(methodConfig.name, methodConfig.action);
2172
- }
2173
- });
2174
- this.hasSelfTest = false;
2175
- }
2176
- get isIntermediate() {
2177
- return false;
2178
- }
2179
- checkRunContext() {
2180
- return true;
2181
- }
2182
- checkFrameContext(isTop) {
2183
- return true;
2184
- }
2185
- hasMatchingUrlPattern() {
2186
- return false;
2187
- }
2188
- async detectCmp() {
2189
- const matchResults = this.config.detectors.map((detectorConfig) => matches(detectorConfig.presentMatcher));
2190
- return matchResults.some((r) => !!r);
2191
- }
2192
- async detectPopup() {
2193
- const matchResults = this.config.detectors.map((detectorConfig) => matches(detectorConfig.showingMatcher));
2194
- return matchResults.some((r) => !!r);
2195
- }
2196
- async executeAction(method, param) {
2197
- if (this.methods.has(method)) {
2198
- return executeAction(this.methods.get(method), param);
2199
- }
2200
- return true;
2201
- }
2202
- async optOut() {
2203
- await this.executeAction("HIDE_CMP");
2204
- await this.executeAction("OPEN_OPTIONS");
2205
- await this.executeAction("HIDE_CMP");
2206
- await this.executeAction("DO_CONSENT", []);
2207
- await this.executeAction("SAVE_CONSENT");
2208
- return true;
2209
- }
2210
- async optIn() {
2211
- await this.executeAction("HIDE_CMP");
2212
- await this.executeAction("OPEN_OPTIONS");
2213
- await this.executeAction("HIDE_CMP");
2214
- await this.executeAction("DO_CONSENT", ["D", "A", "B", "E", "F", "X"]);
2215
- await this.executeAction("SAVE_CONSENT");
2216
- return true;
2217
- }
2218
- async openCmp() {
2219
- await this.executeAction("HIDE_CMP");
2220
- await this.executeAction("OPEN_OPTIONS");
2221
- return true;
2222
- }
2223
- async test() {
2224
- return true;
2225
- }
2226
- };
2227
-
2228
- // lib/rules.ts
2229
- var SUPPORTED_RULE_STEP_VERSION = 2;
2230
-
2231
1758
  // lib/cmps/trustarc-top.ts
2232
1759
  var cookieSettingsButton = "#truste-show-consent";
2233
1760
  var shortcutOptOut = "#truste-consent-required";
@@ -3255,15 +2782,15 @@
3255
2782
  }
3256
2783
  querySelectorChain(selectors) {
3257
2784
  let parent = document;
3258
- let matches2 = [];
2785
+ let matches = [];
3259
2786
  for (const selector of selectors) {
3260
- matches2 = this.querySingleReplySelector(selector, parent);
3261
- if (matches2.length === 0) {
2787
+ matches = this.querySingleReplySelector(selector, parent);
2788
+ if (matches.length === 0) {
3262
2789
  return [];
3263
2790
  }
3264
- parent = matches2[0];
2791
+ parent = matches[0];
3265
2792
  }
3266
- return matches2;
2793
+ return matches;
3267
2794
  }
3268
2795
  elementSelector(selector) {
3269
2796
  if (typeof selector === "string") {
@@ -3410,8 +2937,6 @@
3410
2937
  this.rules = [];
3411
2938
  __privateAdd(this, _config);
3412
2939
  this.state = {
3413
- cosmeticFiltersOn: false,
3414
- filterListReported: false,
3415
2940
  lifecycle: "loading",
3416
2941
  prehideOn: false,
3417
2942
  findCmpAttempts: 0,
@@ -3461,9 +2986,6 @@
3461
2986
  if (declarativeRules) {
3462
2987
  this.parseDeclarativeRules(declarativeRules);
3463
2988
  }
3464
- if (config.enableFilterList) {
3465
- this.initializeFilterList();
3466
- }
3467
2989
  this.rules = filterCMPs(this.rules, normalizedConfig);
3468
2990
  if (this.shouldPrehide) {
3469
2991
  if (document.documentElement) {
@@ -3487,8 +3009,6 @@
3487
3009
  }
3488
3010
  this.updateState({ lifecycle: "initialized" });
3489
3011
  }
3490
- initializeFilterList() {
3491
- }
3492
3012
  get shouldPrehide() {
3493
3013
  return this.config.enablePrehide && !this.config.visualTest;
3494
3014
  }
@@ -3517,11 +3037,6 @@
3517
3037
  parseDeclarativeRules(declarativeRules) {
3518
3038
  const perfEnabled = __privateGet(this, _config)?.performanceLoggingEnabled;
3519
3039
  perfEnabled && performance.mark("parseDeclarativeRulesStart");
3520
- if (declarativeRules.consentomatic) {
3521
- for (const [name, rule] of Object.entries(declarativeRules.consentomatic)) {
3522
- this.addConsentomaticCMP(name, rule);
3523
- }
3524
- }
3525
3040
  if (declarativeRules.autoconsent) {
3526
3041
  declarativeRules.autoconsent.forEach((ruleset) => {
3527
3042
  this.addDeclarativeCMP(ruleset);
@@ -3543,9 +3058,6 @@
3543
3058
  this.rules.push(new AutoConsentCMP(ruleset, this));
3544
3059
  }
3545
3060
  }
3546
- addConsentomaticCMP(name, config) {
3547
- this.rules.push(new ConsentOMaticCMP(`com_${name}`, config));
3548
- }
3549
3061
  // start the detection process, possibly with a delay
3550
3062
  start() {
3551
3063
  scheduleWhenIdle(() => this._start());
@@ -3564,7 +3076,8 @@
3564
3076
  if (this.shouldPrehide) {
3565
3077
  this.undoPrehide();
3566
3078
  }
3567
- return this.filterListFallback();
3079
+ this.updateState({ lifecycle: "nothingDetected" });
3080
+ return false;
3568
3081
  }
3569
3082
  this.updateState({ lifecycle: "cmpDetected" });
3570
3083
  const staticCmps = [];
@@ -3622,7 +3135,7 @@
3622
3135
  }
3623
3136
  }
3624
3137
  });
3625
- const heuristicRules = isTop && this.config.enableHeuristicAction && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3138
+ const heuristicRules = isTop && this.config.heuristicMode !== "off" && this.state.findCmpAttempts % 2 === 0 ? [new AutoConsentHeuristicCMP(this, this.config.heuristicMode)] : [];
3626
3139
  const rulesPriorityStages = [
3627
3140
  ["site-specific", siteSpecificRules],
3628
3141
  ["generic", genericRules],
@@ -3730,9 +3243,6 @@
3730
3243
  if (this.shouldPrehide && !this.state.prehideOn) {
3731
3244
  this.prehideElements();
3732
3245
  }
3733
- if (this.state.cosmeticFiltersOn) {
3734
- this.undoCosmetics();
3735
- }
3736
3246
  this.foundCmp = cmp;
3737
3247
  if (this.config.autoAction === "optOut") {
3738
3248
  return await this.doOptOut();
@@ -3896,25 +3406,6 @@
3896
3406
  this.updateState({ prehideOn: false });
3897
3407
  this.domActions.undoPrehide();
3898
3408
  }
3899
- undoCosmetics() {
3900
- }
3901
- reportFilterlist() {
3902
- this.sendContentMessage({
3903
- type: "cmpDetected",
3904
- url: location.href,
3905
- cmp: "filterList"
3906
- });
3907
- this.sendContentMessage({
3908
- type: "popupFound",
3909
- cmp: "filterList",
3910
- url: location.href
3911
- });
3912
- this.updateState({ filterListReported: true });
3913
- }
3914
- filterListFallback() {
3915
- this.updateState({ lifecycle: "nothingDetected" });
3916
- return false;
3917
- }
3918
3409
  updateState(change) {
3919
3410
  Object.assign(this.state, change);
3920
3411
  this.sendContentMessage({
@@ -3965,12 +3456,9 @@
3965
3456
  };
3966
3457
  _config = new WeakMap();
3967
3458
 
3968
- // rules/consentomatic.json
3969
- var consentomatic = { oil: { detectors: [{ presentMatcher: { target: { selector: ".as-oil-content-overlay" }, type: "css" }, showingMatcher: { target: { selector: ".as-oil-content-overlay" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".as-js-advanced-settings" }, type: "click" }, { retries: "10", target: { selector: ".as-oil-cpc__purpose-container" }, type: "waitcss", waitTime: "250" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ consents: [{ matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Information storage and access", "Opbevaring af og adgang til oplysninger p\xE5 din enhed"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Information storage and access", "Opbevaring af og adgang til oplysninger p\xE5 din enhed"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "D" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personlige annoncer", "Personalisation"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personlige annoncer", "Personalisation"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Annoncevalg, levering og rapportering", "Ad selection, delivery, reporting"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Annoncevalg, levering og rapportering", "Ad selection, delivery, reporting"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personalisering af indhold", "Content selection, delivery, reporting"] }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: ["Personalisering af indhold", "Content selection, delivery, reporting"] }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "E" }, { matcher: { parent: { childFilter: { target: { selector: ".as-oil-cpc__purpose-header", textFilter: ["M\xE5ling", "Measurement"] } }, selector: ".as-oil-cpc__purpose-container" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { childFilter: { target: { selector: ".as-oil-cpc__purpose-header", textFilter: ["M\xE5ling", "Measurement"] } }, selector: ".as-oil-cpc__purpose-container" }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: "Google" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".as-oil-cpc__purpose-container", textFilter: "Google" }, target: { selector: ".as-oil-cpc__switch" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, name: "DO_CONSENT" }, { action: { target: { selector: ".as-oil__btn-optin" }, type: "click" }, name: "SAVE_CONSENT" }, { action: { target: { selector: "div.as-oil" }, type: "hide" }, name: "HIDE_CMP" }] }, optanon: { detectors: [{ presentMatcher: { target: { selector: "#optanon-menu, .optanon-alert-box-wrapper" }, type: "css" }, showingMatcher: { target: { displayFilter: true, selector: ".optanon-alert-box-wrapper" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".optanon-alert-box-wrapper .optanon-toggle-display, a[onclick*='OneTrust.ToggleInfoDisplay()'], a[onclick*='Optanon.ToggleInfoDisplay()']" }, type: "click" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ target: { selector: ".preference-menu-item #Your-privacy" }, type: "click" }, { target: { selector: "#optanon-vendor-consent-text" }, type: "click" }, { action: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, target: { selector: "#optanon-vendor-consent-list .vendor-item" }, type: "foreach" }, { target: { selector: ".vendor-consent-back-link" }, type: "click" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-performance" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-performance" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-functional" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-functional" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-advertising" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-advertising" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-social" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-social" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Social Media Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Social Media Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalisation" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalisation" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Site monitoring cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Site monitoring cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Third party privacy-enhanced content" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Third party privacy-enhanced content" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Performance & Advertising Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Performance & Advertising Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Information storage and access" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Information storage and access" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "D" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad selection, delivery, reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad selection, delivery, reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content selection, delivery, reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content selection, delivery, reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Measurement" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Measurement" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Recommended Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Recommended Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Unclassified Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Unclassified Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "X" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Analytical Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Analytical Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "B" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Marketing Cookies" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Marketing Cookies" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalization" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Personalization" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad Selection, Delivery & Reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Ad Selection, Delivery & Reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, type: "ifcss" }, { parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content Selection, Delivery & Reporting" }, trueAction: { actions: [{ parent: { selector: "#optanon-menu, .optanon-menu" }, target: { selector: ".menu-item-necessary", textFilter: "Content Selection, Delivery & Reporting" }, type: "click" }, { consents: [{ matcher: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status input" }, type: "checkbox" }, toggleAction: { parent: { selector: "#optanon-popup-body-right" }, target: { selector: ".optanon-status label" }, type: "click" }, type: "E" }], type: "consent" }], type: "list" }, type: "ifcss" }], type: "list" }, name: "DO_CONSENT" }, { action: { parent: { selector: ".optanon-save-settings-button" }, target: { selector: ".optanon-white-button-middle" }, type: "click" }, name: "SAVE_CONSENT" }, { action: { actions: [{ target: { selector: "#optanon-popup-wrapper" }, type: "hide" }, { target: { selector: "#optanon-popup-bg" }, type: "hide" }, { target: { selector: ".optanon-alert-box-wrapper" }, type: "hide" }], type: "list" }, name: "HIDE_CMP" }] }, quantcast2: { detectors: [{ presentMatcher: { target: { selector: "[data-tracking-opt-in-overlay]" }, type: "css" }, showingMatcher: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-learn-more]" }, type: "css" } }], methods: [{ action: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-learn-more]" }, type: "click" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ type: "wait", waitTime: 500 }, { action: { actions: [{ target: { selector: "div", textFilter: ["Information storage and access"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "D" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Personalization"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Ad selection, delivery, reporting"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Content selection, delivery, reporting"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "E" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Measurement"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "B" }], type: "consent" }, type: "ifcss" }, { target: { selector: "div", textFilter: ["Other Partners"] }, trueAction: { consents: [{ matcher: { target: { selector: "input" }, type: "checkbox" }, toggleAction: { target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, type: "ifcss" }], type: "list" }, parent: { childFilter: { target: { selector: "input" } }, selector: "[data-tracking-opt-in-overlay] > div > div" }, target: { childFilter: { target: { selector: "input" } }, selector: ":scope > div" }, type: "foreach" }], type: "list" }, name: "DO_CONSENT" }, { action: { target: { selector: "[data-tracking-opt-in-overlay] [data-tracking-opt-in-save]" }, type: "click" }, name: "SAVE_CONSENT" }] }, springer: { detectors: [{ presentMatcher: { parent: null, target: { selector: ".cmp-app_gdpr" }, type: "css" }, showingMatcher: { parent: null, target: { displayFilter: true, selector: ".cmp-popup_popup" }, type: "css" } }], methods: [{ action: { actions: [{ target: { selector: ".cmp-intro_rejectAll" }, type: "click" }, { type: "wait", waitTime: 250 }, { target: { selector: ".cmp-purposes_purposeItem:not(.cmp-purposes_selectedPurpose)" }, type: "click" }], type: "list" }, name: "OPEN_OPTIONS" }, { action: { consents: [{ matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Przechowywanie informacji na urz\u0105dzeniu lub dost\u0119p do nich", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Przechowywanie informacji na urz\u0105dzeniu lub dost\u0119p do nich", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "D" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r podstawowych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r podstawowych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "F" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Tworzenie profilu spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "E" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Wyb\xF3r spersonalizowanych tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci reklam", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Pomiar wydajno\u015Bci tre\u015Bci", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "B" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Stosowanie bada\u0144 rynkowych w celu generowania opinii odbiorc\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Stosowanie bada\u0144 rynkowych w celu generowania opinii odbiorc\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "X" }, { matcher: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Opracowywanie i ulepszanie produkt\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch .cmp-switch_isSelected" }, type: "css" }, toggleAction: { parent: { selector: ".cmp-purposes_detailHeader", textFilter: "Opracowywanie i ulepszanie produkt\xF3w", childFilter: { target: { selector: ".cmp-switch_switch" } } }, target: { selector: ".cmp-switch_switch:not(.cmp-switch_isSelected)" }, type: "click" }, type: "X" }], type: "consent" }, name: "DO_CONSENT" }, { action: { target: { selector: ".cmp-details_save" }, type: "click" }, name: "SAVE_CONSENT" }] }, wordpressgdpr: { detectors: [{ presentMatcher: { parent: null, target: { selector: ".wpgdprc-consent-bar" }, type: "css" }, showingMatcher: { parent: null, target: { displayFilter: true, selector: ".wpgdprc-consent-bar" }, type: "css" } }], methods: [{ action: { parent: null, target: { selector: ".wpgdprc-consent-bar .wpgdprc-consent-bar__settings", textFilter: null }, type: "click" }, name: "OPEN_OPTIONS" }, { action: { actions: [{ target: { selector: ".wpgdprc-consent-modal .wpgdprc-button", textFilter: "Eyeota" }, type: "click" }, { consents: [{ description: "Eyeota Cookies", matcher: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Eyeota" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Eyeota" }, target: { selector: "label" }, type: "click" }, type: "X" }], type: "consent" }, { target: { selector: ".wpgdprc-consent-modal .wpgdprc-button", textFilter: "Advertising" }, type: "click" }, { consents: [{ description: "Advertising Cookies", matcher: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Advertising" }, target: { selector: "input" }, type: "checkbox" }, toggleAction: { parent: { selector: ".wpgdprc-consent-modal__description", textFilter: "Advertising" }, target: { selector: "label" }, type: "click" }, type: "F" }], type: "consent" }], type: "list" }, name: "DO_CONSENT" }, { action: { parent: null, target: { selector: ".wpgdprc-button", textFilter: "Save my settings" }, type: "click" }, name: "SAVE_CONSENT" }] } };
3970
-
3971
3459
  // playwright/content.ts
3972
3460
  if (!window.autoconsentReceiveMessage) {
3973
- const consent = new AutoConsent(window.autoconsentSendMessage, null, { autoconsent: [], consentomatic });
3461
+ const consent = new AutoConsent(window.autoconsentSendMessage, null, { autoconsent: [] });
3974
3462
  window.autoconsentReceiveMessage = (message) => {
3975
3463
  return Promise.resolve(consent.receiveMessageCallback(message));
3976
3464
  };