Improve autosubmit via Chromium's debugger

This commit is contained in:
Maxim Baz
2019-10-30 23:52:32 +01:00
committed by GitHub
parent 083935920c
commit 87eb6e0156

View File

@@ -327,14 +327,17 @@ async function dispatchFocusOrSubmit(settings, request, allFrames, allowForeign)
for (let frame of perFrameResults) { for (let frame of perFrameResults) {
if (frame.needPressEnter) { if (frame.needPressEnter) {
chrome.debugger.attach({ tabId: settings.tab.id }, "1.2"); chrome.debugger.attach({ tabId: settings.tab.id }, "1.2");
for (let type of ["keyDown", "keyUp"]) { for (let type of ["keyDown", "char", "keyUp"]) {
chrome.debugger.sendCommand( chrome.debugger.sendCommand(
{ tabId: settings.tab.id }, { tabId: settings.tab.id },
"Input.dispatchKeyEvent", "Input.dispatchKeyEvent",
{ {
type: type, type: type,
key: "Enter",
windowsVirtualKeyCode: 13, windowsVirtualKeyCode: 13,
nativeVirtualKeyCode: 13 nativeVirtualKeyCode: 13,
unmodifiedText: "\r",
text: "\r"
} }
); );
} }