@duckduckgo/autoconsent 10.7.0 → 10.8.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/CHANGELOG.md +20 -0
- package/data/coverage.json +997 -1011
- package/dist/addon-firefox/background.bundle.js +2 -0
- package/dist/addon-firefox/content.bundle.js +21 -7
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +2 -0
- package/dist/addon-mv3/content.bundle.js +21 -7
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +21 -7
- package/dist/autoconsent.esm.js +21 -7
- package/dist/autoconsent.playwright.js +1 -1
- package/dist/autoconsent.unit.js +22 -8
- package/lib/cmps/trustarc-frame.ts +25 -6
- package/lib/cmps/trustarc-top.ts +2 -1
- package/lib/eval-snippets.ts +2 -0
- package/package.json +1 -1
- package/rules/autoconsent/instagram.json +1 -1
- package/rules/rules.json +1 -1
package/dist/autoconsent.unit.js
CHANGED
|
@@ -498,6 +498,8 @@
|
|
|
498
498
|
},
|
|
499
499
|
EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(",").filter((s) => s.length > 0).length <= 1,
|
|
500
500
|
EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === "0",
|
|
501
|
+
EVAL_TRUSTARC_FRAME_TEST: () => window && window.QueryString && window.QueryString.preferences === "0",
|
|
502
|
+
EVAL_TRUSTARC_FRAME_GTM: () => window && window.QueryString && window.QueryString.gtm === "1",
|
|
501
503
|
// declarative rules
|
|
502
504
|
EVAL_ADROLL_0: () => !document.cookie.includes("__adroll_fpc"),
|
|
503
505
|
EVAL_ALMACMP_0: () => document.cookie.includes('"name":"Google","consent":false'),
|
|
@@ -1043,7 +1045,7 @@
|
|
|
1043
1045
|
this._optInDone = false;
|
|
1044
1046
|
}
|
|
1045
1047
|
get hasSelfTest() {
|
|
1046
|
-
return
|
|
1048
|
+
return true;
|
|
1047
1049
|
}
|
|
1048
1050
|
get isIntermediate() {
|
|
1049
1051
|
if (this._optInDone) {
|
|
@@ -1090,6 +1092,7 @@
|
|
|
1090
1092
|
return true;
|
|
1091
1093
|
}
|
|
1092
1094
|
async test() {
|
|
1095
|
+
await this.wait(500);
|
|
1093
1096
|
return await this.mainWorldEval("EVAL_TRUSTARC_TOP");
|
|
1094
1097
|
}
|
|
1095
1098
|
};
|
|
@@ -1106,7 +1109,7 @@
|
|
|
1106
1109
|
};
|
|
1107
1110
|
}
|
|
1108
1111
|
get hasSelfTest() {
|
|
1109
|
-
return
|
|
1112
|
+
return true;
|
|
1110
1113
|
}
|
|
1111
1114
|
get isIntermediate() {
|
|
1112
1115
|
return false;
|
|
@@ -1142,27 +1145,34 @@
|
|
|
1142
1145
|
);
|
|
1143
1146
|
}
|
|
1144
1147
|
async optOut() {
|
|
1148
|
+
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_TEST")) {
|
|
1149
|
+
return true;
|
|
1150
|
+
}
|
|
1151
|
+
let timeout = 3e3;
|
|
1152
|
+
if (await this.mainWorldEval("EVAL_TRUSTARC_FRAME_GTM")) {
|
|
1153
|
+
timeout = 1500;
|
|
1154
|
+
}
|
|
1145
1155
|
await waitFor(() => document.readyState === "complete", 20, 100);
|
|
1146
|
-
await this.waitForElement(".mainContent[aria-hidden=false]",
|
|
1156
|
+
await this.waitForElement(".mainContent[aria-hidden=false]", timeout);
|
|
1147
1157
|
if (this.click(".rejectAll")) {
|
|
1148
1158
|
return true;
|
|
1149
1159
|
}
|
|
1150
1160
|
if (this.elementExists(".prefPanel")) {
|
|
1151
|
-
await this.waitForElement('.prefPanel[style="visibility: visible;"]',
|
|
1161
|
+
await this.waitForElement('.prefPanel[style="visibility: visible;"]', timeout);
|
|
1152
1162
|
}
|
|
1153
1163
|
if (this.click("#catDetails0")) {
|
|
1154
1164
|
this.click(".submit");
|
|
1155
|
-
this.waitForThenClick("#gwt-debug-close_id",
|
|
1165
|
+
this.waitForThenClick("#gwt-debug-close_id", timeout);
|
|
1156
1166
|
return true;
|
|
1157
1167
|
}
|
|
1158
1168
|
if (this.click(".required")) {
|
|
1159
|
-
this.waitForThenClick("#gwt-debug-close_id",
|
|
1169
|
+
this.waitForThenClick("#gwt-debug-close_id", timeout);
|
|
1160
1170
|
return true;
|
|
1161
1171
|
}
|
|
1162
1172
|
await this.navigateToSettings();
|
|
1163
1173
|
this.click(".switch span:nth-child(1):not(.active)", true);
|
|
1164
1174
|
this.click(".submit");
|
|
1165
|
-
this.waitForThenClick("#gwt-debug-close_id",
|
|
1175
|
+
this.waitForThenClick("#gwt-debug-close_id", timeout * 10);
|
|
1166
1176
|
return true;
|
|
1167
1177
|
}
|
|
1168
1178
|
async optIn() {
|
|
@@ -1177,6 +1187,10 @@
|
|
|
1177
1187
|
});
|
|
1178
1188
|
return true;
|
|
1179
1189
|
}
|
|
1190
|
+
async test() {
|
|
1191
|
+
await this.wait(500);
|
|
1192
|
+
return await this.mainWorldEval("EVAL_TRUSTARC_FRAME_TEST");
|
|
1193
|
+
}
|
|
1180
1194
|
};
|
|
1181
1195
|
|
|
1182
1196
|
// lib/cmps/cookiebot.ts
|
|
@@ -5751,7 +5765,7 @@
|
|
|
5751
5765
|
urlPattern: "^https://www\\.instagram\\.com/"
|
|
5752
5766
|
},
|
|
5753
5767
|
prehideSelectors: [
|
|
5754
|
-
".x78zum5.xdt5ytf.xg6iff7.x1n2onr6"
|
|
5768
|
+
".x78zum5.xdt5ytf.xg6iff7.x1n2onr6:has(._a9--)"
|
|
5755
5769
|
],
|
|
5756
5770
|
detectCmp: [
|
|
5757
5771
|
{
|
|
@@ -12,7 +12,7 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
get hasSelfTest(): boolean {
|
|
15
|
-
return
|
|
15
|
+
return true;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
get isIntermediate(): boolean {
|
|
@@ -66,25 +66,37 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
async optOut() {
|
|
69
|
+
|
|
70
|
+
// if the user has already opted out, let's not close the window
|
|
71
|
+
if (await this.mainWorldEval('EVAL_TRUSTARC_FRAME_TEST')){
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//When Tags are being controlled through a tag managment system, the window will not call the vendors' opt-out
|
|
76
|
+
let timeout = 3000;
|
|
77
|
+
if (await this.mainWorldEval('EVAL_TRUSTARC_FRAME_GTM')) {
|
|
78
|
+
timeout = 1500;
|
|
79
|
+
}
|
|
80
|
+
|
|
69
81
|
await waitFor(() => document.readyState === 'complete', 20, 100);
|
|
70
|
-
await this.waitForElement(".mainContent[aria-hidden=false]",
|
|
82
|
+
await this.waitForElement(".mainContent[aria-hidden=false]", timeout);
|
|
71
83
|
|
|
72
84
|
if (this.click(".rejectAll")) {
|
|
73
85
|
return true;
|
|
74
86
|
}
|
|
75
87
|
|
|
76
88
|
if (this.elementExists('.prefPanel')) {
|
|
77
|
-
await this.waitForElement('.prefPanel[style="visibility: visible;"]',
|
|
89
|
+
await this.waitForElement('.prefPanel[style="visibility: visible;"]', timeout);
|
|
78
90
|
}
|
|
79
91
|
|
|
80
92
|
if (this.click("#catDetails0")) {
|
|
81
93
|
this.click(".submit");
|
|
82
|
-
this.waitForThenClick("#gwt-debug-close_id",
|
|
94
|
+
this.waitForThenClick("#gwt-debug-close_id", timeout);
|
|
83
95
|
return true;
|
|
84
96
|
}
|
|
85
97
|
|
|
86
98
|
if (this.click(".required")) {
|
|
87
|
-
this.waitForThenClick("#gwt-debug-close_id",
|
|
99
|
+
this.waitForThenClick("#gwt-debug-close_id", timeout);
|
|
88
100
|
return true;
|
|
89
101
|
}
|
|
90
102
|
|
|
@@ -95,7 +107,7 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
|
|
|
95
107
|
this.click(".submit");
|
|
96
108
|
|
|
97
109
|
// at this point, iframe usually closes. Sometimes we need to close manually, but we don't wait for it to report success
|
|
98
|
-
this.waitForThenClick("#gwt-debug-close_id",
|
|
110
|
+
this.waitForThenClick("#gwt-debug-close_id", timeout*10);
|
|
99
111
|
|
|
100
112
|
return true;
|
|
101
113
|
}
|
|
@@ -116,4 +128,11 @@ export default class TrustArcFrame extends AutoConsentCMPBase {
|
|
|
116
128
|
|
|
117
129
|
return true;
|
|
118
130
|
}
|
|
131
|
+
|
|
132
|
+
async test() {
|
|
133
|
+
//Test JS variable to check the user's preference
|
|
134
|
+
//preferences = undefined means no consent is set, preferences = '0' means consent is set to required only
|
|
135
|
+
await this.wait(500);
|
|
136
|
+
return await this.mainWorldEval('EVAL_TRUSTARC_FRAME_TEST');
|
|
137
|
+
}
|
|
119
138
|
}
|
package/lib/cmps/trustarc-top.ts
CHANGED
|
@@ -31,7 +31,7 @@ export default class TrustArcTop extends AutoConsentCMPBase {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
get hasSelfTest(): boolean {
|
|
34
|
-
return
|
|
34
|
+
return true;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
get isIntermediate(): boolean {
|
|
@@ -97,6 +97,7 @@ export default class TrustArcTop extends AutoConsentCMPBase {
|
|
|
97
97
|
async test() {
|
|
98
98
|
//Test JS variable to check the user's preference
|
|
99
99
|
//PrefCookie = undefined means no consent is set, PrefCookie = '0' means consent is set to required only
|
|
100
|
+
await this.wait(500);
|
|
100
101
|
return await this.mainWorldEval('EVAL_TRUSTARC_TOP');
|
|
101
102
|
}
|
|
102
103
|
}
|
package/lib/eval-snippets.ts
CHANGED
|
@@ -49,6 +49,8 @@ export const snippets = {
|
|
|
49
49
|
},
|
|
50
50
|
EVAL_ONETRUST_1: () => window.OnetrustActiveGroups.split(',').filter(s => s.length > 0).length <= 1,
|
|
51
51
|
EVAL_TRUSTARC_TOP: () => window && window.truste && window.truste.eu.bindMap.prefCookie === '0',
|
|
52
|
+
EVAL_TRUSTARC_FRAME_TEST: () => window && window.QueryString && window.QueryString.preferences === '0',
|
|
53
|
+
EVAL_TRUSTARC_FRAME_GTM: () => window && window.QueryString && window.QueryString.gtm === '1',
|
|
52
54
|
|
|
53
55
|
// declarative rules
|
|
54
56
|
EVAL_ADROLL_0: () => !document.cookie.includes('__adroll_fpc'),
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"runContext": {
|
|
5
5
|
"urlPattern": "^https://www\\.instagram\\.com/"
|
|
6
6
|
},
|
|
7
|
-
"prehideSelectors": [".x78zum5.xdt5ytf.xg6iff7.x1n2onr6"],
|
|
7
|
+
"prehideSelectors": [".x78zum5.xdt5ytf.xg6iff7.x1n2onr6:has(._a9--)"],
|
|
8
8
|
"detectCmp": [
|
|
9
9
|
{
|
|
10
10
|
"exists": ".x1qjc9v5.x9f619.x78zum5.xdt5ytf.x1iyjqo2.xl56j7k"
|
package/rules/rules.json
CHANGED