fix: if page closed !get element rect

This commit is contained in:
Karishma Shukla
2025-08-21 20:32:19 +05:30
committed by GitHub
parent b6ee449b9c
commit 1abd277fc4

View File

@@ -846,6 +846,10 @@ export const getRect = async (page: Page, coordinates: Coordinates, listSelector
);
return rect;
} else {
if (page.isClosed()) {
logger.debug('Page is closed, cannot get element rect (else branch)');
return null;
}
const rect = await page.evaluate(
async ({ x, y }) => {
const getDeepestElementFromPoint = (x: number, y: number): HTMLElement | null => {