mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-11 20:21:03 +00:00
Update chrome.js
This commit is contained in:
parent
1ed11ef92c
commit
e7b8aee6ab
|
@ -1007,7 +1007,7 @@ var ChromeObject = function(interfaces) {
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.triggerEventByFind = function(eventName, selector, searchText) {
|
||||
var s = '(function() {'
|
||||
+ ' var element = Object.values(__getDocument().querySelectorAll("' + selector + '")).find(function(x) {'
|
||||
|
@ -1068,6 +1068,10 @@ var ChromeObject = function(interfaces) {
|
|||
return this.getEvaluatedValue('__getDocument().querySelector("' + selector + '").getAttribute("' + attributeName + '")');
|
||||
};
|
||||
|
||||
this.sendKeys = function(s) {
|
||||
AutoIt.callFunction("Send", [s]);
|
||||
};
|
||||
|
||||
this.sendSpaceKey = function() {
|
||||
AutoIt.callFunction("Send", ["{SPACE}"]);
|
||||
};
|
||||
|
@ -1088,7 +1092,7 @@ var ChromeObject = function(interfaces) {
|
|||
i++;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.getText = function(selector) {
|
||||
return this.getEvaluatedValue('__getDocument().querySelector("' + selector + '").innerText');
|
||||
};
|
||||
|
@ -1157,6 +1161,11 @@ var ChromeObject = function(interfaces) {
|
|||
return this;
|
||||
};
|
||||
|
||||
this.mouseClick = function(x, y) {
|
||||
AutoIt.callFunction("MouseMove", [x, y]);
|
||||
AutoIt.callFunction("MouseClick", ["left"]);
|
||||
};
|
||||
|
||||
this.create();
|
||||
};
|
||||
ChromeObject.prototype = new STD.EventableObject();
|
||||
|
|
Loading…
Reference in New Issue
Block a user