@duckduckgo/autoconsent 10.16.0 β†’ 10.17.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 CHANGED
@@ -1,3 +1,25 @@
1
+ # v10.17.0 (Thu Oct 24 2024)
2
+
3
+ #### πŸš€ Enhancement
4
+
5
+ - Add rule for americanexpress [#503](https://github.com/duckduckgo/autoconsent/pull/503) ([@muodov](https://github.com/muodov))
6
+ - Fix race condition in Sourcepoint rule [#502](https://github.com/duckduckgo/autoconsent/pull/502) ([@muodov](https://github.com/muodov))
7
+ - Add a rule for android.com [#501](https://github.com/duckduckgo/autoconsent/pull/501) ([@muodov](https://github.com/muodov))
8
+
9
+ #### πŸ› Bug Fix
10
+
11
+ - Fix standalone google for international regions [#500](https://github.com/duckduckgo/autoconsent/pull/500) ([@muodov](https://github.com/muodov))
12
+ - Fix paypal-us [#499](https://github.com/duckduckgo/autoconsent/pull/499) ([@muodov](https://github.com/muodov))
13
+ - (DomActions) WTR tests for elementSelector() [#495](https://github.com/duckduckgo/autoconsent/pull/495) (frei.ondrej@pm.me [@freiondrej](https://github.com/freiondrej))
14
+
15
+ #### Authors: 3
16
+
17
+ - Maxim Tsoy ([@muodov](https://github.com/muodov))
18
+ - OndΕ™ej Frei ([@freiondrej](https://github.com/freiondrej))
19
+ - ondrej.frei (frei.ondrej@pm.me)
20
+
21
+ ---
22
+
1
23
  # v10.16.0 (Tue Oct 15 2024)
2
24
 
3
25
  #### πŸš€ Enhancement
@@ -1332,7 +1332,7 @@
1332
1332
  this.waitForElement(".pm-features", 2e3).then((success) => success ? 2 : -1)
1333
1333
  ]);
1334
1334
  if (path === 0) {
1335
- await this.wait(1500);
1335
+ await this.waitForVisible(rejectSelector1);
1336
1336
  return this.click(rejectSelector1);
1337
1337
  } else if (path === 1) {
1338
1338
  this.click(rejectSelector2);
@@ -1951,6 +1951,7 @@
1951
1951
  waitForVisible(selector, timeout = 1e4, check = "any") {
1952
1952
  const interval = 200;
1953
1953
  const times = Math.ceil(timeout / interval);
1954
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[waitForVisible]", selector);
1954
1955
  return waitFor(
1955
1956
  () => this.elementVisible(selector, check),
1956
1957
  times,
@@ -1962,6 +1963,7 @@
1962
1963
  return this.click(selector, all);
1963
1964
  }
1964
1965
  wait(ms) {
1966
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[wait]", ms);
1965
1967
  return new Promise((resolve) => {
1966
1968
  setTimeout(() => {
1967
1969
  resolve(true);
@@ -1969,6 +1971,7 @@
1969
1971
  });
1970
1972
  }
1971
1973
  hide(selector, method) {
1974
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[hide]", selector);
1972
1975
  const styleEl = getStyleElement();
1973
1976
  return hideElements(styleEl, selector, method);
1974
1977
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 2,
3
3
  "name": "Autoconsent",
4
- "version": "2024.8.19",
4
+ "version": "2024.10.15",
5
5
  "background": {
6
6
  "scripts": [
7
7
  "background.bundle.js"
@@ -489,6 +489,34 @@
489
489
  }
490
490
  ]
491
491
  },
492
+ {
493
+ "name": "amex",
494
+ "vendorUrl": "https://www.americanexpress.com/",
495
+ "cosmetic": false,
496
+ "prehideSelectors": [
497
+ "#user-consent-management-granular-banner-overlay"
498
+ ],
499
+ "detectCmp": [
500
+ {
501
+ "exists": "#user-consent-management-granular-banner-overlay"
502
+ }
503
+ ],
504
+ "detectPopup": [
505
+ {
506
+ "visible": "#user-consent-management-granular-banner-overlay"
507
+ }
508
+ ],
509
+ "optIn": [
510
+ {
511
+ "waitForThenClick": "[data-testid=granular-banner-button-accept-all]"
512
+ }
513
+ ],
514
+ "optOut": [
515
+ {
516
+ "waitForThenClick": "[data-testid=granular-banner-button-decline-all]"
517
+ }
518
+ ]
519
+ },
492
520
  {
493
521
  "name": "aquasana.com",
494
522
  "prehideSelectors": [
@@ -3302,7 +3330,7 @@
3302
3330
  "exists": "a[href^=\"https://policies.google.com/technologies/cookies\""
3303
3331
  },
3304
3332
  {
3305
- "exists": "form[action^=\"https://consent.google.\"][action$=\".com/save\"]"
3333
+ "exists": "form[action^=\"https://consent.google.\"][action$=\"/save\"]"
3306
3334
  }
3307
3335
  ],
3308
3336
  "detectPopup": [
@@ -3312,15 +3340,56 @@
3312
3340
  ],
3313
3341
  "optIn": [
3314
3342
  {
3315
- "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\".com/save\"]:has(input[name=set_eom][value=false]) button"
3343
+ "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\"/save\"]:has(input[name=set_eom][value=false]) button"
3316
3344
  }
3317
3345
  ],
3318
3346
  "optOut": [
3319
3347
  {
3320
- "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\".com/save\"]:has(input[name=set_eom][value=true]) button"
3348
+ "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\"/save\"]:has(input[name=set_eom][value=true]) button"
3321
3349
  }
3322
3350
  ]
3323
3351
  },
3352
+ {
3353
+ "name": "google-cookiebar",
3354
+ "vendorUrl": "https://www.android.com/better-together/quick-share-app/",
3355
+ "cosmetic": false,
3356
+ "prehideSelectors": [
3357
+ ".glue-cookie-notification-bar"
3358
+ ],
3359
+ "detectCmp": [
3360
+ {
3361
+ "exists": ".glue-cookie-notification-bar"
3362
+ }
3363
+ ],
3364
+ "detectPopup": [
3365
+ {
3366
+ "visible": ".glue-cookie-notification-bar"
3367
+ }
3368
+ ],
3369
+ "optIn": [
3370
+ {
3371
+ "waitForThenClick": ".glue-cookie-notification-bar__accept"
3372
+ }
3373
+ ],
3374
+ "optOut": [
3375
+ {
3376
+ "if": {
3377
+ "exists": ".glue-cookie-notification-bar__reject"
3378
+ },
3379
+ "then": [
3380
+ {
3381
+ "click": ".glue-cookie-notification-bar__reject"
3382
+ }
3383
+ ],
3384
+ "else": [
3385
+ {
3386
+ "hide": ".glue-cookie-notification-bar"
3387
+ }
3388
+ ]
3389
+ }
3390
+ ],
3391
+ "test": []
3392
+ },
3324
3393
  {
3325
3394
  "name": "google.com",
3326
3395
  "prehideSelectors": [
@@ -5201,7 +5270,7 @@
5201
5270
  ],
5202
5271
  "detectPopup": [
5203
5272
  {
5204
- "exists": "#ccpaCookieBanner, .privacy-sheet-content"
5273
+ "visible": "#ccpaCookieBanner, .privacy-sheet-content"
5205
5274
  }
5206
5275
  ],
5207
5276
  "optIn": [
@@ -5239,7 +5308,7 @@
5239
5308
  "optional": true
5240
5309
  },
5241
5310
  {
5242
- "click": ".confirmCookie #submitCookiesBtn"
5311
+ "click": ".cookieAction.saveCookie,.confirmCookie #submitCookiesBtn"
5243
5312
  }
5244
5313
  ]
5245
5314
  }
@@ -1332,7 +1332,7 @@
1332
1332
  this.waitForElement(".pm-features", 2e3).then((success) => success ? 2 : -1)
1333
1333
  ]);
1334
1334
  if (path === 0) {
1335
- await this.wait(1500);
1335
+ await this.waitForVisible(rejectSelector1);
1336
1336
  return this.click(rejectSelector1);
1337
1337
  } else if (path === 1) {
1338
1338
  this.click(rejectSelector2);
@@ -1951,6 +1951,7 @@
1951
1951
  waitForVisible(selector, timeout = 1e4, check = "any") {
1952
1952
  const interval = 200;
1953
1953
  const times = Math.ceil(timeout / interval);
1954
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[waitForVisible]", selector);
1954
1955
  return waitFor(
1955
1956
  () => this.elementVisible(selector, check),
1956
1957
  times,
@@ -1962,6 +1963,7 @@
1962
1963
  return this.click(selector, all);
1963
1964
  }
1964
1965
  wait(ms) {
1966
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[wait]", ms);
1965
1967
  return new Promise((resolve) => {
1966
1968
  setTimeout(() => {
1967
1969
  resolve(true);
@@ -1969,6 +1971,7 @@
1969
1971
  });
1970
1972
  }
1971
1973
  hide(selector, method) {
1974
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[hide]", selector);
1972
1975
  const styleEl = getStyleElement();
1973
1976
  return hideElements(styleEl, selector, method);
1974
1977
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Autoconsent",
4
- "version": "2024.8.19",
4
+ "version": "2024.10.15",
5
5
  "background": {
6
6
  "service_worker": "background.bundle.js"
7
7
  },
@@ -489,6 +489,34 @@
489
489
  }
490
490
  ]
491
491
  },
492
+ {
493
+ "name": "amex",
494
+ "vendorUrl": "https://www.americanexpress.com/",
495
+ "cosmetic": false,
496
+ "prehideSelectors": [
497
+ "#user-consent-management-granular-banner-overlay"
498
+ ],
499
+ "detectCmp": [
500
+ {
501
+ "exists": "#user-consent-management-granular-banner-overlay"
502
+ }
503
+ ],
504
+ "detectPopup": [
505
+ {
506
+ "visible": "#user-consent-management-granular-banner-overlay"
507
+ }
508
+ ],
509
+ "optIn": [
510
+ {
511
+ "waitForThenClick": "[data-testid=granular-banner-button-accept-all]"
512
+ }
513
+ ],
514
+ "optOut": [
515
+ {
516
+ "waitForThenClick": "[data-testid=granular-banner-button-decline-all]"
517
+ }
518
+ ]
519
+ },
492
520
  {
493
521
  "name": "aquasana.com",
494
522
  "prehideSelectors": [
@@ -3302,7 +3330,7 @@
3302
3330
  "exists": "a[href^=\"https://policies.google.com/technologies/cookies\""
3303
3331
  },
3304
3332
  {
3305
- "exists": "form[action^=\"https://consent.google.\"][action$=\".com/save\"]"
3333
+ "exists": "form[action^=\"https://consent.google.\"][action$=\"/save\"]"
3306
3334
  }
3307
3335
  ],
3308
3336
  "detectPopup": [
@@ -3312,15 +3340,56 @@
3312
3340
  ],
3313
3341
  "optIn": [
3314
3342
  {
3315
- "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\".com/save\"]:has(input[name=set_eom][value=false]) button"
3343
+ "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\"/save\"]:has(input[name=set_eom][value=false]) button"
3316
3344
  }
3317
3345
  ],
3318
3346
  "optOut": [
3319
3347
  {
3320
- "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\".com/save\"]:has(input[name=set_eom][value=true]) button"
3348
+ "waitForThenClick": "form[action^=\"https://consent.google.\"][action$=\"/save\"]:has(input[name=set_eom][value=true]) button"
3321
3349
  }
3322
3350
  ]
3323
3351
  },
3352
+ {
3353
+ "name": "google-cookiebar",
3354
+ "vendorUrl": "https://www.android.com/better-together/quick-share-app/",
3355
+ "cosmetic": false,
3356
+ "prehideSelectors": [
3357
+ ".glue-cookie-notification-bar"
3358
+ ],
3359
+ "detectCmp": [
3360
+ {
3361
+ "exists": ".glue-cookie-notification-bar"
3362
+ }
3363
+ ],
3364
+ "detectPopup": [
3365
+ {
3366
+ "visible": ".glue-cookie-notification-bar"
3367
+ }
3368
+ ],
3369
+ "optIn": [
3370
+ {
3371
+ "waitForThenClick": ".glue-cookie-notification-bar__accept"
3372
+ }
3373
+ ],
3374
+ "optOut": [
3375
+ {
3376
+ "if": {
3377
+ "exists": ".glue-cookie-notification-bar__reject"
3378
+ },
3379
+ "then": [
3380
+ {
3381
+ "click": ".glue-cookie-notification-bar__reject"
3382
+ }
3383
+ ],
3384
+ "else": [
3385
+ {
3386
+ "hide": ".glue-cookie-notification-bar"
3387
+ }
3388
+ ]
3389
+ }
3390
+ ],
3391
+ "test": []
3392
+ },
3324
3393
  {
3325
3394
  "name": "google.com",
3326
3395
  "prehideSelectors": [
@@ -5201,7 +5270,7 @@
5201
5270
  ],
5202
5271
  "detectPopup": [
5203
5272
  {
5204
- "exists": "#ccpaCookieBanner, .privacy-sheet-content"
5273
+ "visible": "#ccpaCookieBanner, .privacy-sheet-content"
5205
5274
  }
5206
5275
  ],
5207
5276
  "optIn": [
@@ -5239,7 +5308,7 @@
5239
5308
  "optional": true
5240
5309
  },
5241
5310
  {
5242
- "click": ".confirmCookie #submitCookiesBtn"
5311
+ "click": ".cookieAction.saveCookie,.confirmCookie #submitCookiesBtn"
5243
5312
  }
5244
5313
  ]
5245
5314
  }
@@ -1355,7 +1355,7 @@ var SourcePoint = class extends AutoConsentCMPBase {
1355
1355
  this.waitForElement(".pm-features", 2e3).then((success) => success ? 2 : -1)
1356
1356
  ]);
1357
1357
  if (path === 0) {
1358
- await this.wait(1500);
1358
+ await this.waitForVisible(rejectSelector1);
1359
1359
  return this.click(rejectSelector1);
1360
1360
  } else if (path === 1) {
1361
1361
  this.click(rejectSelector2);
@@ -1974,6 +1974,7 @@ var DomActions = class {
1974
1974
  waitForVisible(selector, timeout = 1e4, check = "any") {
1975
1975
  const interval = 200;
1976
1976
  const times = Math.ceil(timeout / interval);
1977
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[waitForVisible]", selector);
1977
1978
  return waitFor(
1978
1979
  () => this.elementVisible(selector, check),
1979
1980
  times,
@@ -1985,6 +1986,7 @@ var DomActions = class {
1985
1986
  return this.click(selector, all);
1986
1987
  }
1987
1988
  wait(ms) {
1989
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[wait]", ms);
1988
1990
  return new Promise((resolve) => {
1989
1991
  setTimeout(() => {
1990
1992
  resolve(true);
@@ -1992,6 +1994,7 @@ var DomActions = class {
1992
1994
  });
1993
1995
  }
1994
1996
  hide(selector, method) {
1997
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[hide]", selector);
1995
1998
  const styleEl = getStyleElement();
1996
1999
  return hideElements(styleEl, selector, method);
1997
2000
  }
@@ -1330,7 +1330,7 @@ var SourcePoint = class extends AutoConsentCMPBase {
1330
1330
  this.waitForElement(".pm-features", 2e3).then((success) => success ? 2 : -1)
1331
1331
  ]);
1332
1332
  if (path === 0) {
1333
- await this.wait(1500);
1333
+ await this.waitForVisible(rejectSelector1);
1334
1334
  return this.click(rejectSelector1);
1335
1335
  } else if (path === 1) {
1336
1336
  this.click(rejectSelector2);
@@ -1949,6 +1949,7 @@ var DomActions = class {
1949
1949
  waitForVisible(selector, timeout = 1e4, check = "any") {
1950
1950
  const interval = 200;
1951
1951
  const times = Math.ceil(timeout / interval);
1952
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[waitForVisible]", selector);
1952
1953
  return waitFor(
1953
1954
  () => this.elementVisible(selector, check),
1954
1955
  times,
@@ -1960,6 +1961,7 @@ var DomActions = class {
1960
1961
  return this.click(selector, all);
1961
1962
  }
1962
1963
  wait(ms) {
1964
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[wait]", ms);
1963
1965
  return new Promise((resolve) => {
1964
1966
  setTimeout(() => {
1965
1967
  resolve(true);
@@ -1967,6 +1969,7 @@ var DomActions = class {
1967
1969
  });
1968
1970
  }
1969
1971
  hide(selector, method) {
1972
+ this.autoconsentInstance.config.logs.rulesteps && console.log("[hide]", selector);
1970
1973
  const styleEl = getStyleElement();
1971
1974
  return hideElements(styleEl, selector, method);
1972
1975
  }