@@ -14,12 +14,12 @@ export class BrowserManager {
1414 headless : true ,
1515 defaultTimeout : 30000 ,
1616 } ;
17-
17+
1818 constructor ( ) {
1919 // Store a reference to the instance globally for cleanup
2020 // This allows the CLI to access the instance for cleanup
2121 ( globalThis as any ) . __BROWSER_MANAGER__ = this ;
22-
22+
2323 // Set up cleanup handlers for graceful shutdown
2424 this . setupGlobalCleanup ( ) ;
2525 }
@@ -92,7 +92,7 @@ export class BrowserManager {
9292 // No need to add individual process handlers for each session
9393 // We'll handle all sessions in the global cleanup
9494 }
95-
95+
9696 /**
9797 * Sets up global cleanup handlers for all browser sessions
9898 */
@@ -103,23 +103,28 @@ export class BrowserManager {
103103 console . error ( 'Error closing browser sessions:' , err ) ;
104104 } ) ;
105105 } ) ;
106-
106+
107107 // Use exit for synchronous cleanup (as a fallback)
108108 process . on ( 'exit' , ( ) => {
109109 // Can only do synchronous operations here
110110 for ( const session of this . sessions . values ( ) ) {
111111 try {
112112 // Attempt synchronous close - may not fully work
113113 session . browser . close ( ) ;
114+ // eslint-disable-next-line unused-imports/no-unused-vars
114115 } catch ( e ) {
115116 // Ignore errors during exit
116117 }
117118 }
118119 } ) ;
119-
120+
120121 // Handle SIGINT (Ctrl+C)
121122 process . on ( 'SIGINT' , ( ) => {
122- this . closeAllSessions ( ) . catch ( ( ) => { } )
123+ // eslint-disable-next-line promise/catch-or-return
124+ this . closeAllSessions ( )
125+ . catch ( ( ) => {
126+ return false ;
127+ } )
123128 . finally ( ( ) => {
124129 // Give a moment for cleanup to complete
125130 setTimeout ( ( ) => process . exit ( 0 ) , 500 ) ;
0 commit comments