@duckduckgo/autoconsent 18.8.0 → 18.9.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/.github/dependabot.yml +1 -0
- package/.github/workflows/checks.yml +1 -0
- package/CHANGELOG.md +29 -0
- package/dist/addon-firefox/background.bundle.js +11 -14
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +10 -3
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/popup.bundle.js +11 -14
- package/dist/addon-firefox/rule-index.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +11 -14
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +10 -3
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/popup.bundle.js +11 -14
- package/dist/addon-mv3/rule-index.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +10 -3
- package/dist/autoconsent.esm.js +10 -3
- package/dist/autoconsent.playwright.js +10 -3
- package/dist/autoconsent.standalone.js +11 -4
- package/lib/cmps/trustarc-top.ts +12 -3
- package/package.json +2 -2
- package/rules/autoconsent/cookieinformation.json +2 -1
- package/rules/autoconsent/huawei-cookie-notice.json +27 -0
- package/rules/autoconsent/xhamster-eu.json +1 -1
- package/rules/autoconsent/xhamster-us.json +1 -1
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/cookieinformation.spec.ts +3 -1
- package/tests/huawei-cookie-notice.spec.ts +5 -0
- package/tests/trustarc.spec.ts +7 -0
- package/tests/xhamster-eu.spec.ts +4 -0
- package/tests/xhamster-us.spec.ts +4 -0
- package/web-test-runner.config.mjs +6 -0
package/lib/cmps/trustarc-top.ts
CHANGED
|
@@ -9,7 +9,10 @@ const shortcutOptIn = '#truste-consent-button';
|
|
|
9
9
|
const popupContent = '#truste-consent-content';
|
|
10
10
|
const bannerOverlay = '#trustarc-banner-overlay';
|
|
11
11
|
const bannerContainer = '#truste-consent-track';
|
|
12
|
-
const prefCenterDeclineAll = [
|
|
12
|
+
const prefCenterDeclineAll = [
|
|
13
|
+
'.truste_popframe.trustarc_newcm_container',
|
|
14
|
+
'button[data-button-key="decline_all"], .trustarc-declineall-btn',
|
|
15
|
+
];
|
|
13
16
|
|
|
14
17
|
export default class TrustArcTop extends AutoConsentCMPBase {
|
|
15
18
|
name = 'TrustArc-top';
|
|
@@ -61,8 +64,14 @@ export default class TrustArcTop extends AutoConsentCMPBase {
|
|
|
61
64
|
|
|
62
65
|
async optOut() {
|
|
63
66
|
if (this.elementExists(shortcutOptOut)) {
|
|
64
|
-
this.
|
|
65
|
-
|
|
67
|
+
const shortcutVisible = this.elementVisible(shortcutOptOut, 'any');
|
|
68
|
+
await this.click(shortcutOptOut);
|
|
69
|
+
// a hidden reject button is not always wired up; when it is, the banner is dismissed synchronously
|
|
70
|
+
if (shortcutVisible || !this.elementExists(`${bannerContainer}.ta-show`)) {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
// the shortcut did nothing, so only a preference center click below counts as done
|
|
74
|
+
this._shortcutButton = null;
|
|
66
75
|
}
|
|
67
76
|
|
|
68
77
|
// hide elements permanently, so user doesn't see the popup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@duckduckgo/autoconsent",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.9.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"types": "./dist/types/web.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"jsonc-parser": "^3.3.1",
|
|
74
74
|
"markdown-it": "^15.0.2",
|
|
75
75
|
"mocha": "^12.0.3",
|
|
76
|
-
"prettier": "3.
|
|
76
|
+
"prettier": "3.10.0",
|
|
77
77
|
"randexp": "^0.6.1",
|
|
78
78
|
"sinon": "^22.0.0",
|
|
79
79
|
"tldts-experimental": "^7.4.3",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "huawei-cookie-notice",
|
|
3
|
+
"runContext": {
|
|
4
|
+
"urlPattern": "^https?://consumer\\.huawei\\.com/"
|
|
5
|
+
},
|
|
6
|
+
"prehideSelectors": [".huawei-bootom-cookie"],
|
|
7
|
+
"detectCmp": [
|
|
8
|
+
{
|
|
9
|
+
"exists": ".huawei-bootom-cookie .huawei-cookie-close"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"detectPopup": [
|
|
13
|
+
{
|
|
14
|
+
"visible": ".huawei-bootom-cookie"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"optIn": [
|
|
18
|
+
{
|
|
19
|
+
"waitForThenClick": ".huawei-bootom-cookie .huawei-cookie-close"
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"optOut": [
|
|
23
|
+
{
|
|
24
|
+
"waitForThenClick": ".huawei-bootom-cookie .huawei-cookie-close"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xhamster-eu",
|
|
3
3
|
"runContext": {
|
|
4
|
-
"urlPattern": "^https://(\\w+\\.)?(xhamster\\d*\\.(com|desi)|xh(wide|open|access|vid|fanclub)\\d*\\.com)/"
|
|
4
|
+
"urlPattern": "^https://(\\w+\\.)?(xhamster\\d*\\.(com|desi)|xh(wide|open|access|vid|fanclub|stream|name|spot)\\d*\\.com)/"
|
|
5
5
|
},
|
|
6
6
|
"prehideSelectors": ["[data-role=\"cookies-modal\"]"],
|
|
7
7
|
"detectCmp": [{ "exists": "[data-role=\"cookies-modal\"] [data-opt-hydration=\"cookies-dialog-eu\"]" }],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xhamster-us",
|
|
3
3
|
"runContext": {
|
|
4
|
-
"urlPattern": "^https://(\\w+\\.)?(xhamster\\d*\\.(com|desi)|xh(wide|open|access|vid|fanclub)\\d*\\.com)/"
|
|
4
|
+
"urlPattern": "^https://(\\w+\\.)?(xhamster\\d*\\.(com|desi)|xh(wide|open|access|vid|fanclub|stream|name|spot)\\d*\\.com)/"
|
|
5
5
|
},
|
|
6
6
|
"cosmetic": true,
|
|
7
7
|
"prehideSelectors": ["[class*=cookiesAnnounce]"],
|