feat: handle mouse move

This commit is contained in:
karishmas6
2024-06-08 23:00:27 +05:30
parent 071f835a2e
commit 9361ad916f

View File

@@ -173,3 +173,17 @@ const onMousemove = async (coordinates: Coordinates) => {
await handleWrapper(handleMousemove, coordinates);
}
const handleMousemove = async (generator: WorkflowGenerator, page: Page, { x, y }: Coordinates) => {
try {
await page.mouse.move(x, y);
throttle(async () => {
await generator.generateDataForHighlighter(page, { x, y });
}, 100)();
logger.log('debug', `Moved over position x:${x}, y:${y}`);
} catch (e) {
const { message } = e as Error;
logger.log('error', message);
}
}