Skip to content

Commit

Permalink
Input Function Update
Browse files Browse the repository at this point in the history
  • Loading branch information
naibo committed Mar 24, 2023
1 parent 8a404ee commit 1be87bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions ElectronJS/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,10 @@ async function beginInvoke(msg) {
socket_flowchart.send(msg.message.pipe); //直接把消息转接
let message = JSON.parse(msg.message.pipe);
let type = message.type;
if(type.indexOf("Click")>=0){
await new Promise(resolve => setTimeout(resolve, 2000)); //等两秒
let handles = await driver.getAllWindowHandles();
if(arrayDifference(handles, old_handles).length > 0){
old_handles = handles;
current_handle = handles[handles.length - 1];
console.log("New tab opened, change current_handle to: ", current_handle);
}
}
// if(type.indexOf("Click")>=0){
// await new Promise(resolve => setTimeout(resolve, 2000)); //等两秒
//
// }
} else {
socket_window.send(msg.message.pipe);
}
Expand Down Expand Up @@ -246,8 +241,14 @@ wss.on('connection', function (ws) {
} else if (msg.message.id == 2) {
socket_flowchart = ws;
console.log("set socket_flowchart");
} else{
} else { //其他的ID是用来标识不同的浏览器标签页的
await new Promise(resolve => setTimeout(resolve, 2300));
let handles = await driver.getAllWindowHandles();
if(arrayDifference(handles, old_handles).length > 0){
old_handles = handles;
current_handle = handles[handles.length - 1];
console.log("New tab opened, change current_handle to: ", current_handle);
}
handle_pairs[msg.message.id] = current_handle;
console.log("Set handle_pair for id: ", msg.message.id, " to ", current_handle);
// console.log("handle_pairs: ", handle_pairs);
Expand Down
Binary file added Releases/nzpE644.tmp
Binary file not shown.

0 comments on commit 1be87bb

Please sign in to comment.