Add files via upload

This commit is contained in:
Namhyeon Go 2021-08-11 02:46:37 +09:00 committed by GitHub
parent e7f2cd16d1
commit 029a4f785b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 11 deletions

View File

@ -190,7 +190,7 @@ var ChromeObject = function() {
sleep(1500);
shell.release();
} catch (e) {
console.error("ChromeObject.open() -> " + e.message);
console.error("ChromeObject.open() ->", e.message);
sleep(1500);
}
}
@ -335,7 +335,7 @@ var ChromeObject = function() {
"expression": expression
});
} catch (e) {
console.error("ChromeObject.evaluate() -> " + e.message);
console.error("ChromeObject.evaluate() ->", e.message);
}
};
@ -345,7 +345,8 @@ var ChromeObject = function() {
console.info(responseText);
return JSON.parse(responseText).result.result.value;
} catch (e) {
console.error("ChromeObject.getEvaluatedValue() -> " + e.message);
console.error("ChromeObject.getEvaluatedValue() ->", e.message);
return "";
}
};
@ -357,7 +358,7 @@ var ChromeObject = function() {
try {
this.oAutoIt.WinKill(this.pageId);
} catch (e) {
console.error("ChromeObject.terminate() -> " + e.message);
console.error("ChromeObject.terminate() ->", e.message);
}
};
@ -375,7 +376,7 @@ var ChromeObject = function() {
// _focus()
this._focus();
} catch (e) {
console.error("ChromeObject._focus() -> " + e.message);
console.error("ChromeObject._focus() ->", e.message);
}
}
};
@ -396,7 +397,7 @@ var ChromeObject = function() {
this.oAutoIt.WinActivate(this.pageId);
}
} catch (e) {
console.error("ChromeObject.focus() -> " + e.message);
console.error("ChromeObject.focus() ->", e.message);
}
}
};
@ -419,7 +420,7 @@ var ChromeObject = function() {
// change webpage title for focusing window
this.setTitle(this.pageId);
} catch (e) {
console.error("ChromeObject.focusWithoutActivate() -> " + e.message);
console.error("ChromeObject.focusWithoutActivate() ->", e.message);
}
}
};
@ -455,7 +456,7 @@ var ChromeObject = function() {
this.oAutoIt.MouseMove(pos.x + 100, pos.y + 100);
this.oAutoIt.MouseWheel("down", times);
} catch (e) {
console.error("ChromeObject.downMouseWheel() -> " + e.message);
console.error("ChromeObject.downMouseWheel() ->", e.message);
}
}
};
@ -467,7 +468,7 @@ var ChromeObject = function() {
this.oAutoIt.MouseMove(pos.x + 100, pos.y + 100);
this.oAutoIt.MouseWheel("up", times);
} catch (e) {
console.error("ChromeObject.upMouseWheel() -> " + e.message);
console.error("ChromeObject.upMouseWheel() ->", e.message);
}
}
};
@ -615,7 +616,7 @@ var ChromeObject = function() {
isDone = true;
} catch(e) {
sleep(1);
console.error("ChromeObject.checkDebuggingPort() -> " + e.message);
console.error("ChromeObject.checkDebuggingPort() ->", e.message);
}
}
@ -669,7 +670,7 @@ var ChromeObject = function() {
return false;
}
} catch (e) {
console.error("ChromeObject.hasClass() -> " + e.message);
console.error("ChromeObject.hasClass() ->", e.message);
}
};
@ -689,6 +690,10 @@ var ChromeObject = function() {
}
};
this.getText = function(selector) {
return this.getEvaluatedValue('document.querySelector("' + selector + '").innerText');
};
this.create();
};

View File

@ -38,3 +38,7 @@ exports.sendClick = function(wName, x, y, repeat) {
i++;
}
};
exports.sendKeys = function(wName, s) {
return Toolkit.getInterface().SendKeys(wName, s);
};