feat: get browser instance

This commit is contained in:
karishmas6
2024-06-01 10:28:17 +05:30
parent aa9b5d1c43
commit 99322a2184

View File

@@ -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;
};
}