@duckduckgo/autoconsent 16.46.0 → 16.47.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 +6 -0
- package/.github/labeler.yml +1 -1
- package/.github/workflows/release-labels.yml +19 -11
- package/CHANGELOG.md +28 -0
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +4 -2
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/rule-index.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +4 -2
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/rule-index.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +4 -2
- package/dist/autoconsent.esm.js +4 -2
- package/dist/autoconsent.playwright.js +4 -2
- package/dist/autoconsent.standalone.js +5 -3
- package/lib/encoding.ts +1 -8
- package/lib/messages.ts +1 -6
- package/lib/web.ts +5 -4
- package/package.json +6 -6
- package/rules/autoconsent/controlgame.json +12 -0
- package/rules/autoconsent/dalecarnegie.json +44 -0
- package/rules/autoconsent/jpmorgan-chase.json +10 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/tests/controlgame.spec.ts +3 -0
- package/tests/dalecarnegie.spec.ts +3 -0
- package/tests/jpmorgan-chase.spec.ts +8 -0
- package/tests-wtr/lifecycle/find-cmp.ts +13 -0
- package/tsconfig.build.json +1 -0
- package/tsconfig.json +2 -1
|
@@ -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
|
});
|
package/tsconfig.build.json
CHANGED