@duckduckgo/autoconsent 15.1.0 → 16.0.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 +0 -3
- package/.github/workflows/release.yml +0 -4
- package/AGENTS.md +3 -3
- package/CHANGELOG.md +20 -0
- package/build.sh +0 -2
- package/dist/addon-firefox/background.bundle.js +8 -24
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/content.bundle.js +176 -686
- package/dist/addon-firefox/manifest.json +1 -1
- package/dist/addon-firefox/popup.bundle.js +31 -27
- package/dist/addon-firefox/popup.html +21 -13
- package/dist/addon-firefox/rule-index.json +1 -1
- package/dist/addon-firefox/rules.json +1 -1
- package/dist/addon-mv3/background.bundle.js +8 -24
- package/dist/addon-mv3/compact-rules.json +1 -1
- package/dist/addon-mv3/content.bundle.js +176 -686
- package/dist/addon-mv3/manifest.json +1 -1
- package/dist/addon-mv3/popup.bundle.js +31 -27
- package/dist/addon-mv3/popup.html +21 -13
- package/dist/addon-mv3/rule-index.json +1 -1
- package/dist/addon-mv3/rules.json +1 -1
- package/dist/autoconsent.cjs.js +176 -685
- package/dist/autoconsent.esm.js +176 -685
- package/dist/autoconsent.playwright.js +177 -689
- package/dist/autoconsent.standalone.js +177 -690
- package/dist/types/cmps/base.d.ts +3 -3
- package/dist/types/heuristics.d.ts +2 -2
- package/dist/types/types.d.ts +10 -23
- package/dist/types/web.d.ts +0 -9
- package/docs/api.md +1 -8
- package/docs/puppeteer.md +1 -3
- package/docs/rule-syntax.md +0 -17
- package/eslint.config.mjs +1 -1
- package/lib/cmps/base.ts +5 -6
- package/lib/heuristics.ts +15 -15
- package/lib/types.ts +9 -21
- package/lib/utils.ts +2 -4
- package/lib/web.ts +3 -53
- package/package.json +4 -17
- package/playwright/content.ts +1 -2
- package/readme.md +3 -6
- package/rules/autoconsent/dreamlab-cmp.json +13 -0
- package/rules/build.ts +1 -24
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index-builder.ts +2 -7
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/standalone/content.ts +0 -2
- package/tests/dreamlab-cmp.spec.ts +3 -0
- package/tests/quantcast.spec.ts +0 -6
- package/tests-wtr/heuristics/get-actionable-popups.ts +13 -13
- package/tests-wtr/heuristics/heuristic-cmp.ts +32 -33
- package/tests-wtr/lifecycle/find-cmp.ts +5 -8
- package/tests-wtr/web/do-opt-in.test.ts +0 -1
- package/tests-wtr/web/do-opt-out.test.ts +0 -1
- package/tests-wtr/web/do-self-test.test.ts +0 -1
- package/tests-wtr/web/filter-cmps.test.ts +0 -1
- package/tests-wtr/web/receive-message-callback.test.ts +1 -2
- package/tests-wtr/web/update-state.test.ts +1 -3
- package/tsconfig.build.json +1 -1
- package/.github/workflows/update-filterlist.yml +0 -42
- package/dist/autoconsent.extra.cjs.js +0 -15717
- package/dist/autoconsent.extra.esm.js +0 -15649
- package/dist/types/cmps/consentomatic.d.ts +0 -34
- package/dist/types/consentomatic/index.d.ts +0 -2
- package/dist/types/consentomatic/tools.d.ts +0 -10
- package/dist/types/filterlist-engine.d.ts +0 -2
- package/dist/types/filterlist-utils.d.ts +0 -4
- package/dist/types/web-extra.d.ts +0 -11
- package/lib/cmps/consentomatic.ts +0 -97
- package/lib/consentomatic/index.ts +0 -252
- package/lib/consentomatic/tools.ts +0 -199
- package/lib/filterlist-engine.ts +0 -5
- package/lib/filterlist-utils.ts +0 -45
- package/lib/web-extra.ts +0 -116
- package/rules/consentomatic.json +0 -1
- package/rules/filterlist.txt +0 -18440
- package/rules/filterlists/overrides.txt +0 -4
- package/scripts/compile-filterlist.mjs +0 -63
- package/scripts/fetch-easylist.sh +0 -25
- package/scripts/rebuild-filterlist.mjs +0 -216
- package/tests/oil.spec.ts +0 -7
- package/tests/springer.spec.ts +0 -7
- package/tests/wordpressgdpr.spec.ts +0 -6
package/standalone/content.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { filterCompactRules, type IndexedCMPRuleset } from '../lib/encoding';
|
|
|
3
3
|
import { BackgroundMessage, ContentScriptMessage } from '../lib/messages';
|
|
4
4
|
import { Config, RuleBundle } from '../lib/types';
|
|
5
5
|
import compactRules from '../rules/compact-rules.json';
|
|
6
|
-
import { consentomatic } from '../rules/consentomatic.json';
|
|
7
6
|
|
|
8
7
|
declare global {
|
|
9
8
|
interface Window {
|
|
@@ -22,7 +21,6 @@ function isMainFrame() {
|
|
|
22
21
|
function buildRules(): RuleBundle {
|
|
23
22
|
return {
|
|
24
23
|
autoconsent: [],
|
|
25
|
-
consentomatic,
|
|
26
24
|
compact: filterCompactRules(compactRules as IndexedCMPRuleset, {
|
|
27
25
|
url: window.location.href,
|
|
28
26
|
mainFrame: isMainFrame(),
|
package/tests/quantcast.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expect } from '@esm-bundle/chai';
|
|
2
2
|
import { getActionablePopups } from '../../lib/heuristics';
|
|
3
|
-
import { ButtonData
|
|
3
|
+
import { ButtonData } from '../../lib/types';
|
|
4
4
|
|
|
5
5
|
function rejectButtons(buttons: ButtonData[]) {
|
|
6
6
|
return buttons.filter((b) => b.regexClassification === 'reject');
|
|
@@ -46,7 +46,7 @@ describe('getActionablePopups', () => {
|
|
|
46
46
|
it('ignores popup with accept and settings buttons', () => {
|
|
47
47
|
showPopup('popup-no-reject');
|
|
48
48
|
|
|
49
|
-
const popups = getActionablePopups(
|
|
49
|
+
const popups = getActionablePopups('tier2');
|
|
50
50
|
|
|
51
51
|
expect(popups.length).to.equal(0);
|
|
52
52
|
});
|
|
@@ -56,7 +56,7 @@ describe('getActionablePopups', () => {
|
|
|
56
56
|
it('finds accept-only popup with no reject buttons', () => {
|
|
57
57
|
showPopup('popup-accept-only');
|
|
58
58
|
|
|
59
|
-
const popups = getActionablePopups(
|
|
59
|
+
const popups = getActionablePopups('tier2');
|
|
60
60
|
|
|
61
61
|
expect(popups.length).to.equal(1);
|
|
62
62
|
expect(rejectButtons(popups[0].buttons)).to.have.length(0);
|
|
@@ -66,7 +66,7 @@ describe('getActionablePopups', () => {
|
|
|
66
66
|
it('finds acknowledge-only popup with no reject buttons', () => {
|
|
67
67
|
showPopup('popup-acknowledge-only');
|
|
68
68
|
|
|
69
|
-
const popups = getActionablePopups(
|
|
69
|
+
const popups = getActionablePopups('tier2');
|
|
70
70
|
|
|
71
71
|
expect(popups.length).to.equal(1);
|
|
72
72
|
expect(rejectButtons(popups[0].buttons)).to.have.length(0);
|
|
@@ -76,10 +76,10 @@ describe('getActionablePopups', () => {
|
|
|
76
76
|
it('finds popup with multiple reject buttons', () => {
|
|
77
77
|
showPopup('popup-multiple-reject');
|
|
78
78
|
|
|
79
|
-
const popups = getActionablePopups(
|
|
79
|
+
const popups = getActionablePopups('tier2');
|
|
80
80
|
|
|
81
81
|
expect(popups.length).to.equal(1);
|
|
82
|
-
expect(popups[0].regexClassification).to.equal(
|
|
82
|
+
expect(popups[0].regexClassification).to.equal('reject');
|
|
83
83
|
expect(rejectButtons(popups[0].buttons)).to.have.length(2);
|
|
84
84
|
});
|
|
85
85
|
});
|
|
@@ -88,7 +88,7 @@ describe('getActionablePopups', () => {
|
|
|
88
88
|
it('does not return accept-only popup when mode is Reject', () => {
|
|
89
89
|
showPopup('popup-accept-only');
|
|
90
90
|
|
|
91
|
-
const popups = getActionablePopups(
|
|
91
|
+
const popups = getActionablePopups();
|
|
92
92
|
|
|
93
93
|
expect(popups.length).to.equal(0);
|
|
94
94
|
});
|
|
@@ -96,16 +96,16 @@ describe('getActionablePopups', () => {
|
|
|
96
96
|
it('returns acknowledge-only popup when mode is Tier1', () => {
|
|
97
97
|
showPopup('popup-acknowledge-only');
|
|
98
98
|
|
|
99
|
-
const popups = getActionablePopups(
|
|
99
|
+
const popups = getActionablePopups('tier1');
|
|
100
100
|
|
|
101
101
|
expect(popups.length).to.equal(1);
|
|
102
|
-
expect(popups[0].regexClassification).to.equal(
|
|
102
|
+
expect(popups[0].regexClassification).to.equal('tier1');
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
it('does not return accept-only popup when mode is Tier1', () => {
|
|
106
106
|
showPopup('popup-accept-only');
|
|
107
107
|
|
|
108
|
-
const popups = getActionablePopups(
|
|
108
|
+
const popups = getActionablePopups('tier1');
|
|
109
109
|
|
|
110
110
|
expect(popups.length).to.equal(0);
|
|
111
111
|
});
|
|
@@ -114,11 +114,11 @@ describe('getActionablePopups', () => {
|
|
|
114
114
|
showPopup('popup-reject-all');
|
|
115
115
|
showPopup('popup-accept-only');
|
|
116
116
|
|
|
117
|
-
const popups = getActionablePopups(
|
|
117
|
+
const popups = getActionablePopups('tier2');
|
|
118
118
|
|
|
119
119
|
expect(popups.length).to.equal(2);
|
|
120
|
-
expect(popups[0].regexClassification).to.equal(
|
|
121
|
-
expect(popups[1].regexClassification).to.equal(
|
|
120
|
+
expect(popups[0].regexClassification).to.equal('reject');
|
|
121
|
+
expect(popups[1].regexClassification).to.equal('tier2');
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { expect } from '@esm-bundle/chai';
|
|
2
2
|
import Autoconsent from '../../lib/web';
|
|
3
3
|
import { AutoConsentHeuristicCMP } from '../../lib/cmps/base';
|
|
4
|
-
import {
|
|
4
|
+
import { HeuristicLevel } from '../../lib/types';
|
|
5
5
|
|
|
6
6
|
// must be run from heuristic-cmp.html
|
|
7
7
|
describe('AutoConsentHeuristicCMP', () => {
|
|
8
|
-
function createAutoconsent(heuristicMode:
|
|
8
|
+
function createAutoconsent(heuristicMode: HeuristicLevel) {
|
|
9
9
|
return new Autoconsent(() => Promise.resolve(), {
|
|
10
10
|
enabled: false,
|
|
11
11
|
autoAction: null,
|
|
12
|
-
enableHeuristicAction: true,
|
|
13
12
|
heuristicMode,
|
|
14
13
|
});
|
|
15
14
|
}
|
|
@@ -30,20 +29,20 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
30
29
|
});
|
|
31
30
|
|
|
32
31
|
describe('detectCmp', () => {
|
|
33
|
-
it('detects reject popup as HEURISTIC-
|
|
34
|
-
const autoconsent = createAutoconsent(
|
|
35
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
32
|
+
it('detects reject popup as HEURISTIC-REJECT', async () => {
|
|
33
|
+
const autoconsent = createAutoconsent('tier2');
|
|
34
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
36
35
|
showPopup('popup-reject');
|
|
37
36
|
|
|
38
37
|
const detected = await cmp.detectCmp();
|
|
39
38
|
|
|
40
39
|
expect(detected).to.be.true;
|
|
41
|
-
expect(cmp.name).to.equal('HEURISTIC-
|
|
40
|
+
expect(cmp.name).to.equal('HEURISTIC-REJECT');
|
|
42
41
|
});
|
|
43
42
|
|
|
44
43
|
it('detects acknowledge-only popup as HEURISTIC-TIER1', async () => {
|
|
45
|
-
const autoconsent = createAutoconsent(
|
|
46
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
44
|
+
const autoconsent = createAutoconsent('tier2');
|
|
45
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
47
46
|
showPopup('popup-acknowledge-only');
|
|
48
47
|
|
|
49
48
|
const detected = await cmp.detectCmp();
|
|
@@ -53,8 +52,8 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
53
52
|
});
|
|
54
53
|
|
|
55
54
|
it('detects accept-only popup as HEURISTIC-TIER2', async () => {
|
|
56
|
-
const autoconsent = createAutoconsent(
|
|
57
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
55
|
+
const autoconsent = createAutoconsent('tier2');
|
|
56
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
58
57
|
showPopup('popup-accept-only');
|
|
59
58
|
|
|
60
59
|
const detected = await cmp.detectCmp();
|
|
@@ -64,8 +63,8 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
64
63
|
});
|
|
65
64
|
|
|
66
65
|
it('does not detect popup with accept and settings buttons', async () => {
|
|
67
|
-
const autoconsent = createAutoconsent(
|
|
68
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
66
|
+
const autoconsent = createAutoconsent('tier2');
|
|
67
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
69
68
|
showPopup('popup-accept-settings');
|
|
70
69
|
|
|
71
70
|
const detected = await cmp.detectCmp();
|
|
@@ -73,33 +72,33 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
73
72
|
expect(detected).to.be.false;
|
|
74
73
|
});
|
|
75
74
|
|
|
76
|
-
it('detects popup with multiple reject buttons as HEURISTIC-
|
|
77
|
-
const autoconsent = createAutoconsent(
|
|
78
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
75
|
+
it('detects popup with multiple reject buttons as HEURISTIC-REJECT', async () => {
|
|
76
|
+
const autoconsent = createAutoconsent('tier2');
|
|
77
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
79
78
|
showPopup('popup-multiple-reject');
|
|
80
79
|
|
|
81
80
|
const detected = await cmp.detectCmp();
|
|
82
81
|
|
|
83
82
|
expect(detected).to.be.true;
|
|
84
|
-
expect(cmp.name).to.equal('HEURISTIC-
|
|
83
|
+
expect(cmp.name).to.equal('HEURISTIC-REJECT');
|
|
85
84
|
});
|
|
86
85
|
|
|
87
86
|
it('prefers reject popup when reject and accept popups are visible', async () => {
|
|
88
|
-
const autoconsent = createAutoconsent(
|
|
89
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
87
|
+
const autoconsent = createAutoconsent('tier2');
|
|
88
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
90
89
|
showPopup('popup-tier-preference-reject', 'popup-tier-preference-accept');
|
|
91
90
|
|
|
92
91
|
const detected = await cmp.detectCmp();
|
|
93
92
|
|
|
94
93
|
expect(detected).to.be.true;
|
|
95
|
-
expect(cmp.name).to.equal('HEURISTIC-
|
|
94
|
+
expect(cmp.name).to.equal('HEURISTIC-REJECT');
|
|
96
95
|
});
|
|
97
96
|
});
|
|
98
97
|
|
|
99
98
|
describe('heuristicMode cap', () => {
|
|
100
99
|
it('does not detect accept-only popup when mode is Reject', async () => {
|
|
101
|
-
const autoconsent = createAutoconsent(
|
|
102
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
100
|
+
const autoconsent = createAutoconsent('reject');
|
|
101
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'reject');
|
|
103
102
|
showPopup('popup-accept-only');
|
|
104
103
|
|
|
105
104
|
const detected = await cmp.detectCmp();
|
|
@@ -108,8 +107,8 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
108
107
|
});
|
|
109
108
|
|
|
110
109
|
it('detects acknowledge-only popup when mode is Tier1', async () => {
|
|
111
|
-
const autoconsent = createAutoconsent(
|
|
112
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
110
|
+
const autoconsent = createAutoconsent('tier1');
|
|
111
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier1');
|
|
113
112
|
showPopup('popup-acknowledge-only');
|
|
114
113
|
|
|
115
114
|
const detected = await cmp.detectCmp();
|
|
@@ -119,8 +118,8 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
119
118
|
});
|
|
120
119
|
|
|
121
120
|
it('does not detect accept-only popup when mode is Tier1', async () => {
|
|
122
|
-
const autoconsent = createAutoconsent(
|
|
123
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
121
|
+
const autoconsent = createAutoconsent('tier1');
|
|
122
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier1');
|
|
124
123
|
showPopup('popup-accept-only');
|
|
125
124
|
|
|
126
125
|
const detected = await cmp.detectCmp();
|
|
@@ -130,9 +129,9 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
130
129
|
});
|
|
131
130
|
|
|
132
131
|
describe('optOut', () => {
|
|
133
|
-
it('clicks the reject button for
|
|
134
|
-
const autoconsent = createAutoconsent(
|
|
135
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
132
|
+
it('clicks the reject button for REJECT popup', async () => {
|
|
133
|
+
const autoconsent = createAutoconsent('tier2');
|
|
134
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
136
135
|
showPopup('popup-reject');
|
|
137
136
|
await cmp.detectCmp();
|
|
138
137
|
|
|
@@ -146,8 +145,8 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
146
145
|
});
|
|
147
146
|
|
|
148
147
|
it('clicks the acknowledge button for TIER1 popup', async () => {
|
|
149
|
-
const autoconsent = createAutoconsent(
|
|
150
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
148
|
+
const autoconsent = createAutoconsent('tier2');
|
|
149
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
151
150
|
showPopup('popup-acknowledge-only');
|
|
152
151
|
await cmp.detectCmp();
|
|
153
152
|
|
|
@@ -161,8 +160,8 @@ describe('AutoConsentHeuristicCMP', () => {
|
|
|
161
160
|
});
|
|
162
161
|
|
|
163
162
|
it('clicks the accept button for TIER2 popup', async () => {
|
|
164
|
-
const autoconsent = createAutoconsent(
|
|
165
|
-
const cmp = new AutoConsentHeuristicCMP(autoconsent,
|
|
163
|
+
const autoconsent = createAutoconsent('tier2');
|
|
164
|
+
const cmp = new AutoConsentHeuristicCMP(autoconsent, 'tier2');
|
|
166
165
|
showPopup('popup-accept-only');
|
|
167
166
|
await cmp.detectCmp();
|
|
168
167
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { expect } from '@esm-bundle/chai';
|
|
2
2
|
import Autoconsent from '../../lib/web';
|
|
3
3
|
import Onetrust from '../../lib/cmps/onetrust';
|
|
4
|
-
import { PopupHandlingModes } from '../../lib/types';
|
|
5
4
|
|
|
6
5
|
describe('Autoconsent.findCmp', () => {
|
|
7
6
|
let autoconsent: Autoconsent;
|
|
@@ -11,7 +10,7 @@ describe('Autoconsent.findCmp', () => {
|
|
|
11
10
|
autoconsent = new Autoconsent((msg) => Promise.resolve(), {
|
|
12
11
|
enabled: false, // bypass initialization
|
|
13
12
|
autoAction: null,
|
|
14
|
-
|
|
13
|
+
heuristicMode: 'off',
|
|
15
14
|
});
|
|
16
15
|
});
|
|
17
16
|
|
|
@@ -141,7 +140,7 @@ describe('Autoconsent.findCmp', () => {
|
|
|
141
140
|
autoconsent = new Autoconsent((msg) => Promise.resolve(), {
|
|
142
141
|
enabled: false,
|
|
143
142
|
autoAction: null,
|
|
144
|
-
|
|
143
|
+
heuristicMode: 'reject',
|
|
145
144
|
});
|
|
146
145
|
});
|
|
147
146
|
|
|
@@ -167,7 +166,7 @@ describe('Autoconsent.findCmp', () => {
|
|
|
167
166
|
const found = await autoconsent.findCmp(1);
|
|
168
167
|
|
|
169
168
|
expect(found).to.have.length(1);
|
|
170
|
-
expect(found[0].name).to.equal('HEURISTIC-
|
|
169
|
+
expect(found[0].name).to.equal('HEURISTIC-REJECT');
|
|
171
170
|
});
|
|
172
171
|
|
|
173
172
|
it('prefers declarative rules over heuristic CMP', async () => {
|
|
@@ -192,8 +191,7 @@ describe('Autoconsent.findCmp', () => {
|
|
|
192
191
|
autoconsent = new Autoconsent((msg) => Promise.resolve(), {
|
|
193
192
|
enabled: false,
|
|
194
193
|
autoAction: null,
|
|
195
|
-
|
|
196
|
-
heuristicMode: PopupHandlingModes.Tier1,
|
|
194
|
+
heuristicMode: 'tier1',
|
|
197
195
|
});
|
|
198
196
|
autoconsent.state.findCmpAttempts = 1;
|
|
199
197
|
|
|
@@ -210,8 +208,7 @@ describe('Autoconsent.findCmp', () => {
|
|
|
210
208
|
autoconsent = new Autoconsent((msg) => Promise.resolve(), {
|
|
211
209
|
enabled: false,
|
|
212
210
|
autoAction: null,
|
|
213
|
-
|
|
214
|
-
heuristicMode: PopupHandlingModes.Tier2,
|
|
211
|
+
heuristicMode: 'tier2',
|
|
215
212
|
});
|
|
216
213
|
autoconsent.state.findCmpAttempts = 1;
|
|
217
214
|
|
|
@@ -17,7 +17,6 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
17
17
|
detectRetries: 0,
|
|
18
18
|
isMainWorld: false,
|
|
19
19
|
prehideTimeout: 2000,
|
|
20
|
-
enableFilterList: false,
|
|
21
20
|
enableHeuristicDetection: false,
|
|
22
21
|
enableHeuristicAction: false,
|
|
23
22
|
visualTest: false,
|
|
@@ -125,7 +124,7 @@ describe('AutoConsent.receiveMessageCallback', () => {
|
|
|
125
124
|
|
|
126
125
|
it('should pass rules to initialize', async () => {
|
|
127
126
|
const initializeStub = sinon.stub(autoconsent, 'initialize');
|
|
128
|
-
const rules = { autoconsent: []
|
|
127
|
+
const rules = { autoconsent: [] };
|
|
129
128
|
|
|
130
129
|
await autoconsent.receiveMessageCallback({
|
|
131
130
|
type: 'initResp',
|
|
@@ -17,7 +17,6 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
17
17
|
detectRetries: 0,
|
|
18
18
|
isMainWorld: false,
|
|
19
19
|
prehideTimeout: 2000,
|
|
20
|
-
enableFilterList: false,
|
|
21
20
|
enableHeuristicDetection: false,
|
|
22
21
|
enableHeuristicAction: false,
|
|
23
22
|
visualTest: false,
|
|
@@ -87,10 +86,9 @@ describe('AutoConsent.updateState', () => {
|
|
|
87
86
|
});
|
|
88
87
|
|
|
89
88
|
it('should update boolean properties', () => {
|
|
90
|
-
autoconsent.updateState({ prehideOn: true
|
|
89
|
+
autoconsent.updateState({ prehideOn: true });
|
|
91
90
|
|
|
92
91
|
expect(autoconsent.state.prehideOn).to.be.true;
|
|
93
|
-
expect(autoconsent.state.cosmeticFiltersOn).to.be.true;
|
|
94
92
|
});
|
|
95
93
|
|
|
96
94
|
it('should update numeric properties', () => {
|
package/tsconfig.build.json
CHANGED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
name: Update filterlist
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
workflow_dispatch:
|
|
5
|
-
|
|
6
|
-
schedule:
|
|
7
|
-
- cron: '0 3 * * FRI' # run every Friday at 3:00
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
update_filterlist:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- uses: actions/checkout@v4
|
|
14
|
-
|
|
15
|
-
- name: Use Node.js
|
|
16
|
-
uses: actions/setup-node@v3
|
|
17
|
-
with:
|
|
18
|
-
node-version: lts/*
|
|
19
|
-
|
|
20
|
-
- name: Install dependencies
|
|
21
|
-
run: npm ci
|
|
22
|
-
|
|
23
|
-
- name: Update EasyList
|
|
24
|
-
run: |
|
|
25
|
-
npm run update-easylist
|
|
26
|
-
|
|
27
|
-
- name: Read EasyList revision
|
|
28
|
-
id: read-revision
|
|
29
|
-
run: echo "revision=`cat rules/filterlists/easylist_revision.txt`" >> "$GITHUB_OUTPUT"
|
|
30
|
-
|
|
31
|
-
- name: Create Pull Request
|
|
32
|
-
uses: peter-evans/create-pull-request@v7
|
|
33
|
-
with:
|
|
34
|
-
title: Update EasyList Cookie to ${{ steps.read-revision.outputs.revision }}
|
|
35
|
-
commit-message: Update EasyList Cookie to ${{ steps.read-revision.outputs.revision }}
|
|
36
|
-
labels: |
|
|
37
|
-
minor
|
|
38
|
-
dependencies
|
|
39
|
-
release
|
|
40
|
-
reviewers: muodov,sammacbeth
|
|
41
|
-
body: |
|
|
42
|
-
This PR updates the filterlist based on EasyList Cookie commit [${{ steps.read-revision.outputs.revision }}](https://github.com/easylist/easylist/tree/${{ steps.read-revision.outputs.revision }}/easylist_cookie).
|