@@ -148,16 +148,19 @@ async function processCookiePopupsForSite(globalParams, { finalUrl, initialUrl,
148148
149149 const updatedExistingRules = structuredClone ( existingRules ) ;
150150
151- const llmConfirmedPopups = collectorResult . scrapedFrames . flatMap ( ( frame ) => frame . potentialPopups ) . filter ( ( popup ) => popup . llmMatch ) ;
151+ // const llmConfirmedPopups = collectorResult.scrapedFrames.flatMap((frame) => frame.potentialPopups).filter((popup) => popup.llmMatch);
152+ const regexConfirmedPopups = collectorResult . scrapedFrames . flatMap ( ( frame ) => frame . potentialPopups ) . filter ( ( popup ) => popup . regexMatch ) ;
152153
153154 // shortcut if no popups with llmMatch
154- if ( llmConfirmedPopups . length === 0 ) {
155+ // if (llmConfirmedPopups.length === 0) {
156+ if ( regexConfirmedPopups . length === 0 ) {
155157 return { newRuleFiles, updatedRuleFiles, keptCount : 0 , reviewNotes : [ ] , updatedExistingRules } ;
156158 }
157159
158160 const matchingRules = findMatchingExistingRules ( initialUrl , finalUrl , collectorResult , existingRules ) ;
159161 console . log (
160- `Detected ${ llmConfirmedPopups . length } unhandled cookie popup(s) on ${ finalUrl } (matched ${ matchingRules . length } existing rules)` ,
162+ // `Detected ${llmConfirmedPopups.length} unhandled cookie popup(s) on ${finalUrl} (matched ${matchingRules.length} existing rules)`,
163+ `Detected ${ regexConfirmedPopups . length } unhandled cookie popup(s) on ${ finalUrl } (matched ${ matchingRules . length } existing rules)` ,
161164 ) ;
162165 const { newRules, rulesToOverride, reviewNotes, keptCount } = generateRulesForSite (
163166 region ,
@@ -309,26 +312,33 @@ async function processFiles(globalParams, existingRules) {
309312 totalSitesWithPopups ++ ;
310313
311314 const matchedRules = collectorResult . cmps . map ( ( cmp ) => cmp . name . trim ( ) ) . filter ( ( name ) => name !== '' ) ;
312- const llmConfirmedPopups = collectorResult . scrapedFrames
315+ // const llmConfirmedPopups = collectorResult.scrapedFrames
316+ // .flatMap((frame) => frame.potentialPopups)
317+ // .filter((popup) => popup.llmMatch);
318+ const regexConfirmedPopups = collectorResult . scrapedFrames
313319 . flatMap ( ( frame ) => frame . potentialPopups )
314- . filter ( ( popup ) => popup . llmMatch ) ;
320+ . filter ( ( popup ) => popup . regexMatch ) ;
315321 const screenshot = jsonData . data . screenshots ;
316322
317323 if ( hasKnownCmp ( collectorResult . cmps ) ) {
318324 totalSitesWithKnownCmps ++ ;
319325 autoconsentManifest . set ( fileName , {
320326 siteUrl : jsonData . finalUrl ,
321327 matchedRules,
322- llmConfirmedPopups,
328+ // llmConfirmedPopups,
329+ regexConfirmedPopups,
323330 screenshot,
324331 newlyCreatedRules : [ ] ,
325332 updatedRules : [ ] ,
326333 reviewNotes : [ ] ,
327334 } ) ;
328335 } else {
329- const llmConfirmedPopups = collectorResult . scrapedFrames
336+ // const llmConfirmedPopups = collectorResult.scrapedFrames
337+ // .flatMap((frame) => frame.potentialPopups)
338+ // .filter((popup) => popup.llmMatch);
339+ const regexConfirmedPopups = collectorResult . scrapedFrames
330340 . flatMap ( ( frame ) => frame . potentialPopups )
331- . filter ( ( popup ) => popup . llmMatch ) ;
341+ . filter ( ( popup ) => popup . regexMatch ) ;
332342 /** @type {import('./types').AutoconsentManifestFileData[] } */
333343 let newRuleFiles = [ ] ;
334344 /** @type {import('./types').AutoconsentManifestFileData[] } */
@@ -337,7 +347,8 @@ async function processFiles(globalParams, existingRules) {
337347 /** @type {import('./types').ReviewNote[] } */
338348 let reviewNotes = [ ] ;
339349
340- if ( llmConfirmedPopups . length > 0 ) {
350+ // if (llmConfirmedPopups.length > 0) {
351+ if ( regexConfirmedPopups . length > 0 ) {
341352 totalUnhandled ++ ;
342353 const result = await processCookiePopupsForSite ( globalParams , {
343354 finalUrl : jsonData . finalUrl ,
@@ -351,7 +362,8 @@ async function processFiles(globalParams, existingRules) {
351362 autoconsentManifest . set ( fileName , {
352363 siteUrl : jsonData . finalUrl ,
353364 matchedRules,
354- llmConfirmedPopups,
365+ // llmConfirmedPopups,
366+ regexConfirmedPopups,
355367 screenshot,
356368 newlyCreatedRules : newRuleFiles ,
357369 updatedRules : updatedRuleFiles ,
0 commit comments