@duckduckgo/autoconsent 16.46.0 → 16.48.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 (41) hide show
  1. package/.github/dependabot.yml +6 -0
  2. package/.github/labeler.yml +1 -1
  3. package/.github/workflows/release-labels.yml +19 -11
  4. package/AGENTS.md +3 -0
  5. package/CHANGELOG.md +48 -0
  6. package/dist/addon-firefox/compact-rules.json +1 -1
  7. package/dist/addon-firefox/content.bundle.js +4 -2
  8. package/dist/addon-firefox/manifest.json +1 -1
  9. package/dist/addon-firefox/rule-index.json +1 -1
  10. package/dist/addon-firefox/rules.json +1 -1
  11. package/dist/addon-mv3/compact-rules.json +1 -1
  12. package/dist/addon-mv3/content.bundle.js +4 -2
  13. package/dist/addon-mv3/manifest.json +1 -1
  14. package/dist/addon-mv3/rule-index.json +1 -1
  15. package/dist/addon-mv3/rules.json +1 -1
  16. package/dist/autoconsent.cjs.js +4 -2
  17. package/dist/autoconsent.esm.js +4 -2
  18. package/dist/autoconsent.playwright.js +4 -2
  19. package/dist/autoconsent.standalone.js +5 -3
  20. package/lib/encoding.ts +1 -8
  21. package/lib/messages.ts +1 -6
  22. package/lib/web.ts +5 -4
  23. package/package.json +6 -6
  24. package/rules/autoconsent/burpee-com.json +13 -7
  25. package/rules/autoconsent/controlgame.json +12 -0
  26. package/rules/autoconsent/dalecarnegie.json +44 -0
  27. package/rules/autoconsent/jpmorgan-chase.json +10 -0
  28. package/rules/autoconsent/pmc-privacy-banner.json +9 -0
  29. package/rules/autoconsent/tealium.json +1 -1
  30. package/rules/compact-rules.json +1 -1
  31. package/rules/rule-index.json +1 -1
  32. package/rules/rules.json +1 -1
  33. package/tests/burpee-com.spec.ts +10 -4
  34. package/tests/controlgame.spec.ts +3 -0
  35. package/tests/dalecarnegie.spec.ts +3 -0
  36. package/tests/jpmorgan-chase.spec.ts +8 -0
  37. package/tests/pmc-privacy-banner.spec.ts +8 -0
  38. package/tests/tealium.spec.ts +8 -6
  39. package/tests-wtr/lifecycle/find-cmp.ts +13 -0
  40. package/tsconfig.build.json +1 -0
  41. package/tsconfig.json +2 -1
@@ -1,8 +1,14 @@
1
1
  import generateCMPTests from '../playwright/runner';
2
2
 
3
3
  generateCMPTests('burpee.com', [
4
- 'https://www.burpee.com/',
5
- 'https://www.knfilters.com/',
6
- 'https://www.mossberg.com/',
7
- 'https://www.hobbies.co.uk',
4
+ // Decline button
5
+ 'https://www.discountsurgical.com/',
6
+ 'https://www.lymphrx.com/',
7
+ 'https://www.cutmy.co.uk/',
8
+ 'https://www.workingperson.com/',
9
+ // Manage Cookies button
10
+ 'https://www.hobbies.co.uk/',
11
+ // Allow button only: the banner is hidden
12
+ 'https://www.oxfordproducts.com/',
13
+ 'https://www.testequipmentdepot.com/',
8
14
  ]);
@@ -0,0 +1,3 @@
1
+ import generateCMPTests from '../playwright/runner';
2
+
3
+ generateCMPTests('controlgame', ['https://controlgame.com/cookies']);
@@ -0,0 +1,3 @@
1
+ import generateCMPTests from '../playwright/runner';
2
+
3
+ generateCMPTests('dalecarnegie', ['https://www.dalecarnegie.com/en']);
@@ -0,0 +1,8 @@
1
+ import generateCMPTests from '../playwright/runner';
2
+
3
+ generateCMPTests('jpmorgan-chase', [
4
+ 'https://www.chase.com/personal/events/experiences',
5
+ 'https://www.chase.com/business',
6
+ 'https://www.jpmorgan.com/',
7
+ 'https://www.jpmorganchase.com/',
8
+ ]);
@@ -0,0 +1,8 @@
1
+ import generateCMPTests from '../playwright/runner';
2
+
3
+ generateCMPTests('pmc-privacy-banner', [
4
+ 'https://www.theverge.com/news/999211/microsoft-surface-mouse-haptic-feedback',
5
+ 'https://www.eater.com/',
6
+ 'https://www.sbnation.com/',
7
+ 'https://punchdrink.com/',
8
+ ]);
@@ -2,11 +2,13 @@ import generateCMPTests from '../playwright/runner';
2
2
 
3
3
  generateCMPTests('Tealium', [
4
4
  // 'https://www.bahn.de/', // uses shadow DOM, see https://app.asana.com/0/1201844467387842/1202635343225979/f
5
- 'https://www.forcepoint.com/',
6
- 'https://www.lufthansa.com/de/en/homepage',
5
+ // 'https://www.forcepoint.com/', // custom region picker must be answered before the Tealium prompt shows
7
6
  'http://www.tui.com/',
8
- 'http://www.minted.com/',
9
- 'http://help.brother-usa.com/',
10
- 'http://www.americangreetings.com/',
11
- 'http://www.hagerty.com/',
7
+ 'https://www.nsandi.com/',
8
+ 'https://www.telenor.com/',
9
+ 'https://www.allaboutvision.com/',
10
+ 'https://www.chs.net/',
11
+ 'https://www.nito.no/',
12
+ 'https://www.about.hsbc.pl/pl-pl/hsbc-service-delivery',
13
+ 'https://www.hsbc.com/',
12
14
  ]);
@@ -217,5 +217,18 @@ describe('Autoconsent.findCmp', () => {
217
217
  expect(found).to.have.length(1);
218
218
  expect(found[0].name).to.equal('HEURISTIC-TIER2');
219
219
  });
220
+
221
+ it('does not wait for a DOM mutation after an attempt that skipped the heuristic', async function () {
222
+ this.timeout(10000);
223
+ // the next attempt is odd, so it skips the heuristic; the popup is already shown and the page stays quiet
224
+ autoconsent.state.findCmpAttempts = 2;
225
+
226
+ const timeout = new Promise<null>((resolve) => setTimeout(() => resolve(null), 5000));
227
+ const found = await Promise.race([autoconsent.findCmp(1), timeout]);
228
+
229
+ expect(found, 'detection is stuck waiting for a DOM mutation').to.not.equal(null);
230
+ expect(found).to.have.length(1);
231
+ expect(found![0].name).to.equal('HEURISTIC-REJECT');
232
+ });
220
233
  });
221
234
  });
@@ -4,6 +4,7 @@
4
4
  "declaration": true,
5
5
  "emitDeclarationOnly": true,
6
6
  "declarationDir": "./dist/types",
7
+ "rootDir": "./lib",
7
8
  "noCheck": true
8
9
  },
9
10
  "include": ["lib/web.ts"],
package/tsconfig.json CHANGED
@@ -9,7 +9,8 @@
9
9
  "noImplicitAny": true,
10
10
  "allowSyntheticDefaultImports": true,
11
11
  "strict": true,
12
- "module": "NodeNext"
12
+ "module": "NodeNext",
13
+ "types": ["node", "chrome", "mocha"]
13
14
  },
14
15
  "exclude": ["node_modules/*", "dist/*"]
15
16
  }