@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
3
3
4
4
import { Logger } from '../../utils/logger.js' ;
5
5
6
- import { detectBrowsers , BrowserInfo } from './lib/browserDetectors.js' ;
6
+ import { BrowserInfo } from './lib/browserDetectors.js' ;
7
7
import {
8
8
BrowserConfig ,
9
9
Session ,
@@ -62,48 +62,6 @@ export class SessionTracker {
62
62
63
63
// Set up cleanup handlers for graceful shutdown
64
64
this . setupGlobalCleanup ( ) ;
65
-
66
- // Start browser detection in the background if logger is provided
67
- if ( this . logger ) {
68
- this . browserDetectionPromise = this . detectBrowsers ( ) ;
69
- }
70
- }
71
-
72
- /**
73
- * Detect available browsers on the system
74
- */
75
- private async detectBrowsers ( ) : Promise < void > {
76
- if ( ! this . logger ) {
77
- this . detectedBrowsers = [ ] ;
78
- return ;
79
- }
80
-
81
- try {
82
- this . detectedBrowsers = await detectBrowsers ( ) ;
83
- if ( this . logger ) {
84
- this . logger . info (
85
- `Detected ${ this . detectedBrowsers . length } browsers on the system` ,
86
- ) ;
87
- }
88
- if ( this . detectedBrowsers . length > 0 && this . logger ) {
89
- this . logger . info ( 'Available browsers:' ) ;
90
- this . detectedBrowsers . forEach ( ( browser ) => {
91
- if ( this . logger ) {
92
- this . logger . info (
93
- `- ${ browser . name } (${ browser . type } ) at ${ browser . path } ` ,
94
- ) ;
95
- }
96
- } ) ;
97
- }
98
- } catch ( error ) {
99
- if ( this . logger ) {
100
- this . logger . error (
101
- 'Failed to detect system browsers, disabling browser session tools:' ,
102
- error ,
103
- ) ;
104
- }
105
- this . detectedBrowsers = [ ] ;
106
- }
107
65
}
108
66
109
67
// Register a new browser session
@@ -324,6 +282,10 @@ export class SessionTracker {
324
282
public getSession ( sessionId : string ) : Session {
325
283
const session = this . browserSessions . get ( sessionId ) ;
326
284
if ( ! session ) {
285
+ console . log (
286
+ 'getting session, but here are the sessions' ,
287
+ this . browserSessions ,
288
+ ) ;
327
289
throw new BrowserError (
328
290
'Session not found' ,
329
291
BrowserErrorCode . SESSION_ERROR ,
@@ -338,6 +300,10 @@ export class SessionTracker {
338
300
public async closeSession ( sessionId : string ) : Promise < void > {
339
301
const session = this . browserSessions . get ( sessionId ) ;
340
302
if ( ! session ) {
303
+ console . log (
304
+ 'closing session, but here are the sessions' ,
305
+ this . browserSessions ,
306
+ ) ;
341
307
throw new BrowserError (
342
308
'Session not found' ,
343
309
BrowserErrorCode . SESSION_ERROR ,
0 commit comments