Update lib/toolkit.js, lib/chrome.js

This commit is contained in:
Namhyeon Go 2022-02-10 15:06:11 +09:00
parent 4bc9669195
commit 255f9dab32
3 changed files with 15 additions and 9 deletions

View File

@ -10,6 +10,7 @@ var FILE = require("lib/file");
var HTTP = require("lib/http"); var HTTP = require("lib/http");
var Websocket = require("lib/websocket"); var Websocket = require("lib/websocket");
var AutoIt = require("lib/autoit"); var AutoIt = require("lib/autoit");
var ToolKit = require("lib/toolkit");
// for remote debugging // for remote debugging
var pageEventId = 0; var pageEventId = 0;
@ -41,6 +42,7 @@ var ChromeObject = function(interfaces) {
// dependencies // dependencies
this.oAutoIt = null; this.oAutoIt = null;
this.oToolkit = null;
// for remote debugging // for remote debugging
this.debuggingPort = 0; this.debuggingPort = 0;
@ -55,6 +57,7 @@ var ChromeObject = function(interfaces) {
this.create = function() { this.create = function() {
this.oAutoIt = AutoIt.create(); this.oAutoIt = AutoIt.create();
this.oToolkit = ToolKit.create();
return this; return this;
}; };
@ -1171,6 +1174,10 @@ var ChromeObject = function(interfaces) {
this.oAutoIt.callFunction("MouseClick", ["left"]); this.oAutoIt.callFunction("MouseClick", ["left"]);
}; };
this.vMouseClick = function(x, y) {
this.oToolkit.sendClick(this.pageId.substring(0, 6), x, y, 1);
};
this.mouseWheelUp = function() { this.mouseWheelUp = function() {
this.oAutoIt.callFunction("MouseWheel", ["up"]); this.oAutoIt.callFunction("MouseWheel", ["up"]);
}; };

View File

@ -1 +0,0 @@

View File

@ -10,7 +10,7 @@ var ToolkitObject = function() {
this.interface = CreateObject("WelsonJS.Toolkit"); this.interface = CreateObject("WelsonJS.Toolkit");
return this; return this;
} catch (e) { } catch (e) {
console.error("ToolkitObject.create() ->", e.message); console.warn("WelsonJS.Toolkit is disabled");
} }
}; };