@duckduckgo/autoconsent 5.0.0 → 5.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duckduckgo/autoconsent",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "",
5
5
  "main": "dist/autoconsent.cjs.js",
6
6
  "module": "dist/autoconsent.esm.js",
@@ -10,8 +10,8 @@
10
10
  "scripts": {
11
11
  "clean": "rm -r dist",
12
12
  "lint": "eslint lib/ playwright/ tests/ rules/autoconsent/*.json",
13
- "bundle": "rollup -c",
14
- "watch": "rollup -c -w",
13
+ "bundle": "./build.sh",
14
+ "watch": "chokidar \"lib\" \"addon\" \"rules\" -c \"./build.sh\"",
15
15
  "create-rule": "node rules/create-rule.mjs",
16
16
  "test": "playwright test",
17
17
  "test:webkit": "playwright test --project webkit",
@@ -32,8 +32,6 @@
32
32
  "devDependencies": {
33
33
  "@playwright/test": "^1.17.1",
34
34
  "@puppeteer/replay": "^2.11.0",
35
- "@rollup/plugin-json": "^6.0.0",
36
- "@rollup/plugin-typescript": "^11.0.0",
37
35
  "@types/chai": "^4.3.1",
38
36
  "@types/chrome": "^0.0.237",
39
37
  "@types/mocha": "^10.0.1",
@@ -42,12 +40,11 @@
42
40
  "auto": "^10.37.6",
43
41
  "bulma": "^0.9.4",
44
42
  "chai": "^4.2.0",
43
+ "chokidar-cli": "^3.0.0",
44
+ "esbuild": "^0.18.11",
45
45
  "eslint": "^8.27.0",
46
46
  "eslint-plugin-json": "^3.1.0",
47
47
  "mocha": "^10.0.0",
48
- "rollup": "^2.79.1",
49
- "rollup-plugin-copy": "^3.4.0",
50
- "rollup-plugin-terser": "^7.0.2",
51
48
  "tslib": "^2.4.0",
52
49
  "typescript": "^5.1.6",
53
50
  "web-ext": "^7.3.0"
@@ -8,6 +8,6 @@
8
8
  { "click": "#btn-cookie-allow" }
9
9
  ],
10
10
  "optOut": [
11
- { "hide": ["#html-body #notice-cookie-block"] }
11
+ { "hide": ["#html-body #notice-cookie-block", "#notice-cookie"] }
12
12
  ]
13
13
  }
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "cookie-manager-popup",
3
+ "cosmetic": false,
4
+ "runContext": {
5
+ "main": true,
6
+ "frame": false
7
+ },
8
+ "intermediate": false,
9
+ "detectCmp": [
10
+ {
11
+ "exists": "#notice-cookie-block #allow-functional-cookies, #notice-cookie-block #btn-cookie-settings"
12
+ }
13
+ ],
14
+ "detectPopup": [
15
+ {
16
+ "visible": "#notice-cookie-block"
17
+ }
18
+ ],
19
+ "optIn": [
20
+ {
21
+ "click": "#btn-cookie-allow"
22
+ }
23
+ ],
24
+ "optOut": [
25
+ {
26
+ "if": {
27
+ "exists": "#allow-functional-cookies"
28
+ },
29
+ "then": [{ "click": "#allow-functional-cookies" }],
30
+ "else": [
31
+ { "waitForThenClick": "#btn-cookie-settings" },
32
+ { "waitForVisible": ".modal-body" },
33
+ { "click": ".modal-body input:checked, .switch[data-switch=\"on\"]", "all": true, "optional": true },
34
+ { "click": "[role=\"dialog\"] .modal-footer button"}
35
+ ]
36
+ }
37
+ ],
38
+ "prehideSelectors": ["#btn-cookie-settings"],
39
+ "test": [{
40
+ "eval": "JSON.parse(document.cookie.split(';').find(c => c.trim().startsWith('CookieLevel')).split('=')[1]).social === false"
41
+ }]
42
+ }
package/rules/rules.json CHANGED
@@ -653,7 +653,8 @@
653
653
  "optOut": [
654
654
  {
655
655
  "hide": [
656
- "#html-body #notice-cookie-block"
656
+ "#html-body #notice-cookie-block",
657
+ "#notice-cookie"
657
658
  ]
658
659
  }
659
660
  ]
@@ -1134,6 +1135,66 @@
1134
1135
  }
1135
1136
  ]
1136
1137
  },
