Update chrome.js

This commit is contained in:
Namhyeon Go 2022-02-10 13:25:58 +09:00
parent 82713e1588
commit 6e38fe1191

View File

@ -544,26 +544,26 @@ var ChromeObject = function(interfaces) {
this._focus = function() {
var title = "";
try {
// get current title
var _title = this.getTitle();
try {
// get current title
var _title = this.getTitle();
// if not focused
if (_title.indexOf(this.pageId.substring(0, 6)) < 0) {
// save previous title
this.title = _title;
// if not focused
if (_title.indexOf(this.pageId.substring(0, 6)) < 0) {
// save previous title
this.title = _title;
// will be change title
title = this.title + " " + this.pageId.substring(0, 6);
// will be change title
title = this.title + " " + this.pageId.substring(0, 6);
// change webpage title for focusing window
this.setTitle(title);
} else {
title = _title; /// when it is already catch
}
} catch (e) {
console.error("ChromeObject._focus() ->", e.message);
}
// change webpage title for focusing window
this.setTitle(title);
} else {
title = _title; /// when it is already catch
}
} catch (e) {
console.error("ChromeObject._focus() ->", e.message);
}
return title;
};
@ -608,7 +608,7 @@ var ChromeObject = function(interfaces) {
var w = this.getRandomInt(bX * 3, sX - bX);
var h = this.getRandomInt(bY, sY - bY);
this.oAutoIt.callFunction("WinMove", [title, "", x, y, w, h]);
// blur
this.blur();
};
@ -1166,7 +1166,8 @@ var ChromeObject = function(interfaces) {
};
this.mouseClick = function(x, y) {
this.oAutoIt.callFunction("MouseMove", [x, y]);
var screenPosition = this.getScreenPosition();
this.oAutoIt.callFunction("MouseMove", [screenPosition.x + x, screenPosition.y + y]);
this.oAutoIt.callFunction("MouseClick", ["left"]);
};
@ -1212,6 +1213,6 @@ exports.startDebug = function(url, proxy, profileName, debuggingPort, isPreventP
;
};
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.2";
exports.VERSIONINFO = "Chrome Web Browser Debugging Interface (chrome.js) version 0.3";
exports.global = global;
exports.require = global.require;