Update chrome.js

This commit is contained in:
Namhyeon Go 2022-01-13 00:15:03 +09:00 committed by GitHub
parent a0cf73944c
commit 3e06104167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -49,11 +49,17 @@ var ChromeObject = function() {
this.title = ""; this.title = "";
this.frameIndex = -1; this.frameIndex = -1;
this.isPreventEvaluate = false;
this.create = function() { this.create = function() {
this.oAutoIt = AutoItX.create().getInterface(); this.oAutoIt = AutoItX.create().getInterface();
return this; return this;
}; };
this.setIsPreventEvaluate = function(flag) {
this.isPreventEvaluate = true;
};
this.setBinPath = function(path) { this.setBinPath = function(path) {
this.binPath = path; this.binPath = path;
return this; return this;
@ -450,6 +456,8 @@ var ChromeObject = function() {
}; };
this.evaluate = function(expression, frameIndex) { this.evaluate = function(expression, frameIndex) {
if (this.isPreventEvaluate) return;
var frameIndex = (typeof frameIndex !== "undefined" ? frameIndex : this.frameIndex); var frameIndex = (typeof frameIndex !== "undefined" ? frameIndex : this.frameIndex);
if (frameIndex > -1) { if (frameIndex > -1) {
@ -1153,7 +1161,7 @@ exports.startDebug = function(url, proxy, profileName, debuggingPort, isPreventP
.setIsPreventProxy(isPreventProxy) .setIsPreventProxy(isPreventProxy)
.addUserAgentsFromFile("data\\Chrome.txt") .addUserAgentsFromFile("data\\Chrome.txt")
.addUserAgentsFromFile("data\\Edge.txt") .addUserAgentsFromFile("data\\Edge.txt")
.addUserAgentsFromFile("data\\Safari.txt") .addUserAgentsFromFile("data\\Safari.txt")
.open(url) .open(url)
; ;
}; };