@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.
Files changed (36) hide show
  1. package/.github/dependabot.yml +1 -0
  2. package/.github/workflows/checks.yml +1 -0
  3. package/CHANGELOG.md +29 -0
  4. package/dist/addon-firefox/background.bundle.js +11 -14
  5. package/dist/addon-firefox/compact-rules.json +1 -1
  6. package/dist/addon-firefox/content.bundle.js +10 -3
  7. package/dist/addon-firefox/manifest.json +1 -1
  8. package/dist/addon-firefox/popup.bundle.js +11 -14
  9. package/dist/addon-firefox/rule-index.json +1 -1
  10. package/dist/addon-firefox/rules.json +1 -1
  11. package/dist/addon-mv3/background.bundle.js +11 -14
  12. package/dist/addon-mv3/compact-rules.json +1 -1
  13. package/dist/addon-mv3/content.bundle.js +10 -3
  14. package/dist/addon-mv3/manifest.json +1 -1
  15. package/dist/addon-mv3/popup.bundle.js +11 -14
  16. package/dist/addon-mv3/rule-index.json +1 -1
  17. package/dist/addon-mv3/rules.json +1 -1
  18. package/dist/autoconsent.cjs.js +10 -3
  19. package/dist/autoconsent.esm.js +10 -3
  20. package/dist/autoconsent.playwright.js +10 -3
  21. package/dist/autoconsent.standalone.js +11 -4
  22. package/lib/cmps/trustarc-top.ts +12 -3
  23. package/package.json +2 -2
  24. package/rules/autoconsent/cookieinformation.json +2 -1
  25. package/rules/autoconsent/huawei-cookie-notice.json +27 -0
  26. package/rules/autoconsent/xhamster-eu.json +1 -1
  27. package/rules/autoconsent/xhamster-us.json +1 -1
  28. package/rules/compact-rules.json +1 -1
  29. package/rules/rule-index.json +1 -1
  30. package/rules/rules.json +1 -1
  31. package/tests/cookieinformation.spec.ts +3 -1
  32. package/tests/huawei-cookie-notice.spec.ts +5 -0
  33. package/tests/trustarc.spec.ts +7 -0
  34. package/tests/xhamster-eu.spec.ts +4 -0
  35. package/tests/xhamster-us.spec.ts +4 -0
  36. package/web-test-runner.config.mjs +6 -0
@@ -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 = ['.truste_popframe.trustarc_newcm_container', 'button[data-button-key="decline_all"]'];
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.click(shortcutOptOut);
65
- return true;
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.8.0",
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.9.10",
76
+ "prettier": "3.10.0",
77
77
  "randexp": "^0.6.1",
78
78
  "sinon": "^22.0.0",
79
79
  "tldts-experimental": "^7.4.3",
@@ -8,7 +8,8 @@
8
8
  ],
9
9
  "detectPopup": [
10
10
  {
11
- "visible": "#cookie-information-template-wrapper"
11
+ "visible": "#cookie-information-template-wrapper :is(#coiOverlay, #ccb-coiOverlay, #coiConsentBanner, #CcpaWrapper)",
12
+ "check": "any"
12
13
  }
13
14
  ],
14
15
  "optIn": [
@@ -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]"],