Commit 52b9543
authored
Detect cookie popups based on full document text (#148)
* Define the desired data types
* Collect document-level text and buttons for cookie popup detection
* Prevent empty result entries
* Annotate buttons in extracted text
* Switch to a simpler document text scraping
* Add an LLM detection script
* Skip some shadowroot elements
* Add heuristic to filter common false positives
* use document.body when possible
* Add regex-based detection
* Fix detection script after refactoring
* Move all LLM calssification in one script
* Move button text verification into the llm script
* Adapt the rule generation script to after crawler refactoring
* Cleanup: move the types in a separate file
* cleanup: refactor the generation functions
* Lint fixes
* fix unit tests
* Clean up: split out classification utility functions
* Parallelize crawl processing
* Classify buttons in the document context
* Do not render progress bar in CI
* Synchronize autoconsent with the scraping job
* More verbose lifecycle logs
* Add two columns in clickhouse
* populate the new detection columns
* Fix typo
* Remove unnecessary import
* Escape whitespaces in selector components
* Handle scrapescript errors better
* Defend against DOM clobbering
* Clarify the comment
* Lint fix
* Clarify the TS types
* minor code style fix
* Fix lint errors
* Fix unit test
* Add a comment about openAI usage costs.
* More logs for debugging
* Log last crawled site
* naive attempt to prevent duplicate script injection
* Do context deduplication inside the ContentScriptSelector
* Report the current sites/min rate
* Fix unit tests
* lint fix
* Add collector-specific extra timeouts and give Autoconsent more time to finish
* Wait for scrape job to finish before waiting for optOut
* Lint fix
* More timeouts for CPM collector: some rules take a long time to finish.
* Prevent unnecessary OpenAI calls1 parent a04d882 commit 52b9543
File tree
15 files changed
+948
-384
lines changed- collectors
- CookiePopups
- helpers
- post-processing
- generate-autoconsent-rules
- reporters
- tests/collectors
15 files changed
+948
-384
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
9 | | - | |
10 | | - | |
| 14 | + | |
| 15 | + | |
11 | 16 | | |
12 | 17 | | |
13 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
63 | | - | |
64 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
65 | 73 | | |
66 | 74 | | |
67 | 75 | | |
| |||
73 | 81 | | |
74 | 82 | | |
75 | 83 | | |
76 | | - | |
| 84 | + | |
77 | 85 | | |
78 | 86 | | |
79 | 87 | | |
80 | 88 | | |
81 | | - | |
| 89 | + | |
82 | 90 | | |
83 | 91 | | |
84 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
2 | 27 | | |
3 | 28 | | |
4 | 29 | | |
| |||
89 | 114 | | |
90 | 115 | | |
91 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
92 | 167 | | |
93 | 168 | | |
94 | 169 | | |
95 | 170 | | |
96 | | - | |
97 | | - | |
| 171 | + | |
| 172 | + | |
98 | 173 | | |
99 | 174 | | |
100 | 175 | | |
| |||
103 | 178 | | |
104 | 179 | | |
105 | 180 | | |
106 | | - | |
| 181 | + | |
107 | 182 | | |
108 | 183 | | |
109 | 184 | | |
| |||
142 | 217 | | |
143 | 218 | | |
144 | 219 | | |
145 | | - | |
146 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
147 | 223 | | |
148 | 224 | | |
149 | 225 | | |
150 | 226 | | |
151 | 227 | | |
152 | | - | |
| 228 | + | |
153 | 229 | | |
154 | 230 | | |
155 | 231 | | |
156 | 232 | | |
157 | 233 | | |
158 | 234 | | |
159 | 235 | | |
160 | | - | |
| 236 | + | |
161 | 237 | | |
162 | 238 | | |
163 | 239 | | |
| |||
192 | 268 | | |
193 | 269 | | |
194 | 270 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
200 | 277 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
205 | 282 | | |
206 | | - | |
207 | | - | |
208 | | - | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
209 | 292 | | |
210 | 293 | | |
211 | 294 | | |
212 | 295 | | |
213 | 296 | | |
214 | 297 | | |
215 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
216 | 301 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
225 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
226 | 317 | | |
227 | 318 | | |
228 | 319 | | |
| |||
234 | 325 | | |
235 | 326 | | |
236 | 327 | | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
237 | 331 | | |
238 | 332 | | |
239 | 333 | | |
240 | 334 | | |
241 | | - | |
242 | | - | |
243 | 335 | | |
244 | 336 | | |
245 | 337 | | |
246 | 338 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 339 | + | |
253 | 340 | | |
254 | 341 | | |
255 | 342 | | |
256 | 343 | | |
257 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
258 | 370 | | |
259 | 371 | | |
260 | | - | |
| 372 | + | |
0 commit comments