feat: 增快鼠标移动速度 (ref #13)

This commit is contained in:
foxhui
2026-01-24 03:51:16 +08:00
Unverified
parent a85b731ce1
commit 5b7d1e9322
3 changed files with 7 additions and 2 deletions
+4
View File
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Token 留空问题**
- 修复 WebUI 留空Token后无法重启的问题(允许 Token 留空)
### 🔄 Changed
- **鼠标轨迹**
- 增快鼠标移动速度
### ❌ Removed
- **热门模型ID**
- 竞技场删除了 gemini-3-pro-image-preview-2k,因此项目同步删除
+2 -1
View File
@@ -270,7 +270,8 @@ export async function safeClick(page, target, options = {}) {
if (box) {
const { x, y } = getHumanClickPoint(box, options.bias || 'random');
logger.debug('浏览器', `[safeClick] 移动鼠标到 (${x.toFixed(0)}, ${y.toFixed(0)})...`);
await page.cursor.moveTo({ x, y });
const cursorSpeed = options.cursorSpeed ?? 40;
await page.cursor.moveTo({ x, y }, { moveSpeed: cursorSpeed });
logger.debug('浏览器', `[safeClick] 执行点击...`);
await page.mouse.click(x, y, { clickCount });
return;
+1 -1
View File
@@ -108,7 +108,7 @@ export async function gotoWithCheck(page, url, options = {}) {
const { timeout = TIMEOUTS.NAVIGATION } = options;
try {
const response = await page.goto(url, {
waitUntil: 'domcontentloaded',
waitUntil: 'load',
timeout
});
if (!response) {