@duckduckgo/autoconsent 16.2.0 → 16.4.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/.agents/skills/proxy-testing/scripts/regional-proxy.mjs +4 -1
- package/.github/PULL_REQUEST_TEMPLATE.md +2 -2
- package/.github/dependabot.yml +1 -1
- package/.github/labeler.yml +6 -6
- package/CHANGELOG.md +41 -0
- package/dist/addon-firefox/compact-rules.json +1 -1
- package/dist/addon-firefox/devtools/panel.html +5 -0
- package/dist/addon-firefox/devtools/panel.ts +18 -1
- 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/devtools/panel.html +5 -0
- package/dist/addon-mv3/devtools/panel.js +12 -0
- package/dist/addon-mv3/devtools/panel.ts +18 -1
- 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.standalone.js +2 -2
- package/docs/puppeteer.md +1 -1
- package/docs/release-notes.md +12 -43
- package/package.json +15 -15
- package/rules/autoconsent/ketch.json +58 -19
- package/rules/autoconsent/msn.json +18 -0
- package/rules/compact-rules.json +1 -1
- package/rules/rule-index.json +1 -1
- package/rules/rules.json +1 -1
- package/scripts/check-pr-release-labels.ts +24 -24
- package/standalone/content.ts +1 -1
- package/tests/ketch.spec.ts +33 -19
- package/tests/msn.spec.ts +5 -0
- package/tests-wtr/lifecycle/find-cmp.ts +2 -2
- package/tests-wtr/web/do-opt-in.test.ts +1 -1
- package/tests-wtr/web/do-opt-out.test.ts +1 -1
- package/tests-wtr/web/do-self-test.test.ts +1 -1
- package/tests-wtr/web/filter-cmps.test.ts +1 -1
- package/tests-wtr/web/receive-message-callback.test.ts +1 -1
- package/tests-wtr/web/update-state.test.ts +1 -1
- package/rules/autoconsent/theverge.json +0 -36
- package/tests/theverge.spec.ts +0 -3
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import { Octokit } from '@octokit/rest';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const VERSION_LABELS = ['version: major', 'version: minor', 'version: patch'] as const;
|
|
5
5
|
const CATEGORY_LABELS = [
|
|
6
|
-
'rules',
|
|
7
|
-
'bug',
|
|
8
|
-
'enhancement',
|
|
9
|
-
'performance',
|
|
10
|
-
'dependencies',
|
|
11
|
-
'ci',
|
|
12
|
-
'ai',
|
|
13
|
-
'documentation',
|
|
14
|
-
'tests',
|
|
15
|
-
'internal',
|
|
16
|
-
'other',
|
|
6
|
+
'category: rules',
|
|
7
|
+
'category: bug',
|
|
8
|
+
'category: enhancement',
|
|
9
|
+
'category: performance',
|
|
10
|
+
'category: dependencies',
|
|
11
|
+
'category: ci',
|
|
12
|
+
'category: ai',
|
|
13
|
+
'category: documentation',
|
|
14
|
+
'category: tests',
|
|
15
|
+
'category: internal',
|
|
16
|
+
'category: other',
|
|
17
17
|
] as const;
|
|
18
18
|
const COMMENT_MARKER = '<!-- autoconsent-release-label-check -->';
|
|
19
19
|
|
|
20
|
-
type LabelName = (typeof
|
|
20
|
+
type LabelName = (typeof VERSION_LABELS)[number] | (typeof CATEGORY_LABELS)[number];
|
|
21
21
|
|
|
22
22
|
interface Args {
|
|
23
23
|
event?: string;
|
|
@@ -44,7 +44,7 @@ interface PullRequestEvent {
|
|
|
44
44
|
interface ValidationResult {
|
|
45
45
|
ok: boolean;
|
|
46
46
|
labels: string[];
|
|
47
|
-
|
|
47
|
+
versionLabels: string[];
|
|
48
48
|
categoryLabels: string[];
|
|
49
49
|
errors: string[];
|
|
50
50
|
comment?: string;
|
|
@@ -119,18 +119,18 @@ function isKnownLabel(labelSet: readonly LabelName[], label: string): boolean {
|
|
|
119
119
|
|
|
120
120
|
export function validateLabels(labels: string[]): ValidationResult {
|
|
121
121
|
const currentLabels = uniqueLabels(labels);
|
|
122
|
-
const
|
|
122
|
+
const versionLabels = currentLabels.filter((label) => isKnownLabel(VERSION_LABELS, label));
|
|
123
123
|
const categoryLabels = currentLabels.filter((label) => isKnownLabel(CATEGORY_LABELS, label));
|
|
124
124
|
const errors: string[] = [];
|
|
125
125
|
|
|
126
|
-
if (
|
|
127
|
-
errors.push(
|
|
128
|
-
} else if (
|
|
129
|
-
errors.push(`Keep exactly one
|
|
126
|
+
if (versionLabels.length === 0) {
|
|
127
|
+
errors.push('Add exactly one version label with the `version:` prefix.');
|
|
128
|
+
} else if (versionLabels.length > 1) {
|
|
129
|
+
errors.push(`Keep exactly one version label; found ${versionLabels.join(', ')}.`);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
if (categoryLabels.length === 0) {
|
|
133
|
-
errors.push(
|
|
133
|
+
errors.push('Add exactly one release-note category label with the `category:` prefix.');
|
|
134
134
|
} else if (categoryLabels.length > 1) {
|
|
135
135
|
errors.push(`Keep exactly one release-note category label; found ${categoryLabels.join(', ')}.`);
|
|
136
136
|
}
|
|
@@ -138,7 +138,7 @@ export function validateLabels(labels: string[]): ValidationResult {
|
|
|
138
138
|
return {
|
|
139
139
|
ok: errors.length === 0,
|
|
140
140
|
labels: currentLabels,
|
|
141
|
-
|
|
141
|
+
versionLabels,
|
|
142
142
|
categoryLabels,
|
|
143
143
|
errors,
|
|
144
144
|
};
|
|
@@ -171,8 +171,8 @@ Problems:
|
|
|
171
171
|
${result.errors.map((error) => `- ${error}`).join('\n')}
|
|
172
172
|
|
|
173
173
|
Required labels:
|
|
174
|
-
- One
|
|
175
|
-
- One release-note category label:
|
|
174
|
+
- One version label using the \`version:\` prefix, for example \`version: patch\`
|
|
175
|
+
- One release-note category label using the \`category:\` prefix, for example \`category: rules\`
|
|
176
176
|
|
|
177
177
|
See [docs/release-notes.md](https://github.com/duckduckgo/autoconsent/blob/main/docs/release-notes.md) for examples.`;
|
|
178
178
|
}
|
|
@@ -252,4 +252,4 @@ if (require.main === module) {
|
|
|
252
252
|
});
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
export { CATEGORY_LABELS,
|
|
255
|
+
export { CATEGORY_LABELS, VERSION_LABELS };
|
package/standalone/content.ts
CHANGED
|
@@ -55,7 +55,7 @@ if (!window.autoconsentReceiveMessage) {
|
|
|
55
55
|
const config: Partial<Config> = {
|
|
56
56
|
isMainWorld: true,
|
|
57
57
|
enableHeuristicDetection: true,
|
|
58
|
-
|
|
58
|
+
heuristicMode: 'tier2',
|
|
59
59
|
enablePopupMutationObserver: false,
|
|
60
60
|
logs: {
|
|
61
61
|
lifecycle: true,
|
package/tests/ketch.spec.ts
CHANGED
|
@@ -1,21 +1,35 @@
|
|
|
1
1
|
import generateCMPTests from '../playwright/runner';
|
|
2
2
|
|
|
3
|
-
generateCMPTests(
|
|
4
|
-
'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
generateCMPTests(
|
|
4
|
+
'ketch',
|
|
5
|
+
[
|
|
6
|
+
'https://www.rover.com/nl/',
|
|
7
|
+
'https://purple.com/',
|
|
8
|
+
'https://www.ncsasports.org/',
|
|
9
|
+
'https://www.pret.co.uk/en-GB',
|
|
10
|
+
'https://www.greatpetcare.com/',
|
|
11
|
+
'https://www.smartsheet.com/',
|
|
12
|
+
'https://www.ketch.com/',
|
|
13
|
+
'https://www.forbes.com/',
|
|
14
|
+
'https://yumearth.com/products/variety-pack-30ct',
|
|
15
|
+
// Disclosure-only banner variant (US/CCPA): the standard banner ships with
|
|
16
|
+
// a single acknowledge button (e.g. "I understand"/"Learn more") and no
|
|
17
|
+
// reject option — consent is decided by Ketch's jurisdiction defaults.
|
|
18
|
+
'https://shift.com/state-of-browsing/',
|
|
19
|
+
'https://www.altec.com/',
|
|
20
|
+
'https://www.akro-mils.com/',
|
|
21
|
+
'https://www.ascensus.com/',
|
|
22
|
+
// Banner with "Manage Cookie Settings" + "Accept All Cookies" only (no
|
|
23
|
+
// direct reject); preferences modal has per-purpose toggles and a
|
|
24
|
+
// "Save Settings" button but no "Reject All".
|
|
25
|
+
'https://my.equifax.ca/login',
|
|
26
|
+
// 3-button banner where the direct reject (aria-label="Reject
|
|
27
|
+
// Optional Cookies") is #ketch-banner-button-secondary while
|
|
28
|
+
// #ketch-banner-button-tertiary is "Cookie Settings" — verifies we
|
|
29
|
+
// prefer the aria-label-based direct reject over id-position guesses.
|
|
30
|
+
'https://www.pbs.org/newshour/economy/tomatoes-become-latest-symbol-of-americas-affordability-squeeze',
|
|
31
|
+
],
|
|
32
|
+
{
|
|
33
|
+
onlyRegions: ['US', 'DE'],
|
|
34
|
+
},
|
|
35
|
+
);
|
|
@@ -5,7 +5,7 @@ import Onetrust from '../../lib/cmps/onetrust';
|
|
|
5
5
|
describe('Autoconsent.findCmp', () => {
|
|
6
6
|
let autoconsent: Autoconsent;
|
|
7
7
|
|
|
8
|
-
describe('
|
|
8
|
+
describe('heuristicMode = off', () => {
|
|
9
9
|
beforeEach(() => {
|
|
10
10
|
autoconsent = new Autoconsent((msg) => Promise.resolve(), {
|
|
11
11
|
enabled: false, // bypass initialization
|
|
@@ -135,7 +135,7 @@ describe('Autoconsent.findCmp', () => {
|
|
|
135
135
|
});
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
describe('
|
|
138
|
+
describe('heuristicMode = reject', () => {
|
|
139
139
|
beforeEach(() => {
|
|
140
140
|
autoconsent = new Autoconsent((msg) => Promise.resolve(), {
|
|
141
141
|
enabled: false,
|
|
@@ -19,7 +19,7 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
19
19
|
isMainWorld: false,
|
|
20
20
|
prehideTimeout: 2000,
|
|
21
21
|
enableHeuristicDetection: false,
|
|
22
|
-
|
|
22
|
+
heuristicMode: 'off',
|
|
23
23
|
visualTest: false,
|
|
24
24
|
logs: {
|
|
25
25
|
lifecycle: false,
|
|
@@ -19,7 +19,7 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
19
19
|
isMainWorld: false,
|
|
20
20
|
prehideTimeout: 2000,
|
|
21
21
|
enableHeuristicDetection: false,
|
|
22
|
-
|
|
22
|
+
heuristicMode: 'off',
|
|
23
23
|
visualTest: false,
|
|
24
24
|
logs: {
|
|
25
25
|
lifecycle: false,
|
|
@@ -19,7 +19,7 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
19
19
|
isMainWorld: false,
|
|
20
20
|
prehideTimeout: 2000,
|
|
21
21
|
enableHeuristicDetection: false,
|
|
22
|
-
|
|
22
|
+
heuristicMode: 'off',
|
|
23
23
|
visualTest: false,
|
|
24
24
|
logs: {
|
|
25
25
|
lifecycle: false,
|
|
@@ -41,7 +41,7 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
41
41
|
isMainWorld: false,
|
|
42
42
|
prehideTimeout: 2000,
|
|
43
43
|
enableHeuristicDetection: false,
|
|
44
|
-
|
|
44
|
+
heuristicMode: 'off',
|
|
45
45
|
visualTest: false,
|
|
46
46
|
logs: {
|
|
47
47
|
lifecycle: false,
|
|
@@ -18,7 +18,7 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
18
18
|
isMainWorld: false,
|
|
19
19
|
prehideTimeout: 2000,
|
|
20
20
|
enableHeuristicDetection: false,
|
|
21
|
-
|
|
21
|
+
heuristicMode: 'off',
|
|
22
22
|
visualTest: false,
|
|
23
23
|
logs: {
|
|
24
24
|
lifecycle: false,
|
|
@@ -18,7 +18,7 @@ function createTestConfig(overrides: Partial<Config> = {}): Config {
|
|
|
18
18
|
isMainWorld: false,
|
|
19
19
|
prehideTimeout: 2000,
|
|
20
20
|
enableHeuristicDetection: false,
|
|
21
|
-
|
|
21
|
+
heuristicMode: 'off',
|
|
22
22
|
visualTest: false,
|
|
23
23
|
logs: {
|
|
24
24
|
lifecycle: false,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "theverge",
|
|
3
|
-
"runContext": {
|
|
4
|
-
"frame": false,
|
|
5
|
-
"main": true,
|
|
6
|
-
"urlPattern": "^https://(www)?\\.theverge\\.com"
|
|
7
|
-
},
|
|
8
|
-
"intermediate": false,
|
|
9
|
-
"prehideSelectors": [".duet--cta--cookie-banner"],
|
|
10
|
-
"detectCmp": [
|
|
11
|
-
{
|
|
12
|
-
"exists": ".duet--cta--cookie-banner"
|
|
13
|
-
}
|
|
14
|
-
],
|
|
15
|
-
"detectPopup": [
|
|
16
|
-
{
|
|
17
|
-
"visible": ".duet--cta--cookie-banner"
|
|
18
|
-
}
|
|
19
|
-
],
|
|
20
|
-
"optIn": [
|
|
21
|
-
{
|
|
22
|
-
"click": ".duet--cta--cookie-banner button.tracking-12",
|
|
23
|
-
"all": false
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"optOut": [
|
|
27
|
-
{
|
|
28
|
-
"click": ".duet--cta--cookie-banner button.tracking-12 > span"
|
|
29
|
-
}
|
|
30
|
-
],
|
|
31
|
-
"test": [
|
|
32
|
-
{
|
|
33
|
-
"cookieContains": "_duet_gdpr_acknowledged=1"
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
package/tests/theverge.spec.ts
DELETED