diff --git a/server/src/browser-management/classes/BrowserPool.ts b/server/src/browser-management/classes/BrowserPool.ts index 7e43654b..d7abbbf4 100644 --- a/server/src/browser-management/classes/BrowserPool.ts +++ b/server/src/browser-management/classes/BrowserPool.ts @@ -71,4 +71,14 @@ export class BrowserPool { logger.log('debug', `Remote browser with id: ${id} deleted from the pool`); return true; }; + + /** + * Returns the remote browser instance from the pool. + * @param id remote browser instance's id + * @returns remote browser instance or undefined if it does not exist in the pool + */ + public getRemoteBrowser = (id: string) : RemoteBrowser | undefined => { + logger.log('debug', `Remote browser with id: ${id} retrieved from the pool`); + return this.pool[id]?.browser; + }; }