@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
@@ -2911,7 +2911,10 @@ var shortcutOptIn = "#truste-consent-button";
2911
2911
  var popupContent = "#truste-consent-content";
2912
2912
  var bannerOverlay = "#trustarc-banner-overlay";
2913
2913
  var bannerContainer = "#truste-consent-track";
2914
- var prefCenterDeclineAll = [".truste_popframe.trustarc_newcm_container", 'button[data-button-key="decline_all"]'];
2914
+ var prefCenterDeclineAll = [
2915
+ ".truste_popframe.trustarc_newcm_container",
2916
+ 'button[data-button-key="decline_all"], .trustarc-declineall-btn'
2917
+ ];
2915
2918
  var TrustArcTop = class extends AutoConsentCMPBase {
2916
2919
  constructor(autoconsentInstance) {
2917
2920
  super(autoconsentInstance);
@@ -2949,8 +2952,12 @@ var TrustArcTop = class extends AutoConsentCMPBase {
2949
2952
  }
2950
2953
  async optOut() {
2951
2954
  if (this.elementExists(shortcutOptOut)) {
2952
- this.click(shortcutOptOut);
2953
- return true;
2955
+ const shortcutVisible = this.elementVisible(shortcutOptOut, "any");
2956
+ await this.click(shortcutOptOut);
2957
+ if (shortcutVisible || !this.elementExists(`${bannerContainer}.ta-show`)) {
2958
+ return true;
2959
+ }
2960
+ this._shortcutButton = null;
2954
2961
  }
2955
2962
  hideElements(getStyleElement(), `.truste_popframe, .truste_overlay, .truste_box_overlay, ${bannerContainer}`);
2956
2963
  await this.click(cookieSettingsButton);
@@ -2881,7 +2881,10 @@ var shortcutOptIn = "#truste-consent-button";
2881
2881
  var popupContent = "#truste-consent-content";
2882
2882
  var bannerOverlay = "#trustarc-banner-overlay";
2883
2883
  var bannerContainer = "#truste-consent-track";
2884
- var prefCenterDeclineAll = [".truste_popframe.trustarc_newcm_container", 'button[data-button-key="decline_all"]'];
2884
+ var prefCenterDeclineAll = [
2885
+ ".truste_popframe.trustarc_newcm_container",
2886
+ 'button[data-button-key="decline_all"], .trustarc-declineall-btn'
2887
+ ];
2885
2888
  var TrustArcTop = class extends AutoConsentCMPBase {
2886
2889
  constructor(autoconsentInstance) {
2887
2890
  super(autoconsentInstance);
@@ -2919,8 +2922,12 @@ var TrustArcTop = class extends AutoConsentCMPBase {
2919
2922
  }
2920
2923
  async optOut() {
2921
2924
  if (this.elementExists(shortcutOptOut)) {
2922
- this.click(shortcutOptOut);
2923
- return true;
2925
+ const shortcutVisible = this.elementVisible(shortcutOptOut, "any");
2926
+ await this.click(shortcutOptOut);
2927
+ if (shortcutVisible || !this.elementExists(`${bannerContainer}.ta-show`)) {
2928
+ return true;
2929
+ }
2930
+ this._shortcutButton = null;
2924
2931
  }
2925
2932
  hideElements(getStyleElement(), `.truste_popframe, .truste_overlay, .truste_box_overlay, ${bannerContainer}`);
2926
2933
  await this.click(cookieSettingsButton);
@@ -2886,7 +2886,10 @@
2886
2886
  var popupContent = "#truste-consent-content";
2887
2887
  var bannerOverlay = "#trustarc-banner-overlay";
2888
2888
  var bannerContainer = "#truste-consent-track";
2889
- var prefCenterDeclineAll = [".truste_popframe.trustarc_newcm_container", 'button[data-button-key="decline_all"]'];
2889
+ var prefCenterDeclineAll = [
2890
+ ".truste_popframe.trustarc_newcm_container",
2891
+ 'button[data-button-key="decline_all"], .trustarc-declineall-btn'
2892
+ ];
2890
2893
  var TrustArcTop = class extends AutoConsentCMPBase {
2891
2894
  constructor(autoconsentInstance) {
2892
2895
  super(autoconsentInstance);
@@ -2924,8 +2927,12 @@
2924
2927
  }
2925
2928
  async optOut() {
2926
2929
  if (this.elementExists(shortcutOptOut)) {
2927
- this.click(shortcutOptOut);
2928
- return true;
2930
+ const shortcutVisible = this.elementVisible(shortcutOptOut, "any");
2931
+ await this.click(shortcutOptOut);
2932
+ if (shortcutVisible || !this.elementExists(`${bannerContainer}.ta-show`)) {
2933
+ return true;
2934
+ }
2935
+ this._shortcutButton = null;
2929
2936
  }
2930
2937
  hideElements(getStyleElement(), `.truste_popframe, .truste_overlay, .truste_box_overlay, ${bannerContainer}`);
2931
2938
  await this.click(cookieSettingsButton);