@duckduckgo/autoconsent 9.5.0 → 9.6.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 +18 -0
- package/dist/addon-firefox/content.bundle.js +13 -6
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rules.json +51 -9
- package/dist/addon-mv3/content.bundle.js +13 -6
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rules.json +51 -9
- package/dist/autoconsent.cjs.js +13 -6
- package/dist/autoconsent.esm.js +13 -6
- package/dist/autoconsent.playwright.js +1 -1
- package/dist/autoconsent.unit.js +64 -15
- package/lib/web.ts +13 -10
- package/package.json +1 -1
- package/rules/autoconsent/reddit.json +19 -5
- package/rules/autoconsent/tealium.json +4 -4
- package/rules/autoconsent/webflow.json +34 -0
- package/rules/rules.json +51 -9
- package/tests/webflow.spec.ts +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# v9.6.0 (Wed Jan 31 2024)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- Add rule for webflow [#364](https://github.com/duckduckgo/autoconsent/pull/364) ([@muodov](https://github.com/muodov))
|
|
6
|
+
- Handle Tealium implicit modal [#363](https://github.com/duckduckgo/autoconsent/pull/363) ([@muodov](https://github.com/muodov))
|
|
7
|
+
- Fix reddit rule [#362](https://github.com/duckduckgo/autoconsent/pull/362) ([@muodov](https://github.com/muodov))
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fix
|
|
10
|
+
|
|
11
|
+
- regression fix: Do not run opt-out unless a pop-up is actually shown [#365](https://github.com/duckduckgo/autoconsent/pull/365) ([@muodov](https://github.com/muodov))
|
|
12
|
+
|
|
13
|
+
#### Authors: 1
|
|
14
|
+
|
|
15
|
+
- Maxim Tsoy ([@muodov](https://github.com/muodov))
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
1
19
|
# v9.5.0 (Wed Jan 31 2024)
|
|
2
20
|
|
|
3
21
|
#### 🚀 Enhancement
|
|
@@ -2065,8 +2065,14 @@
|
|
|
2065
2065
|
}
|
|
2066
2066
|
return foundCMPs;
|
|
2067
2067
|
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Detect if a CMP has a popup open. Fullfils with the CMP if a popup is open, otherwise rejects.
|
|
2070
|
+
*/
|
|
2068
2071
|
async detectPopup(cmp) {
|
|
2069
|
-
const isOpen = await this.waitForPopup(cmp)
|
|
2072
|
+
const isOpen = await this.waitForPopup(cmp).catch((error) => {
|
|
2073
|
+
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2074
|
+
return false;
|
|
2075
|
+
});
|
|
2070
2076
|
if (isOpen) {
|
|
2071
2077
|
this.updateState({ detectedPopups: this.state.detectedPopups.concat([cmp.name]) });
|
|
2072
2078
|
this.sendContentMessage({
|
|
@@ -2074,15 +2080,16 @@
|
|
|
2074
2080
|
cmp: cmp.name,
|
|
2075
2081
|
url: location.href
|
|
2076
2082
|
});
|
|
2083
|
+
return cmp;
|
|
2077
2084
|
}
|
|
2078
|
-
|
|
2085
|
+
throw new Error("Popup is not shown");
|
|
2079
2086
|
}
|
|
2087
|
+
/**
|
|
2088
|
+
* Detect if any of the CMPs has a popup open. Returns a list of CMPs with open popups.
|
|
2089
|
+
*/
|
|
2080
2090
|
async detectPopups(cmps, onFirstPopupAppears) {
|
|
2081
2091
|
const tasks = cmps.map(
|
|
2082
|
-
(cmp) => this.detectPopup(cmp)
|
|
2083
|
-
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2084
|
-
throw error;
|
|
2085
|
-
})
|
|
2092
|
+
(cmp) => this.detectPopup(cmp)
|
|
2086
2093
|
);
|
|
2087
2094
|
await Promise.any(tasks).then((cmp) => {
|
|
2088
2095
|
onFirstPopupAppears(cmp);
|
|
@@ -4312,26 +4312,32 @@
|
|
|
4312
4312
|
"urlPattern": "^https://www\\.reddit\\.com/"
|
|
4313
4313
|
},
|
|
4314
4314
|
"prehideSelectors": [
|
|
4315
|
-
"
|
|
4315
|
+
"[bundlename=reddit_cookie_banner]"
|
|
4316
4316
|
],
|
|
4317
4317
|
"detectCmp": [
|
|
4318
4318
|
{
|
|
4319
|
-
"exists": "
|
|
4319
|
+
"exists": "reddit-cookie-banner"
|
|
4320
4320
|
}
|
|
4321
4321
|
],
|
|
4322
4322
|
"detectPopup": [
|
|
4323
4323
|
{
|
|
4324
|
-
"visible": "
|
|
4324
|
+
"visible": "reddit-cookie-banner"
|
|
4325
4325
|
}
|
|
4326
4326
|
],
|
|
4327
4327
|
"optIn": [
|
|
4328
4328
|
{
|
|
4329
|
-
"waitForThenClick":
|
|
4329
|
+
"waitForThenClick": [
|
|
4330
|
+
"reddit-cookie-banner",
|
|
4331
|
+
"#accept-all-cookies-button > button"
|
|
4332
|
+
]
|
|
4330
4333
|
}
|
|
4331
4334
|
],
|
|
4332
4335
|
"optOut": [
|
|
4333
4336
|
{
|
|
4334
|
-
"waitForThenClick":
|
|
4337
|
+
"waitForThenClick": [
|
|
4338
|
+
"reddit-cookie-banner",
|
|
4339
|
+
"#reject-nonessential-cookies-button > button"
|
|
4340
|
+
]
|
|
4335
4341
|
}
|
|
4336
4342
|
],
|
|
4337
4343
|
"test": [
|
|
@@ -4721,11 +4727,11 @@
|
|
|
4721
4727
|
{
|
|
4722
4728
|
"name": "Tealium",
|
|
4723
4729
|
"prehideSelectors": [
|
|
4724
|
-
"#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#consent-layer"
|
|
4730
|
+
"#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#__tealiumImplicitmodal,#consent-layer"
|
|
4725
4731
|
],
|
|
4726
4732
|
"detectCmp": [
|
|
4727
4733
|
{
|
|
4728
|
-
"exists": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *"
|
|
4734
|
+
"exists": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *,#__tealiumImplicitmodal *"
|
|
4729
4735
|
},
|
|
4730
4736
|
{
|
|
4731
4737
|
"eval": "EVAL_TEALIUM_0"
|
|
@@ -4733,7 +4739,7 @@
|
|
|
4733
4739
|
],
|
|
4734
4740
|
"detectPopup": [
|
|
4735
4741
|
{
|
|
4736
|
-
"visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *",
|
|
4742
|
+
"visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *,#__tealiumImplicitmodal *",
|
|
4737
4743
|
"check": "any"
|
|
4738
4744
|
}
|
|
4739
4745
|
],
|
|
@@ -4745,7 +4751,7 @@
|
|
|
4745
4751
|
"eval": "EVAL_TEALIUM_DONOTSELL"
|
|
4746
4752
|
},
|
|
4747
4753
|
{
|
|
4748
|
-
"hide": "#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs"
|
|
4754
|
+
"hide": "#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#__tealiumImplicitmodal"
|
|
4749
4755
|
},
|
|
4750
4756
|
{
|
|
4751
4757
|
"waitForThenClick": "#cm-acceptNone,.js-accept-essential-cookies",
|
|
@@ -5709,6 +5715,42 @@
|
|
|
5709
5715
|
}
|
|
5710
5716
|
]
|
|
5711
5717
|
},
|
|
5718
|
+
{
|
|
5719
|
+
"name": "webflow",
|
|
5720
|
+
"vendorUrl": "https://webflow.com/",
|
|
5721
|
+
"prehideSelectors": [
|
|
5722
|
+
".fs-cc-components"
|
|
5723
|
+
],
|
|
5724
|
+
"detectCmp": [
|
|
5725
|
+
{
|
|
5726
|
+
"exists": ".fs-cc-components"
|
|
5727
|
+
}
|
|
5728
|
+
],
|
|
5729
|
+
"detectPopup": [
|
|
5730
|
+
{
|
|
5731
|
+
"visible": ".fs-cc-components"
|
|
5732
|
+
},
|
|
5733
|
+
{
|
|
5734
|
+
"visible": "[fs-cc=banner]"
|
|
5735
|
+
}
|
|
5736
|
+
],
|
|
5737
|
+
"optIn": [
|
|
5738
|
+
{
|
|
5739
|
+
"wait": 500
|
|
5740
|
+
},
|
|
5741
|
+
{
|
|
5742
|
+
"waitForThenClick": "[fs-cc=banner] [fs-cc=allow]"
|
|
5743
|
+
}
|
|
5744
|
+
],
|
|
5745
|
+
"optOut": [
|
|
5746
|
+
{
|
|
5747
|
+
"wait": 500
|
|
5748
|
+
},
|
|
5749
|
+
{
|
|
5750
|
+
"waitForThenClick": "[fs-cc=banner] [fs-cc=deny]"
|
|
5751
|
+
}
|
|
5752
|
+
]
|
|
5753
|
+
},
|
|
5712
5754
|
{
|
|
5713
5755
|
"name": "wetransfer.com",
|
|
5714
5756
|
"detectCmp": [
|
|
@@ -2065,8 +2065,14 @@
|
|
|
2065
2065
|
}
|
|
2066
2066
|
return foundCMPs;
|
|
2067
2067
|
}
|
|
2068
|
+
/**
|
|
2069
|
+
* Detect if a CMP has a popup open. Fullfils with the CMP if a popup is open, otherwise rejects.
|
|
2070
|
+
*/
|
|
2068
2071
|
async detectPopup(cmp) {
|
|
2069
|
-
const isOpen = await this.waitForPopup(cmp)
|
|
2072
|
+
const isOpen = await this.waitForPopup(cmp).catch((error) => {
|
|
2073
|
+
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2074
|
+
return false;
|
|
2075
|
+
});
|
|
2070
2076
|
if (isOpen) {
|
|
2071
2077
|
this.updateState({ detectedPopups: this.state.detectedPopups.concat([cmp.name]) });
|
|
2072
2078
|
this.sendContentMessage({
|
|
@@ -2074,15 +2080,16 @@
|
|
|
2074
2080
|
cmp: cmp.name,
|
|
2075
2081
|
url: location.href
|
|
2076
2082
|
});
|
|
2083
|
+
return cmp;
|
|
2077
2084
|
}
|
|
2078
|
-
|
|
2085
|
+
throw new Error("Popup is not shown");
|
|
2079
2086
|
}
|
|
2087
|
+
/**
|
|
2088
|
+
* Detect if any of the CMPs has a popup open. Returns a list of CMPs with open popups.
|
|
2089
|
+
*/
|
|
2080
2090
|
async detectPopups(cmps, onFirstPopupAppears) {
|
|
2081
2091
|
const tasks = cmps.map(
|
|
2082
|
-
(cmp) => this.detectPopup(cmp)
|
|
2083
|
-
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2084
|
-
throw error;
|
|
2085
|
-
})
|
|
2092
|
+
(cmp) => this.detectPopup(cmp)
|
|
2086
2093
|
);
|
|
2087
2094
|
await Promise.any(tasks).then((cmp) => {
|
|
2088
2095
|
onFirstPopupAppears(cmp);
|
|
@@ -4312,26 +4312,32 @@
|
|
|
4312
4312
|
"urlPattern": "^https://www\\.reddit\\.com/"
|
|
4313
4313
|
},
|
|
4314
4314
|
"prehideSelectors": [
|
|
4315
|
-
"
|
|
4315
|
+
"[bundlename=reddit_cookie_banner]"
|
|
4316
4316
|
],
|
|
4317
4317
|
"detectCmp": [
|
|
4318
4318
|
{
|
|
4319
|
-
"exists": "
|
|
4319
|
+
"exists": "reddit-cookie-banner"
|
|
4320
4320
|
}
|
|
4321
4321
|
],
|
|
4322
4322
|
"detectPopup": [
|
|
4323
4323
|
{
|
|
4324
|
-
"visible": "
|
|
4324
|
+
"visible": "reddit-cookie-banner"
|
|
4325
4325
|
}
|
|
4326
4326
|
],
|
|
4327
4327
|
"optIn": [
|
|
4328
4328
|
{
|
|
4329
|
-
"waitForThenClick":
|
|
4329
|
+
"waitForThenClick": [
|
|
4330
|
+
"reddit-cookie-banner",
|
|
4331
|
+
"#accept-all-cookies-button > button"
|
|
4332
|
+
]
|
|
4330
4333
|
}
|
|
4331
4334
|
],
|
|
4332
4335
|
"optOut": [
|
|
4333
4336
|
{
|
|
4334
|
-
"waitForThenClick":
|
|
4337
|
+
"waitForThenClick": [
|
|
4338
|
+
"reddit-cookie-banner",
|
|
4339
|
+
"#reject-nonessential-cookies-button > button"
|
|
4340
|
+
]
|
|
4335
4341
|
}
|
|
4336
4342
|
],
|
|
4337
4343
|
"test": [
|
|
@@ -4721,11 +4727,11 @@
|
|
|
4721
4727
|
{
|
|
4722
4728
|
"name": "Tealium",
|
|
4723
4729
|
"prehideSelectors": [
|
|
4724
|
-
"#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#consent-layer"
|
|
4730
|
+
"#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#__tealiumImplicitmodal,#consent-layer"
|
|
4725
4731
|
],
|
|
4726
4732
|
"detectCmp": [
|
|
4727
4733
|
{
|
|
4728
|
-
"exists": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *"
|
|
4734
|
+
"exists": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *,#__tealiumImplicitmodal *"
|
|
4729
4735
|
},
|
|
4730
4736
|
{
|
|
4731
4737
|
"eval": "EVAL_TEALIUM_0"
|
|
@@ -4733,7 +4739,7 @@
|
|
|
4733
4739
|
],
|
|
4734
4740
|
"detectPopup": [
|
|
4735
4741
|
{
|
|
4736
|
-
"visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *",
|
|
4742
|
+
"visible": "#__tealiumGDPRecModal *,#__tealiumGDPRcpPrefs *,#__tealiumImplicitmodal *",
|
|
4737
4743
|
"check": "any"
|
|
4738
4744
|
}
|
|
4739
4745
|
],
|
|
@@ -4745,7 +4751,7 @@
|
|
|
4745
4751
|
"eval": "EVAL_TEALIUM_DONOTSELL"
|
|
4746
4752
|
},
|
|
4747
4753
|
{
|
|
4748
|
-
"hide": "#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs"
|
|
4754
|
+
"hide": "#__tealiumGDPRecModal,#__tealiumGDPRcpPrefs,#__tealiumImplicitmodal"
|
|
4749
4755
|
},
|
|
4750
4756
|
{
|
|
4751
4757
|
"waitForThenClick": "#cm-acceptNone,.js-accept-essential-cookies",
|
|
@@ -5709,6 +5715,42 @@
|
|
|
5709
5715
|
}
|
|
5710
5716
|
]
|
|
5711
5717
|
},
|
|
5718
|
+
{
|
|
5719
|
+
"name": "webflow",
|
|
5720
|
+
"vendorUrl": "https://webflow.com/",
|
|
5721
|
+
"prehideSelectors": [
|
|
5722
|
+
".fs-cc-components"
|
|
5723
|
+
],
|
|
5724
|
+
"detectCmp": [
|
|
5725
|
+
{
|
|
5726
|
+
"exists": ".fs-cc-components"
|
|
5727
|
+
}
|
|
5728
|
+
],
|
|
5729
|
+
"detectPopup": [
|
|
5730
|
+
{
|
|
5731
|
+
"visible": ".fs-cc-components"
|
|
5732
|
+
},
|
|
5733
|
+
{
|
|
5734
|
+
"visible": "[fs-cc=banner]"
|
|
5735
|
+
}
|
|
5736
|
+
],
|
|
5737
|
+
"optIn": [
|
|
5738
|
+
{
|
|
5739
|
+
"wait": 500
|
|
5740
|
+
},
|
|
5741
|
+
{
|
|
5742
|
+
"waitForThenClick": "[fs-cc=banner] [fs-cc=allow]"
|
|
5743
|
+
}
|
|
5744
|
+
],
|
|
5745
|
+
"optOut": [
|
|
5746
|
+
{
|
|
5747
|
+
"wait": 500
|
|
5748
|
+
},
|
|
5749
|
+
{
|
|
5750
|
+
"waitForThenClick": "[fs-cc=banner] [fs-cc=deny]"
|
|
5751
|
+
}
|
|
5752
|
+
]
|
|
5753
|
+
},
|
|
5712
5754
|
{
|
|
5713
5755
|
"name": "wetransfer.com",
|
|
5714
5756
|
"detectCmp": [
|
package/dist/autoconsent.cjs.js
CHANGED
|
@@ -2088,8 +2088,14 @@ var AutoConsent = class {
|
|
|
2088
2088
|
}
|
|
2089
2089
|
return foundCMPs;
|
|
2090
2090
|
}
|
|
2091
|
+
/**
|
|
2092
|
+
* Detect if a CMP has a popup open. Fullfils with the CMP if a popup is open, otherwise rejects.
|
|
2093
|
+
*/
|
|
2091
2094
|
async detectPopup(cmp) {
|
|
2092
|
-
const isOpen = await this.waitForPopup(cmp)
|
|
2095
|
+
const isOpen = await this.waitForPopup(cmp).catch((error) => {
|
|
2096
|
+
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2097
|
+
return false;
|
|
2098
|
+
});
|
|
2093
2099
|
if (isOpen) {
|
|
2094
2100
|
this.updateState({ detectedPopups: this.state.detectedPopups.concat([cmp.name]) });
|
|
2095
2101
|
this.sendContentMessage({
|
|
@@ -2097,15 +2103,16 @@ var AutoConsent = class {
|
|
|
2097
2103
|
cmp: cmp.name,
|
|
2098
2104
|
url: location.href
|
|
2099
2105
|
});
|
|
2106
|
+
return cmp;
|
|
2100
2107
|
}
|
|
2101
|
-
|
|
2108
|
+
throw new Error("Popup is not shown");
|
|
2102
2109
|
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Detect if any of the CMPs has a popup open. Returns a list of CMPs with open popups.
|
|
2112
|
+
*/
|
|
2103
2113
|
async detectPopups(cmps, onFirstPopupAppears) {
|
|
2104
2114
|
const tasks = cmps.map(
|
|
2105
|
-
(cmp) => this.detectPopup(cmp)
|
|
2106
|
-
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2107
|
-
throw error;
|
|
2108
|
-
})
|
|
2115
|
+
(cmp) => this.detectPopup(cmp)
|
|
2109
2116
|
);
|
|
2110
2117
|
await Promise.any(tasks).then((cmp) => {
|
|
2111
2118
|
onFirstPopupAppears(cmp);
|
package/dist/autoconsent.esm.js
CHANGED
|
@@ -2063,8 +2063,14 @@ var AutoConsent = class {
|
|
|
2063
2063
|
}
|
|
2064
2064
|
return foundCMPs;
|
|
2065
2065
|
}
|
|
2066
|
+
/**
|
|
2067
|
+
* Detect if a CMP has a popup open. Fullfils with the CMP if a popup is open, otherwise rejects.
|
|
2068
|
+
*/
|
|
2066
2069
|
async detectPopup(cmp) {
|
|
2067
|
-
const isOpen = await this.waitForPopup(cmp)
|
|
2070
|
+
const isOpen = await this.waitForPopup(cmp).catch((error) => {
|
|
2071
|
+
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2072
|
+
return false;
|
|
2073
|
+
});
|
|
2068
2074
|
if (isOpen) {
|
|
2069
2075
|
this.updateState({ detectedPopups: this.state.detectedPopups.concat([cmp.name]) });
|
|
2070
2076
|
this.sendContentMessage({
|
|
@@ -2072,15 +2078,16 @@ var AutoConsent = class {
|
|
|
2072
2078
|
cmp: cmp.name,
|
|
2073
2079
|
url: location.href
|
|
2074
2080
|
});
|
|
2081
|
+
return cmp;
|
|
2075
2082
|
}
|
|
2076
|
-
|
|
2083
|
+
throw new Error("Popup is not shown");
|
|
2077
2084
|
}
|
|
2085
|
+
/**
|
|
2086
|
+
* Detect if any of the CMPs has a popup open. Returns a list of CMPs with open popups.
|
|
2087
|
+
*/
|
|
2078
2088
|
async detectPopups(cmps, onFirstPopupAppears) {
|
|
2079
2089
|
const tasks = cmps.map(
|
|
2080
|
-
(cmp) => this.detectPopup(cmp)
|
|
2081
|
-
this.config.logs.errors && console.warn(`error waiting for a popup for ${cmp.name}`, error);
|
|
2082
|
-
throw error;
|
|
2083
|
-
})
|
|
2090
|
+
(cmp) => this.detectPopup(cmp)
|
|
2084
2091
|
);
|
|
2085
2092
|
await Promise.any(tasks).then((cmp) => {
|
|
2086
2093
|
onFirstPopupAppears(cmp);
|