1138
+ {
1139
+ "name": "cookie-manager-popup",
1140
+ "cosmetic": false,
1141
+ "runContext": {
1142
+ "main": true,
1143
+ "frame": false
1144
+ },
1145
+ "intermediate": false,
1146
+ "detectCmp": [
1147
+ {
1148
+ "exists": "#notice-cookie-block #allow-functional-cookies, #notice-cookie-block #btn-cookie-settings"
1149
+ }
1150
+ ],
1151
+ "detectPopup": [
1152
+ {
1153
+ "visible": "#notice-cookie-block"
1154
+ }
1155
+ ],
1156
+ "optIn": [
1157
+ {
1158
+ "click": "#btn-cookie-allow"
1159
+ }
1160
+ ],
1161
+ "optOut": [
1162
+ {
1163
+ "if": {
1164
+ "exists": "#allow-functional-cookies"
1165
+ },
1166
+ "then": [
1167
+ {
1168
+ "click": "#allow-functional-cookies"
1169
+ }
1170
+ ],
1171
+ "else": [
1172
+ {
1173
+ "waitForThenClick": "#btn-cookie-settings"
1174
+ },
1175
+ {
1176
+ "waitForVisible": ".modal-body"
1177
+ },
1178
+ {
1179
+ "click": ".modal-body input:checked, .switch[data-switch=\"on\"]",
1180
+ "all": true,
1181
+ "optional": true
1182
+ },
1183
+ {
1184
+ "click": "[role=\"dialog\"] .modal-footer button"
1185
+ }
1186
+ ]
1187
+ }
1188
+ ],
1189
+ "prehideSelectors": [
1190
+ "#btn-cookie-settings"
1191
+ ],
1192
+ "test": [
1193
+ {
1194
+ "eval": "JSON.parse(document.cookie.split(';').find(c => c.trim().startsWith('CookieLevel')).split('=')[1]).social === false"
1195
+ }
1196
+ ]
1197
+ },
1137
1198
  {
1138
1199
  "name": "cookie-notice",
1139
1200
  "prehideSelectors": [
@@ -1,5 +1,6 @@
1
1
  import generateCMPTests from "../playwright/runner";
2
2
 
3
3
  generateCMPTests('burpee.com', [
4
- 'https://www.burpee.com/'
4
+ 'https://www.burpee.com/',
5
+ 'https://granit.com/se'
5
6
  ], {});
@@ -0,0 +1,8 @@
1
+ import generateCMPTests from "../playwright/runner";
2
+
3
+ generateCMPTests('cookie-manager-popup', [
4
+ 'https://www.focus-bikes.com/de_de/',
5
+ 'https://www.gazelle.de/',
6
+ 'https://www.kalkhoff-bikes.com/de_de/'
7
+ ], {
8
+ });
package/rollup.config.js DELETED
@@ -1,103 +0,0 @@
1
- import json from '@rollup/plugin-json';
2
- import typescript from '@rollup/plugin-typescript';
3
- import copy from 'rollup-plugin-copy';
4
- import { terser } from "rollup-plugin-terser";
5
- import pkg from './package.json';
6
-
7
- export default [{
8
- input: './playwright/content.ts',
9
- output: [{
10
- file: 'dist/autoconsent.playwright.js',
11
- format: 'iife'
12
- }],
13
- plugins: [
14
- json(),
15
- typescript(),
16
- terser(),
17
- ]
18
- }, {
19
- input: './lib/web.ts',
20
- output: [{
21
- file: pkg.module,
22
- format: 'es',
23
- globals: ['browser'],
24
- }, {
25
- file: pkg.main,
26
- format: 'cjs',
27
- }],
28
- plugins: [
29
- typescript(),
30
- terser(),
31
- ],
32
- }, {
33
- input: './addon/background.ts',
34
- output: [{
35
- file: './dist/addon-mv3/background.bundle.js',
36
- format: 'iife',
37
- }, {
38
- file: './dist/addon-firefox/background.bundle.js',
39
- format: 'iife',
40
- }],
41
- plugins: [
42
- typescript(),
43
- copy({
44
- targets: [
45
- {
46
- src: [
47
- './addon/icons',
48
- './rules/rules.json'
49
- ],
50
- dest: ['./dist/addon-firefox/', './dist/addon-mv3/']
51
- },
52
- {
53
- src: ['./addon/popup.html', './addon/devtools'],
54
- dest: ['./dist/addon-mv3/']
55
- },
56
- {
57
- src: './addon/manifest.mv3.json',
58
- dest: './dist/addon-mv3',
59
- rename: 'manifest.json',
60
- },
61
- {
62
- src: './addon/manifest.firefox.json',
63
- dest: './dist/addon-firefox',
64
- rename: 'manifest.json',
65
- },
66
- {
67
- src: './node_modules/bulma/css/bulma.min.css',
68
- dest: './dist/addon-mv3/devtools/'
69
- }
70
- ]
71
- })
72
- ]
73
- }, {
74
- input: './addon/content.ts',
75
- output: [{
76
- file: './dist/addon-mv3/content.bundle.js',
77
- format: 'iife',
78
- }, {
79
- file: './dist/addon-firefox/content.bundle.js',
80
- format: 'iife',
81
- }],
82
- plugins: [
83
- typescript(),
84
- ],
85
- }, {
86
- input: './addon/popup.ts',
87
- output: [{
88
- file: './dist/addon-mv3/popup.bundle.js',
89
- format: 'iife',
90
- }],
91
- plugins: [
92
- typescript(),
93
- ],
94
- }, {
95
- input: './addon/devtools/panel.ts',
96
- output: [{
97
- file: './dist/addon-mv3/devtools/panel.js',
98
- format: 'iife',
99
- }],
100
- plugins: [
101
- typescript(),
102
- ],
103
- }];