feat: stop interpretaion and get current page

This commit is contained in:
karishmas6
2024-06-01 11:03:44 +05:30
parent 8b9ce90a6d
commit 6bbd71baf4

View File

@@ -240,6 +240,23 @@ export class RemoteBrowser {
}
};
/**
* Stops the workflow interpretation and initializes a new page.
* @returns {Promise<void>}
*/
public stopCurrentInterpretation = async () : Promise<void> => {
await this.interpreter.stopInterpretation();
await this.initializeNewPage();
};
/**
* Returns the current page instance.
* @returns {Page | null | undefined}
*/
public getCurrentPage = () : Page | null | undefined => {
return this.currentPage;
};
/**
* Initiates screencast of the remote browser through socket,
* registers listener for rerender event and emits the loaded event.