fix: no cursor position if page closed
This commit is contained in:
@@ -541,6 +541,10 @@ export class WorkflowGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((elementInfo?.tagName === 'INPUT' || elementInfo?.tagName === 'TEXTAREA') && selector) {
|
if ((elementInfo?.tagName === 'INPUT' || elementInfo?.tagName === 'TEXTAREA') && selector) {
|
||||||
|
if (page.isClosed()) {
|
||||||
|
logger.log('debug', 'Page is closed, cannot get cursor position');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const positionAndCursor = await page.evaluate(
|
const positionAndCursor = await page.evaluate(
|
||||||
({ selector, coords }) => {
|
({ selector, coords }) => {
|
||||||
const getCursorPosition = (element: any, clickX: any) => {
|
const getCursorPosition = (element: any, clickX: any) => {
|
||||||
@@ -1342,4 +1346,4 @@ export class WorkflowGenerator {
|
|||||||
public clearLastIndex = () => {
|
public clearLastIndex = () => {
|
||||||
this.generatedData.lastIndex = null;
|
this.generatedData.lastIndex = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user