channel-worker 1.0.31 → 1.0.32
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 +8 -11
- package/package.json +1 -1
package/lib/command-poller.js
CHANGED
|
@@ -631,18 +631,15 @@ 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) {
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
await send('Input.
|
|
645
|
-
await send('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Tab', code: 'Tab', windowsVirtualKeyCode: 9, nativeVirtualKeyCode: 9 });
|
|
636
|
+
// Type each character individually so React detects 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
|
+
}
|
|
641
|
+
} else {
|
|
642
|
+
await send('Input.insertText', { text });
|
|
646
643
|
}
|
|
647
644
|
ws.close();
|
|
648
645
|
resolve({ success: true, length: text.length });
|