@@ -319,22 +319,22 @@ ${code.join('\n')}
319
319
try {
320
320
await download . saveAs ( entry . outputFile ) ;
321
321
} catch ( error ) {
322
- console . warn ( 'Error saving download:' , error ) ;
322
+ // console.warn('Error saving download:', error);
323
323
} finally {
324
324
entry . finished = true ;
325
325
}
326
326
}
327
327
328
328
private async _onPageCreated ( page : playwright . Page ) {
329
- console . log ( 'Page created, checking for popup' ) ;
329
+ // console.log('Page created, checking for popup');
330
330
331
331
try {
332
332
const isPopup = await this . _handlePopup ( page ) ;
333
333
// If it was a popup, we don't want to add it to the tabs list
334
334
if ( isPopup )
335
335
return ;
336
336
} catch ( error ) {
337
- console . error ( 'Error handling popup:' , error ) ;
337
+ // console.error('Error handling popup:', error);
338
338
// Continue with normal page creation even if popup handling fails
339
339
}
340
340
@@ -356,13 +356,13 @@ ${code.join('\n')}
356
356
// Check if this is actually a popup window (not just a new tab)
357
357
const isPopupWindow = await this . _isPopupWindow ( popupPage ) ;
358
358
if ( ! isPopupWindow ) {
359
- console . log ( 'Not a popup window' ) ;
359
+ // console.log('Not a popup window');
360
360
// If it's not a popup window, we don't need to do anything, since
361
361
// the context.on("page") event will handle it.
362
362
return false ;
363
363
}
364
364
365
- console . log ( 'Is a popup window, getting URL' ) ;
365
+ // console.log('Is a popup window, getting URL');
366
366
367
367
await popupPage . waitForLoadState ( 'domcontentloaded' ) ;
368
368
@@ -380,15 +380,15 @@ ${code.join('\n')}
380
380
popupUrl = undefined ;
381
381
382
382
} catch ( error ) {
383
- console . log ( 'Failed to get popup URL, retrying' ) ;
383
+ // console.log('Failed to get popup URL, retrying');
384
384
}
385
385
386
386
await new Promise ( resolve => setTimeout ( resolve , 1000 ) ) ;
387
387
attempts ++ ;
388
388
}
389
389
390
390
if ( ! popupUrl ) {
391
- console . log ( 'Failed to get popup URL, closing popup' ) ;
391
+ // console.log('Failed to get popup URL, closing popup');
392
392
await popupPage . close ( ) ;
393
393
return true ;
394
394
}
@@ -416,7 +416,7 @@ ${code.join('\n')}
416
416
} catch ( navigationError ) {
417
417
// If navigation fails, just close the popup and keep the new page
418
418
// The new page will remain open but empty, which is better than losing it
419
- console . warn ( 'Navigation to popup URL failed:' , navigationError ) ;
419
+ // console.warn('Navigation to popup URL failed:', navigationError);
420
420
}
421
421
422
422
// Close the popup
@@ -427,7 +427,7 @@ ${code.join('\n')}
427
427
await popupPage . close ( ) ;
428
428
} catch ( closeError ) {
429
429
// Ignore close errors
430
- console . warn ( 'Error closing popup:' , closeError ) ;
430
+ // console.warn('Error closing popup:', closeError);
431
431
}
432
432
}
433
433
@@ -450,20 +450,20 @@ ${code.join('\n')}
450
450
) ,
451
451
] ) ;
452
452
453
- console . log ( 'Popup analysis:' , analysis ) ;
453
+ // console.log('Popup analysis:', analysis);
454
454
455
455
if ( analysis . isPopup ) {
456
- console . log ( `Popup detected with ${ analysis . confidence } % confidence` ) ;
457
- console . log ( 'Reasons:' , analysis . reasons ) ;
456
+ // console.log(`Popup detected with ${analysis.confidence}% confidence`);
457
+ // console.log('Reasons:', analysis.reasons);
458
458
}
459
459
460
460
return analysis . isPopup ;
461
461
} catch ( error ) {
462
462
// Check if it's a navigation-related error
463
- const errorMessage =
464
- error instanceof Error ? error . message : String ( error ) ;
463
+ // const errorMessage =
464
+ // error instanceof Error ? error.message : String(error);
465
465
466
- console . error ( 'Error checking if page is a popup window:' , errorMessage ) ;
466
+ // console.error('Error checking if page is a popup window:', errorMessage);
467
467
// If we can't determine, assume it's not a popup window
468
468
return false ;
469
469
}
@@ -479,12 +479,12 @@ ${code.join('\n')}
479
479
if ( this . _currentTab === tab )
480
480
this . _currentTab = this . _tabs [ Math . min ( index , this . _tabs . length - 1 ) ] ;
481
481
if ( ! this . _tabs . length ) {
482
- console . log ( 'No tabs left, closing context' ) ;
482
+ // console.log('No tabs left, closing context');
483
483
484
484
// Note that its likely here that the context is already dead :(
485
485
// so we wrap this in a try catch
486
486
this . close ( ) . catch ( error => {
487
- console . error ( 'Error closing context:' , error ) ;
487
+ // console.error('Error closing context:', error);
488
488
} ) ;
489
489
}
490
490
}
0 commit comments