channel-worker 1.0.31 → 1.0.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/command-poller.js +10 -10
- package/package.json +1 -1
package/lib/command-poller.js
CHANGED
|
@@ -631,18 +631,18 @@ class CommandPoller {
|
|
|
631
631
|
}
|
|
632
632
|
// Small delay for focus to take effect
|
|
633
633
|
await new Promise(r => setTimeout(r, 300));
|
|
634
|
-
// Type text
|
|
635
|
-
await send('Input.insertText', { text });
|
|
636
|
-
// Press Enter/Tab to confirm (e.g. Facebook tags)
|
|
634
|
+
// Type text — use char-by-char for inputs that need keystroke events (press_enter mode)
|
|
637
635
|
if (press_enter) {
|
|
636
|
+
// Type each character with delay so React processes keystrokes
|
|
637
|
+
for (const char of text) {
|
|
638
|
+
await send('Input.dispatchKeyEvent', { type: 'keyDown', key: char, text: char });
|
|
639
|
+
await send('Input.dispatchKeyEvent', { type: 'keyUp', key: char });
|
|
640
|
+
await new Promise(r => setTimeout(r, 50));
|
|
641
|
+
}
|
|
642
|
+
// Extra delay after comma for Facebook to confirm tag
|
|
638
643
|
await new Promise(r => setTimeout(r, 500));
|
|
639
|
-
|
|
640
|
-
await send('Input.
|
|
641
|
-
await send('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13, nativeVirtualKeyCode: 13 });
|
|
642
|
-
await new Promise(r => setTimeout(r, 500));
|
|
643
|
-
// Also try Tab (some inputs confirm on Tab)
|
|
644
|
-
await send('Input.dispatchKeyEvent', { type: 'rawKeyDown', key: 'Tab', code: 'Tab', windowsVirtualKeyCode: 9, nativeVirtualKeyCode: 9 });
|
|
645
|
-
await send('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Tab', code: 'Tab', windowsVirtualKeyCode: 9, nativeVirtualKeyCode: 9 });
|
|
644
|
+
} else {
|
|
645
|
+
await send('Input.insertText', { text });
|
|
646
646
|
}
|
|
647
647
|
ws.close();
|
|
648
648
|
resolve({ success: true, length: text.length });
|