mirror of
https://github.com/foxhui/WebAI2API.git
synced 2026-06-16 21:03:59 +08:00
rm: 移除操作完毕后模拟移开鼠标的步骤
This commit is contained in:
@@ -146,24 +146,6 @@ export async function tryGotoWithCheck(page, url, options = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务完成后移开鼠标(拟人化行为)
|
||||
* @param {import('playwright-core').Page} page - Playwright 页面对象
|
||||
*/
|
||||
export async function moveMouseAway(page) {
|
||||
if (!page.cursor) return;
|
||||
|
||||
try {
|
||||
const vp = await getRealViewport(page);
|
||||
await page.cursor.moveTo({
|
||||
x: clamp(vp.safeWidth * random(0.85, 0.95), 0, vp.safeWidth),
|
||||
y: clamp(vp.height * random(0.3, 0.7), 0, vp.safeHeight)
|
||||
});
|
||||
} catch (e) {
|
||||
// 忽略鼠标移动失败
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 等待元素出现并滚动到可视范围
|
||||
* @param {import('playwright-core').Page} page - Playwright 页面对象
|
||||
|
||||
Reference in New Issue
Block a user