channel-worker 1.0.29 → 1.0.30
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 +7 -5
- package/package.json +1 -1
package/lib/command-poller.js
CHANGED
|
@@ -620,14 +620,16 @@ class CommandPoller {
|
|
|
620
620
|
await new Promise(r => setTimeout(r, 300));
|
|
621
621
|
// Type text
|
|
622
622
|
await send('Input.insertText', { text });
|
|
623
|
-
// Press Enter/
|
|
623
|
+
// Press Enter/Tab to confirm (e.g. Facebook tags)
|
|
624
624
|
if (press_enter) {
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
await new Promise(r => setTimeout(r, 300));
|
|
628
|
-
// Also press Enter
|
|
625
|
+
await new Promise(r => setTimeout(r, 500));
|
|
626
|
+
// Try Enter first
|
|
629
627
|
await send('Input.dispatchKeyEvent', { type: 'rawKeyDown', key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13, nativeVirtualKeyCode: 13 });
|
|
630
628
|
await send('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Enter', code: 'Enter', windowsVirtualKeyCode: 13, nativeVirtualKeyCode: 13 });
|
|
629
|
+
await new Promise(r => setTimeout(r, 500));
|
|
630
|
+
// Also try Tab (some inputs confirm on Tab)
|
|
631
|
+
await send('Input.dispatchKeyEvent', { type: 'rawKeyDown', key: 'Tab', code: 'Tab', windowsVirtualKeyCode: 9, nativeVirtualKeyCode: 9 });
|
|
632
|
+
await send('Input.dispatchKeyEvent', { type: 'keyUp', key: 'Tab', code: 'Tab', windowsVirtualKeyCode: 9, nativeVirtualKeyCode: 9 });
|
|
631
633
|
}
|
|
632
634
|
ws.close();
|
|
633
635
|
resolve({ success: true, length: text.length });
|