@duckduckgo/autoconsent 10.6.3 → 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 +37 -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 +50 -4
- 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 +50 -4
- 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 +71 -11
- 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/espace-personnel-agirc-arrco-fr.json +29 -0
- package/rules/autoconsent/instagram.json +1 -1
- package/rules/autoconsent/termsfeed3.json +10 -3
- package/rules/rules.json +50 -4
- package/tests/espace-personnel-agirc-arrco-fr.spec.ts +5 -0
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
|
|
@@ -4986,6 +5000,35 @@
|
|
|
4986
5000
|
}
|
|
4987
5001
|
]
|
|
4988
5002
|
},
|
|
5003
|
+
{
|
|
5004
|
+
name: "espace-personnel.agirc-arrco.fr",
|
|
5005
|
+
runContext: {
|
|
5006
|
+
urlPattern: "^https://espace-personnel\\.agirc-arrco\\.fr/"
|
|
5007
|
+
},
|
|
5008
|
+
prehideSelectors: [
|
|
5009
|
+
".cdk-overlay-container"
|
|
5010
|
+
],
|
|
5011
|
+
detectCmp: [
|
|
5012
|
+
{
|
|
5013
|
+
exists: ".cdk-overlay-container app-esaa-cookie-component"
|
|
5014
|
+
}
|
|
5015
|
+
],
|
|
5016
|
+
detectPopup: [
|
|
5017
|
+
{
|
|
5018
|
+
visible: ".cdk-overlay-container app-esaa-cookie-component"
|
|
5019
|
+
}
|
|
5020
|
+
],
|
|
5021
|
+
optIn: [
|
|
5022
|
+
{
|
|
5023
|
+
waitForThenClick: ".btn-cookie-accepter"
|
|
5024
|
+
}
|
|
5025
|
+
],
|
|
5026
|
+
optOut: [
|
|
5027
|
+
{
|
|
5028
|
+
waitForThenClick: ".btn-cookie-refuser"
|
|
5029
|
+
}
|
|
5030
|
+
]
|
|
5031
|
+
},
|
|
4989
5032
|
{
|
|
4990
5033
|
name: "etsy",
|
|
4991
5034
|
prehideSelectors: [
|
|
@@ -5722,7 +5765,7 @@
|
|
|
5722
5765
|
urlPattern: "^https://www\\.instagram\\.com/"
|
|
5723
5766
|
},
|
|
5724
5767
|
prehideSelectors: [
|
|
5725
|
-
".x78zum5.xdt5ytf.xg6iff7.x1n2onr6"
|
|
5768
|
+
".x78zum5.xdt5ytf.xg6iff7.x1n2onr6:has(._a9--)"
|
|
5726
5769
|
],
|
|
5727
5770
|
detectCmp: [
|
|
5728
5771
|
{
|
|
@@ -8135,9 +8178,8 @@
|
|
|
8135
8178
|
name: "termsfeed3",
|
|
8136
8179
|
vendorUrl: "https://termsfeed.com",
|
|
8137
8180
|
comment: "v3.x.x",
|
|
8138
|
-
cosmetic: true,
|
|
8139
8181
|
prehideSelectors: [
|
|
8140
|
-
".cc_dialog.cc_css_reboot"
|
|
8182
|
+
".cc_dialog.cc_css_reboot,.cc_overlay_lock"
|
|
8141
8183
|
],
|
|
8142
8184
|
detectCmp: [
|
|
8143
8185
|
{
|
|
@@ -8156,7 +8198,25 @@
|
|
|
8156
8198
|
],
|
|
8157
8199
|
optOut: [
|
|
8158
8200
|
{
|
|
8159
|
-
|
|
8201
|
+
if: {
|
|
8202
|
+
exists: ".cc_dialog.cc_css_reboot .cc_b_cp"
|
|
8203
|
+
},
|
|
8204
|
+
then: [
|
|
8205
|
+
{
|
|
8206
|
+
click: ".cc_dialog.cc_css_reboot .cc_b_cp"
|
|
8207
|
+
},
|
|
8208
|
+
{
|
|
8209
|
+
waitForVisible: ".cookie-consent-preferences-dialog .cc_cp_f_save button"
|
|
8210
|
+
},
|
|
8211
|
+
{
|
|
8212
|
+
waitForThenClick: ".cookie-consent-preferences-dialog .cc_cp_f_save button"
|
|
8213
|
+
}
|
|
8214
|
+
],
|
|
8215
|
+
else: [
|
|
8216
|
+
{
|
|
8217
|
+
hide: ".cc_dialog.cc_css_reboot,.cc_overlay_lock"
|
|
8218
|
+
}
|
|
8219
|
+
]
|
|
8160
8220
|
}
|
|
8161
8221
|
]
|
|
8162
8222
|
},
|
|
@@ -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
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "espace-personnel.agirc-arrco.fr",
|
|
3
|
+
"runContext": {
|
|
4
|
+
"urlPattern": "^https://espace-personnel\\.agirc-arrco\\.fr/"
|
|
5
|
+
},
|
|
6
|
+
"prehideSelectors": [
|
|
7
|
+
".cdk-overlay-container"
|
|
8
|
+
],
|
|
9
|
+
"detectCmp": [
|
|
10
|
+
{
|
|
11
|
+
"exists": ".cdk-overlay-container app-esaa-cookie-component"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"detectPopup": [
|
|
15
|
+
{
|
|
16
|
+
"visible": ".cdk-overlay-container app-esaa-cookie-component"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"optIn": [
|
|
20
|
+
{
|
|
21
|
+
"waitForThenClick": ".btn-cookie-accepter"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"optOut": [
|
|
25
|
+
{
|
|
26
|
+
"waitForThenClick": ".btn-cookie-refuser"
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
@@ -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"
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
"name": "termsfeed3",
|
|
3
3
|
"vendorUrl": "https://termsfeed.com",
|
|
4
4
|
"comment": "v3.x.x",
|
|
5
|
-
"
|
|
6
|
-
"prehideSelectors": [".cc_dialog.cc_css_reboot"],
|
|
5
|
+
"prehideSelectors": [".cc_dialog.cc_css_reboot,.cc_overlay_lock"],
|
|
7
6
|
"detectCmp": [
|
|
8
7
|
{
|
|
9
8
|
"exists": ".cc_dialog.cc_css_reboot"
|
|
@@ -21,7 +20,15 @@
|
|
|
21
20
|
],
|
|
22
21
|
"optOut": [
|
|
23
22
|
{
|
|
24
|
-
"
|
|
23
|
+
"if": { "exists": ".cc_dialog.cc_css_reboot .cc_b_cp" },
|
|
24
|
+
"then": [
|
|
25
|
+
{ "click": ".cc_dialog.cc_css_reboot .cc_b_cp" },
|
|
26
|
+
{ "waitForVisible": ".cookie-consent-preferences-dialog .cc_cp_f_save button" },
|
|
27
|
+
{ "waitForThenClick": ".cookie-consent-preferences-dialog .cc_cp_f_save button" }
|
|
28
|
+
],
|
|
29
|
+
"else": [
|
|
30
|
+
{ "hide": ".cc_dialog.cc_css_reboot,.cc_overlay_lock" }
|
|
31
|
+
]
|
|
25
32
|
}
|
|
26
33
|
]
|
|
27
34
|
}
|
package/rules/rules.json
CHANGED
|
@@ -2611,6 +2611,35 @@
|
|
|
2611
2611
|
}
|
|
2612
2612
|
]
|
|
2613
2613
|
},
|
|
2614
|
+
{
|
|
2615
|
+
"name": "espace-personnel.agirc-arrco.fr",
|
|
2616
|
+
"runContext": {
|
|
2617
|
+
"urlPattern": "^https://espace-personnel\\.agirc-arrco\\.fr/"
|
|
2618
|
+
},
|
|
2619
|
+
"prehideSelectors": [
|
|
2620
|
+
".cdk-overlay-container"
|
|
2621
|
+
],
|
|
2622
|
+
"detectCmp": [
|
|
2623
|
+
{
|
|
2624
|
+
"exists": ".cdk-overlay-container app-esaa-cookie-component"
|
|
2625
|
+
}
|
|
2626
|
+
],
|
|
2627
|
+
"detectPopup": [
|
|
2628
|
+
{
|
|
2629
|
+
"visible": ".cdk-overlay-container app-esaa-cookie-component"
|
|
2630
|
+
}
|
|
2631
|
+
],
|
|
2632
|
+
"optIn": [
|
|
2633
|
+
{
|
|
2634
|
+
"waitForThenClick": ".btn-cookie-accepter"
|
|
2635
|
+
}
|
|
2636
|
+
],
|
|
2637
|
+
"optOut": [
|
|
2638
|
+
{
|
|
2639
|
+
"waitForThenClick": ".btn-cookie-refuser"
|
|
2640
|
+
}
|
|
2641
|
+
]
|
|
2642
|
+
},
|
|
2614
2643
|
{
|
|
2615
2644
|
"name": "etsy",
|
|
2616
2645
|
"prehideSelectors": [
|
|
@@ -3347,7 +3376,7 @@
|
|
|
3347
3376
|
"urlPattern": "^https://www\\.instagram\\.com/"
|
|
3348
3377
|
},
|
|
3349
3378
|
"prehideSelectors": [
|
|
3350
|
-
".x78zum5.xdt5ytf.xg6iff7.x1n2onr6"
|
|
3379
|
+
".x78zum5.xdt5ytf.xg6iff7.x1n2onr6:has(._a9--)"
|
|
3351
3380
|
],
|
|
3352
3381
|
"detectCmp": [
|
|
3353
3382
|
{
|
|
@@ -5760,9 +5789,8 @@
|
|
|
5760
5789
|
"name": "termsfeed3",
|
|
5761
5790
|
"vendorUrl": "https://termsfeed.com",
|
|
5762
5791
|
"comment": "v3.x.x",
|
|
5763
|
-
"cosmetic": true,
|
|
5764
5792
|
"prehideSelectors": [
|
|
5765
|
-
".cc_dialog.cc_css_reboot"
|
|
5793
|
+
".cc_dialog.cc_css_reboot,.cc_overlay_lock"
|
|
5766
5794
|
],
|
|
5767
5795
|
"detectCmp": [
|
|
5768
5796
|
{
|
|
@@ -5781,7 +5809,25 @@
|
|
|
5781
5809
|
],
|
|
5782
5810
|
"optOut": [
|
|
5783
5811
|
{
|
|
5784
|
-
"
|
|
5812
|
+
"if": {
|
|
5813
|
+
"exists": ".cc_dialog.cc_css_reboot .cc_b_cp"
|
|
5814
|
+
},
|
|
5815
|
+
"then": [
|
|
5816
|
+
{
|
|
5817
|
+
"click": ".cc_dialog.cc_css_reboot .cc_b_cp"
|
|
5818
|
+
},
|
|
5819
|
+
{
|
|
5820
|
+
"waitForVisible": ".cookie-consent-preferences-dialog .cc_cp_f_save button"
|
|
5821
|
+
},
|
|
5822
|
+
{
|
|
5823
|
+
"waitForThenClick": ".cookie-consent-preferences-dialog .cc_cp_f_save button"
|
|
5824
|
+
}
|
|
5825
|
+
],
|
|
5826
|
+
"else": [
|
|
5827
|
+
{
|
|
5828
|
+
"hide": ".cc_dialog.cc_css_reboot,.cc_overlay_lock"
|
|
5829
|
+
}
|
|
5830
|
+
]
|
|
5785
5831
|
}
|
|
5786
5832
|
]
|
|
5787
5833
|
},
|