fix: if page closed !get element rect

This commit is contained in:
Karishma Shukla
2025-08-21 20:31:26 +05:30
committed by GitHub
parent 1abfd6a811
commit b6ee449b9c

View File

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