mirror of
https://github.com/foxhui/WebAI2API.git
synced 2026-06-16 21:03:59 +08:00
fix: 修复拟人输入在苹果系统上无法全选删除的问题
This commit is contained in:
@@ -242,10 +242,11 @@ export async function humanType(page, target, text) {
|
||||
// 2. 停顿思考
|
||||
await sleep(500, 1000);
|
||||
|
||||
// 3. 全选删除
|
||||
await page.keyboard.down('Control');
|
||||
// 3. 全选删除 (macOS 使用 Meta/Command, Windows/Linux 使用 Control)
|
||||
const modifierKey = process.platform === 'darwin' ? 'Meta' : 'Control';
|
||||
await page.keyboard.down(modifierKey);
|
||||
await page.keyboard.press('A');
|
||||
await page.keyboard.up('Control');
|
||||
await page.keyboard.up(modifierKey);
|
||||
await sleep(100, 300);
|
||||
await page.keyboard.press('Backspace');
|
||||
await sleep(100, 300);
|
||||
|
||||
Reference in New Issue
Block a user