mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-09 21:26:04 +00:00
Update chrome.js
This commit is contained in:
parent
82713e1588
commit
6e38fe1191
|
@ -544,26 +544,26 @@ var ChromeObject = function(interfaces) {
|
||||||
this._focus = function() {
|
this._focus = function() {
|
||||||
var title = "";
|
var title = "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// get current title
|
// get current title
|
||||||
var _title = this.getTitle();
|
var _title = this.getTitle();
|
||||||
|
|
||||||
// if not focused
|
// if not focused
|
||||||
if (_title.indexOf(this.pageId.substring(0, 6)) < 0) {
|
if (_title.indexOf(this.pageId.substring(0, 6)) < 0) {
|
||||||
// save previous title
|
// save previous title
|
||||||
this.title = _title;
|
this.title = _title;
|
||||||
|
|
||||||
// will be change title
|
// will be change title
|
||||||
title = this.title + " " + this.pageId.substring(0, 6);
|
title = this.title + " " + this.pageId.substring(0, 6);
|
||||||
|
|
||||||
// change webpage title for focusing window
|
// change webpage title for focusing window
|
||||||
this.setTitle(title);
|
this.setTitle(title);
|
||||||
} else {
|
} else {
|
||||||
title = _title; /// when it is already catch
|
title = _title; /// when it is already catch
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("ChromeObject._focus() ->", e.message);
|
console.error("ChromeObject._focus() ->", e.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return title;
|
return title;
|
||||||
};
|
};
|
||||||
|
@ -608,7 +608,7 @@ var ChromeObject = function(interfaces) {
|
||||||
var w = this.getRandomInt(bX * 3, sX - bX);
|
var w = this.getRandomInt(bX * 3, sX - bX);
|
||||||
var h = this.getRandomInt(bY, sY - bY);
|
var h = this.getRandomInt(bY, sY - bY);
|
||||||
this.oAutoIt.callFunction("WinMove", [title, "", x, y, w, h]);
|
this.oAutoIt.callFunction("WinMove", [title, "", x, y, w, h]);
|
||||||
|
|
||||||
// blur
|
// blur
|
||||||
this.blur();
|
this.blur();
|
||||||
};
|
};
|
||||||
|
@ -1166,7 +1166,8 @@ var ChromeObject = function(interfaces) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.mouseClick = function(x, y) {
|
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"]);
|
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.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user