mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
fix
This commit is contained in:
parent
4c68780e87
commit
c9bc48ad88
|
@ -1,13 +1,13 @@
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
// AutoIt (AutoIt3, AutoItX) API
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// autoit.js
|
||||
// AutoIt (AutoIt3, AutoItX) API interface for WelsonJS framework
|
||||
// Namhyeon Go (Catswords Research) <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
function AutoItObject() {
|
||||
this.interface = null;
|
||||
this._interface = null;
|
||||
|
||||
this.create = function() {
|
||||
try {
|
||||
this.interface = CreateObject("AutoItX3.Control");
|
||||
this._interface = CreateObject("AutoItX3.Control");
|
||||
} catch (e) {
|
||||
console.error("AutoIt_CreateObject() ->", e.message);
|
||||
}
|
||||
|
@ -37,10 +37,10 @@ function AutoItObject() {
|
|||
this.callFunction = function(functionName, args) {
|
||||
console.log("Calling AutoItX function...", functionName);
|
||||
|
||||
if (this.interface != null) {
|
||||
if (this._interface != null) {
|
||||
try {
|
||||
//this.interface[functionName].apply(null, args);
|
||||
eval("this.interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")");
|
||||
//this._interface[functionName].apply(null, args);
|
||||
eval("this._interface." + functionName + "(\"" + args.map(addslashes).join("\", \"") + "\")");
|
||||
sleep(300);
|
||||
} catch (e) {
|
||||
console.error("AutoItObject.callFunction() ->", e.message);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// chrome.js
|
||||
// Chrome Web Browser Debugging Interface for WelsonJS framework
|
||||
// Namhyeon Go <abuse@catswords.net>
|
||||
// This code is part of WelsonJS framework
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
|
||||
var STD = require("lib/std");
|
||||
|
@ -17,10 +17,9 @@ var ExtraMath = require("lib/extramath");
|
|||
// for remote debugging
|
||||
var pageEventId = 0;
|
||||
|
||||
var ChromeObject = function(interfaces) {
|
||||
var ChromeObject = function() {
|
||||
STD.EventTarget.apply(this, arguments); // Set event-attachable object
|
||||
|
||||
this.interfaces = (typeof interfaces !== "undefined" ? interfaces : []);
|
||||
this.vendor = "Chrome";
|
||||
this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application";
|
||||
this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application\\chrome.exe";
|
||||
|
@ -1406,7 +1405,7 @@ exports.startDebugInPrivate = function(url, proxy, profileName, debuggingPort, i
|
|||
;
|
||||
};
|
||||
|
||||
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.8";
|
||||
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.4.9";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// pipe-ipc.js
|
||||
// Pipe based IPC implementation for WelsonJS framework
|
||||
// Namhyeon Go (Catswords Research) <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
|
||||
var STD = require("lib/std");
|
||||
|
||||
// https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/opentextfile-method
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
// toolkit.js
|
||||
// WelsonJS native component interface for WelsonJS framework
|
||||
// Namhyeon Go <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
|
||||
function ToolkitObject() {
|
||||
this.interface = null;
|
||||
this._interface = null;
|
||||
|
||||
this.create = function() {
|
||||
try {
|
||||
this.interface = CreateObject("WelsonJS.Toolkit");
|
||||
this._interface = CreateObject("WelsonJS.Toolkit");
|
||||
} catch (e) {
|
||||
console.info("WelsonJS.Toolkit not installed");
|
||||
console.info("It could be download from https://github.com/gnh1201/welsonjs");
|
||||
|
@ -17,7 +18,7 @@ function ToolkitObject() {
|
|||
};
|
||||
|
||||
this.getInterface = function() {
|
||||
return this.interface;
|
||||
return this._interface;
|
||||
};
|
||||
|
||||
this.create();
|
||||
|
@ -114,7 +115,7 @@ exports.closeProcess = closeProcess;
|
|||
exports.encryptStringHIGHT = encryptStringHIGHT;
|
||||
exports.decryptStringHIGHT = decryptStringHIGHT;
|
||||
|
||||
exports.VERSIONINFO = "WelsonJS native component (WelsonJS.Toolkit) version 0.3.5";
|
||||
exports.VERSIONINFO = "WelsonJS native component interface (WelsonJS.Toolkit) version 0.3.6";
|
||||
exports.AUTHOR = "abuse@catswords.net";
|
||||
exports.global = global;
|
||||
exports.require = global.require;
|
||||
|
|
20
lib/wmi.js
20
lib/wmi.js
|
@ -1,24 +1,24 @@
|
|||
////////////////////////////////////////////////////////////////////////
|
||||
// WMI(Windows Management Instrumentation) API
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// wmi.js
|
||||
// WMI(Windows Management Instrumentation) API interface for WelsonJS framework
|
||||
// Namhyeon Go (Catswords Research) <abuse@catswords.net>
|
||||
// https://github.com/gnh1201/welsonjs
|
||||
var WMIQueryObject = function() {
|
||||
var wbemFlagReturnImmediately = 0x10;
|
||||
var wbemFlagForwardOnly = 0x20;
|
||||
|
||||
this.computer = ".";
|
||||
this.namespace = "root\\cimv2";
|
||||
this.interface = null;
|
||||
this._interface = null;
|
||||
this.cursor = {};
|
||||
this.current = {};
|
||||
|
||||
this.create = function() {
|
||||
try {
|
||||
if (typeof(GetObject) === "function") {
|
||||
this.interface = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\" + this.computer + "\\" + this.namespace);
|
||||
this._interface = GetObject("winmgmts:{impersonationLevel=impersonate}!\\\\" + this.computer + "\\" + this.namespace);
|
||||
} else {
|
||||
var objLocator = CreateObject("WbemScripting.SWbemLocator");
|
||||
this.interface = objLocator.ConnectServer(this.computer, this.namespace);
|
||||
this._interface = objLocator.ConnectServer(this.computer, this.namespace);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
|
@ -38,7 +38,7 @@ var WMIQueryObject = function() {
|
|||
|
||||
this.execQuery = function(query) {
|
||||
try {
|
||||
var result = this.interface.ExecQuery(query, "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
|
||||
var result = this._interface.ExecQuery(query, "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
|
||||
this.cursor = new Enumerator(result);
|
||||
} catch (e) {
|
||||
console.error(e.message);
|
||||
|
@ -70,7 +70,7 @@ var WMIQueryObject = function() {
|
|||
};
|
||||
|
||||
var WMIClassObject = function() {
|
||||
this.interface = (new WMIQueryObject()).interface;
|
||||
this._interface = (new WMIQueryObject()).interface;
|
||||
this.classObject = null;
|
||||
this.className = "";
|
||||
this.instance = null;
|
||||
|
@ -82,7 +82,7 @@ var WMIClassObject = function() {
|
|||
// Instance
|
||||
this.setClass = function(className) {
|
||||
this.className = className;
|
||||
this.classObject = this.interface.Get(className);
|
||||
this.classObject = this._interface.Get(className);
|
||||
return this;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user