Revert "fix: prevent page reload on run trigger to open remote browser"

This commit is contained in:
Karishma Shukla
2025-01-24 19:28:04 +05:30
committed by GitHub
parent 85b4786062
commit 153cf81edc
5 changed files with 9 additions and 102 deletions

View File

@@ -15,8 +15,6 @@ interface BrowserPoolInfo {
* @default false
*/
active: boolean,
isRobotRun?: boolean;
}
/**
@@ -48,29 +46,17 @@ export class BrowserPool {
* @param browser remote browser instance
* @param active states if the browser's instance is being actively used
*/
public addRemoteBrowser = (id: string, browser: RemoteBrowser, active: boolean = false, isRobotRun: boolean = false): void => {
public addRemoteBrowser = (id: string, browser: RemoteBrowser, active: boolean = false): void => {
this.pool = {
...this.pool,
[id]: {
browser,
active,
isRobotRun
},
}
logger.log('debug', `Remote browser with id: ${id} added to the pool`);
};
public hasActiveRobotRun(): boolean {
return Object.values(this.pool).some(info => info.isRobotRun);
}
public clearRobotRunState(id: string): void {
if (this.pool[id]) {
this.pool[id].isRobotRun = false;
logger.log('debug', `Robot run state cleared for browser ${id}`);
}
}
/**
* Removes the remote browser instance from the pool.
* @param id remote browser instance's id
@@ -81,8 +67,6 @@ export class BrowserPool {
logger.log('warn', `Remote browser with id: ${id} does not exist in the pool`);
return false;
}
this.clearRobotRunState(id);
delete (this.pool[id]);
logger.log('debug', `Remote browser with id: ${id} deleted from the pool`);
return true;